effect
stringclasses 48
values | original_source_type
stringlengths 0
23k
| opens_and_abbrevs
listlengths 2
92
| isa_cross_project_example
bool 1
class | source_definition
stringlengths 9
57.9k
| partial_definition
stringlengths 7
23.3k
| is_div
bool 2
classes | is_type
null | is_proof
bool 2
classes | completed_definiton
stringlengths 1
250k
| dependencies
dict | effect_flags
sequencelengths 0
2
| ideal_premises
sequencelengths 0
236
| mutual_with
sequencelengths 0
11
| file_context
stringlengths 0
407k
| interleaved
bool 1
class | is_simply_typed
bool 2
classes | file_name
stringlengths 5
48
| vconfig
dict | is_simple_lemma
null | source_type
stringlengths 10
23k
| proof_features
sequencelengths 0
1
| name
stringlengths 8
95
| source
dict | verbose_type
stringlengths 1
7.42k
| source_range
dict |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FStar.Pervasives.Lemma | val can_be_split_congr_r
(p q r: vprop)
: Lemma
(requires (p `can_be_split` q))
(ensures ((r `star` p) `can_be_split` (r `star` q))) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q)) | val can_be_split_congr_r
(p q r: vprop)
: Lemma
(requires (p `can_be_split` q))
(ensures ((r `star` p) `can_be_split` (r `star` q)))
let can_be_split_congr_r p q r = | false | null | true | Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q)) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"lemma"
] | [
"Steel.Effect.Common.vprop",
"FStar.Classical.forall_intro",
"Steel.Memory.mem",
"Prims.l_iff",
"Steel.Memory.interp",
"Steel.Memory.star",
"Steel.Effect.Common.hp_of",
"Prims.l_Exists",
"Prims.l_and",
"Steel.Memory.disjoint",
"Prims.eq2",
"Steel.Memory.join",
"Steel.Memory.interp_star",
"Prims.unit"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r)) | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val can_be_split_congr_r
(p q r: vprop)
: Lemma
(requires (p `can_be_split` q))
(ensures ((r `star` p) `can_be_split` (r `star` q))) | [] | Steel.Effect.Common.can_be_split_congr_r | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p: Steel.Effect.Common.vprop -> q: Steel.Effect.Common.vprop -> r: Steel.Effect.Common.vprop
-> FStar.Pervasives.Lemma (requires Steel.Effect.Common.can_be_split p q)
(ensures
Steel.Effect.Common.can_be_split (Steel.Effect.Common.star r p)
(Steel.Effect.Common.star r q)) | {
"end_col": 58,
"end_line": 42,
"start_col": 2,
"start_line": 41
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()}) | let h_exists #a f = | false | null | false | VUnit ({ hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> () }) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"total"
] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.VUnit",
"Steel.Effect.Common.Mkvprop'",
"Steel.Memory.h_exists",
"Steel.Effect.Common.hp_of",
"Steel.Memory.slprop",
"Prims.unit",
"Steel.Memory.hmem"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val h_exists : f: (_: _ -> Steel.Effect.Common.vprop) -> Steel.Effect.Common.vprop | [] | Steel.Effect.Common.h_exists | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | f: (_: _ -> Steel.Effect.Common.vprop) -> Steel.Effect.Common.vprop | {
"end_col": 99,
"end_line": 23,
"start_col": 20,
"start_line": 23
} |
|
FStar.Pervasives.Lemma | val can_be_split_congr_l
(p q r: vprop)
: Lemma
(requires (p `can_be_split` q))
(ensures ((p `star` r) `can_be_split` (q `star` r))) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r)) | val can_be_split_congr_l
(p q r: vprop)
: Lemma
(requires (p `can_be_split` q))
(ensures ((p `star` r) `can_be_split` (q `star` r)))
let can_be_split_congr_l p q r = | false | null | true | Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r)) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"lemma"
] | [
"Steel.Effect.Common.vprop",
"FStar.Classical.forall_intro",
"Steel.Memory.mem",
"Prims.l_iff",
"Steel.Memory.interp",
"Steel.Memory.star",
"Steel.Effect.Common.hp_of",
"Prims.l_Exists",
"Prims.l_and",
"Steel.Memory.disjoint",
"Prims.eq2",
"Steel.Memory.join",
"Steel.Memory.interp_star",
"Prims.unit"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = () | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val can_be_split_congr_l
(p q r: vprop)
: Lemma
(requires (p `can_be_split` q))
(ensures ((p `star` r) `can_be_split` (q `star` r))) | [] | Steel.Effect.Common.can_be_split_congr_l | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p: Steel.Effect.Common.vprop -> q: Steel.Effect.Common.vprop -> r: Steel.Effect.Common.vprop
-> FStar.Pervasives.Lemma (requires Steel.Effect.Common.can_be_split p q)
(ensures
Steel.Effect.Common.can_be_split (Steel.Effect.Common.star p r)
(Steel.Effect.Common.star q r)) | {
"end_col": 58,
"end_line": 38,
"start_col": 2,
"start_line": 37
} |
Prims.Tot | val emp':vprop' | [
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()} | val emp':vprop'
let emp':vprop' = | false | null | false | { hp = emp; t = unit; sel = fun _ -> () } | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"total"
] | [
"Steel.Effect.Common.Mkvprop'",
"Steel.Memory.emp",
"Prims.unit",
"Steel.Memory.hmem"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h) | false | true | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val emp':vprop' | [] | Steel.Effect.Common.emp' | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | Steel.Effect.Common.vprop' | {
"end_col": 21,
"end_line": 60,
"start_col": 4,
"start_line": 58
} |
FStar.Pervasives.Lemma | val cm_identity (x:vprop) : Lemma ((emp `star` x) `equiv` x) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Algebra.CommMonoid.Equiv",
"short_module": "CE"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommMonoidSimple.Equiv",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let cm_identity x =
Mem.emp_unit (hp_of x);
Mem.star_commutative (hp_of x) Mem.emp | val cm_identity (x:vprop) : Lemma ((emp `star` x) `equiv` x)
let cm_identity x = | false | null | true | Mem.emp_unit (hp_of x);
Mem.star_commutative (hp_of x) Mem.emp | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"lemma"
] | [
"Steel.Effect.Common.vprop",
"Steel.Memory.star_commutative",
"Steel.Effect.Common.hp_of",
"Steel.Memory.emp",
"Prims.unit",
"Steel.Memory.emp_unit"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12
let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2
let lemma_frame_emp h0 h1 p =
FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp'))
let elim_conjunction p1 p1' p2 p2' = ()
let can_be_split_dep_refl p = ()
let equiv_can_be_split p1 p2 = ()
let intro_can_be_split_frame p q frame = ()
let can_be_split_post_elim t1 t2 = ()
let equiv_forall_refl t = ()
let equiv_forall_elim t1 t2 = ()
let equiv_refl x = ()
let equiv_sym x y = ()
let equiv_trans x y z = () | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val cm_identity (x:vprop) : Lemma ((emp `star` x) `equiv` x) | [] | Steel.Effect.Common.cm_identity | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | x: Steel.Effect.Common.vprop
-> FStar.Pervasives.Lemma
(ensures Steel.Effect.Common.equiv (Steel.Effect.Common.star Steel.Effect.Common.emp x) x) | {
"end_col": 40,
"end_line": 109,
"start_col": 2,
"start_line": 108
} |
Prims.Tot | val vrefine_sel' (v: vprop) (p: (t_of v -> Tot prop))
: Tot (selector' (vrefine_t v p) (vrefine_hp v p)) | [
{
"abbrev": true,
"full_module": "FStar.Algebra.CommMonoid.Equiv",
"short_module": "CE"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommMonoidSimple.Equiv",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let vrefine_sel' (v: vprop) (p: (t_of v -> Tot prop)) : Tot (selector' (vrefine_t v p) (vrefine_hp v p))
=
fun (h: Mem.hmem (vrefine_hp v p)) ->
interp_refine_slprop (hp_of v) (vrefine_am v p) h;
sel_of v h | val vrefine_sel' (v: vprop) (p: (t_of v -> Tot prop))
: Tot (selector' (vrefine_t v p) (vrefine_hp v p))
let vrefine_sel' (v: vprop) (p: (t_of v -> Tot prop))
: Tot (selector' (vrefine_t v p) (vrefine_hp v p)) = | false | null | false | fun (h: Mem.hmem (vrefine_hp v p)) ->
interp_refine_slprop (hp_of v) (vrefine_am v p) h;
sel_of v h | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"total"
] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.t_of",
"Prims.prop",
"Steel.Memory.hmem",
"Steel.Effect.Common.vrefine_hp",
"Steel.Effect.Common.sel_of",
"Prims.unit",
"Steel.Memory.interp_refine_slprop",
"Steel.Effect.Common.hp_of",
"Steel.Effect.Common.vrefine_am",
"Steel.Effect.Common.vrefine_t",
"Steel.Effect.Common.selector'"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12
let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2
let lemma_frame_emp h0 h1 p =
FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp'))
let elim_conjunction p1 p1' p2 p2' = ()
let can_be_split_dep_refl p = ()
let equiv_can_be_split p1 p2 = ()
let intro_can_be_split_frame p q frame = ()
let can_be_split_post_elim t1 t2 = ()
let equiv_forall_refl t = ()
let equiv_forall_elim t1 t2 = ()
let equiv_refl x = ()
let equiv_sym x y = ()
let equiv_trans x y z = ()
let cm_identity x =
Mem.emp_unit (hp_of x);
Mem.star_commutative (hp_of x) Mem.emp
let star_commutative p1 p2 = Mem.star_commutative (hp_of p1) (hp_of p2)
let star_associative p1 p2 p3 = Mem.star_associative (hp_of p1) (hp_of p2) (hp_of p3)
let star_congruence p1 p2 p3 p4 = Mem.star_congruence (hp_of p1) (hp_of p2) (hp_of p3) (hp_of p4)
let vrefine_am (v: vprop) (p: (t_of v -> Tot prop)) : Tot (a_mem_prop (hp_of v)) =
fun h -> p (sel_of v h)
let vrefine_hp
v p
= refine_slprop (hp_of v) (vrefine_am v p)
let interp_vrefine_hp
v p m
= ()
let vrefine_sel' (v: vprop) (p: (t_of v -> Tot prop)) : Tot (selector' (vrefine_t v p) (vrefine_hp v p)) | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val vrefine_sel' (v: vprop) (p: (t_of v -> Tot prop))
: Tot (selector' (vrefine_t v p) (vrefine_hp v p)) | [] | Steel.Effect.Common.vrefine_sel' | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | v: Steel.Effect.Common.vprop -> p: (_: Steel.Effect.Common.t_of v -> Prims.prop)
-> Steel.Effect.Common.selector' (Steel.Effect.Common.vrefine_t v p)
(Steel.Effect.Common.vrefine_hp v p) | {
"end_col": 14,
"end_line": 129,
"start_col": 2,
"start_line": 127
} |
FStar.Pervasives.Lemma | val star_commutative (p1 p2:vprop)
: Lemma ((p1 `star` p2) `equiv` (p2 `star` p1)) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Algebra.CommMonoid.Equiv",
"short_module": "CE"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommMonoidSimple.Equiv",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let star_commutative p1 p2 = Mem.star_commutative (hp_of p1) (hp_of p2) | val star_commutative (p1 p2:vprop)
: Lemma ((p1 `star` p2) `equiv` (p2 `star` p1))
let star_commutative p1 p2 = | false | null | true | Mem.star_commutative (hp_of p1) (hp_of p2) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"lemma"
] | [
"Steel.Effect.Common.vprop",
"Steel.Memory.star_commutative",
"Steel.Effect.Common.hp_of",
"Prims.unit"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12
let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2
let lemma_frame_emp h0 h1 p =
FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp'))
let elim_conjunction p1 p1' p2 p2' = ()
let can_be_split_dep_refl p = ()
let equiv_can_be_split p1 p2 = ()
let intro_can_be_split_frame p q frame = ()
let can_be_split_post_elim t1 t2 = ()
let equiv_forall_refl t = ()
let equiv_forall_elim t1 t2 = ()
let equiv_refl x = ()
let equiv_sym x y = ()
let equiv_trans x y z = ()
let cm_identity x =
Mem.emp_unit (hp_of x); | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val star_commutative (p1 p2:vprop)
: Lemma ((p1 `star` p2) `equiv` (p2 `star` p1)) | [] | Steel.Effect.Common.star_commutative | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p1: Steel.Effect.Common.vprop -> p2: Steel.Effect.Common.vprop
-> FStar.Pervasives.Lemma
(ensures
Steel.Effect.Common.equiv (Steel.Effect.Common.star p1 p2) (Steel.Effect.Common.star p2 p1)) | {
"end_col": 71,
"end_line": 110,
"start_col": 29,
"start_line": 110
} |
Prims.Tot | val valid_rmem (#frame:vprop) (h:rmem' frame) : prop | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2) | val valid_rmem (#frame:vprop) (h:rmem' frame) : prop
let valid_rmem (#frame: vprop) (h: rmem' frame) : prop = | false | null | false | forall (p: vprop) (p1: vprop) (p2: vprop).
can_be_split frame p /\ p == VStar p1 p2 ==> (h p1, h p2) == h (VStar p1 p2) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"total"
] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.rmem'",
"Prims.l_Forall",
"Prims.l_imp",
"Prims.l_and",
"Steel.Effect.Common.can_be_split",
"Prims.eq2",
"Steel.Effect.Common.VStar",
"FStar.Pervasives.Native.tuple2",
"Steel.Effect.Common.vprop'",
"Steel.Effect.Common.__proj__Mkvprop'__item__t",
"Steel.Effect.Common.t_of",
"FStar.Pervasives.Native.Mktuple2",
"Prims.prop"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = () | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val valid_rmem (#frame:vprop) (h:rmem' frame) : prop | [] | Steel.Effect.Common.valid_rmem | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | h: Steel.Effect.Common.rmem' frame -> Prims.prop | {
"end_col": 36,
"end_line": 49,
"start_col": 2,
"start_line": 48
} |
Prims.Tot | val vrefine_hp (v: vprop) (p: (normal (t_of v) -> Tot prop)) : Tot (slprop u#1) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Algebra.CommMonoid.Equiv",
"short_module": "CE"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommMonoidSimple.Equiv",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let vrefine_hp
v p
= refine_slprop (hp_of v) (vrefine_am v p) | val vrefine_hp (v: vprop) (p: (normal (t_of v) -> Tot prop)) : Tot (slprop u#1)
let vrefine_hp v p = | false | null | false | refine_slprop (hp_of v) (vrefine_am v p) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"total"
] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.normal",
"Steel.Effect.Common.t_of",
"Prims.prop",
"Steel.Memory.refine_slprop",
"Steel.Effect.Common.hp_of",
"Steel.Effect.Common.vrefine_am",
"Steel.Memory.slprop"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12
let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2
let lemma_frame_emp h0 h1 p =
FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp'))
let elim_conjunction p1 p1' p2 p2' = ()
let can_be_split_dep_refl p = ()
let equiv_can_be_split p1 p2 = ()
let intro_can_be_split_frame p q frame = ()
let can_be_split_post_elim t1 t2 = ()
let equiv_forall_refl t = ()
let equiv_forall_elim t1 t2 = ()
let equiv_refl x = ()
let equiv_sym x y = ()
let equiv_trans x y z = ()
let cm_identity x =
Mem.emp_unit (hp_of x);
Mem.star_commutative (hp_of x) Mem.emp
let star_commutative p1 p2 = Mem.star_commutative (hp_of p1) (hp_of p2)
let star_associative p1 p2 p3 = Mem.star_associative (hp_of p1) (hp_of p2) (hp_of p3)
let star_congruence p1 p2 p3 p4 = Mem.star_congruence (hp_of p1) (hp_of p2) (hp_of p3) (hp_of p4)
let vrefine_am (v: vprop) (p: (t_of v -> Tot prop)) : Tot (a_mem_prop (hp_of v)) =
fun h -> p (sel_of v h)
let vrefine_hp | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val vrefine_hp (v: vprop) (p: (normal (t_of v) -> Tot prop)) : Tot (slprop u#1) | [] | Steel.Effect.Common.vrefine_hp | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
v: Steel.Effect.Common.vprop ->
p: (_: Steel.Effect.Common.normal (Steel.Effect.Common.t_of v) -> Prims.prop)
-> Steel.Memory.slprop | {
"end_col": 42,
"end_line": 119,
"start_col": 2,
"start_line": 119
} |
FStar.Pervasives.Lemma | val lemma_frame_emp (h0:rmem emp) (h1:rmem emp) (p:Type0)
: Lemma (requires True == p)
(ensures frame_equalities' emp h0 h1 == p) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lemma_frame_emp h0 h1 p =
FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp')) | val lemma_frame_emp (h0:rmem emp) (h1:rmem emp) (p:Type0)
: Lemma (requires True == p)
(ensures frame_equalities' emp h0 h1 == p)
let lemma_frame_emp h0 h1 p = | false | null | true | FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp')) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"lemma"
] | [
"Steel.Effect.Common.rmem",
"Steel.Effect.Common.emp",
"FStar.PropositionalExtensionality.apply",
"Prims.l_True",
"Prims.eq2",
"Steel.Effect.Common.normal",
"Steel.Effect.Common.t_of",
"Steel.Effect.Common.VUnit",
"Steel.Effect.Common.emp'",
"Prims.unit"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12
let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2 | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lemma_frame_emp (h0:rmem emp) (h1:rmem emp) (p:Type0)
: Lemma (requires True == p)
(ensures frame_equalities' emp h0 h1 == p) | [] | Steel.Effect.Common.lemma_frame_emp | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
h0: Steel.Effect.Common.rmem Steel.Effect.Common.emp ->
h1: Steel.Effect.Common.rmem Steel.Effect.Common.emp ->
p: Type0
-> FStar.Pervasives.Lemma (requires Prims.l_True == p)
(ensures Steel.Effect.Common.frame_equalities' Steel.Effect.Common.emp h0 h1 == p) | {
"end_col": 83,
"end_line": 92,
"start_col": 2,
"start_line": 92
} |
FStar.Pervasives.Lemma | val star_associative (p1 p2 p3:vprop)
: Lemma (((p1 `star` p2) `star` p3)
`equiv`
(p1 `star` (p2 `star` p3))) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Algebra.CommMonoid.Equiv",
"short_module": "CE"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommMonoidSimple.Equiv",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let star_associative p1 p2 p3 = Mem.star_associative (hp_of p1) (hp_of p2) (hp_of p3) | val star_associative (p1 p2 p3:vprop)
: Lemma (((p1 `star` p2) `star` p3)
`equiv`
(p1 `star` (p2 `star` p3)))
let star_associative p1 p2 p3 = | false | null | true | Mem.star_associative (hp_of p1) (hp_of p2) (hp_of p3) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"lemma"
] | [
"Steel.Effect.Common.vprop",
"Steel.Memory.star_associative",
"Steel.Effect.Common.hp_of",
"Prims.unit"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12
let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2
let lemma_frame_emp h0 h1 p =
FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp'))
let elim_conjunction p1 p1' p2 p2' = ()
let can_be_split_dep_refl p = ()
let equiv_can_be_split p1 p2 = ()
let intro_can_be_split_frame p q frame = ()
let can_be_split_post_elim t1 t2 = ()
let equiv_forall_refl t = ()
let equiv_forall_elim t1 t2 = ()
let equiv_refl x = ()
let equiv_sym x y = ()
let equiv_trans x y z = ()
let cm_identity x =
Mem.emp_unit (hp_of x);
Mem.star_commutative (hp_of x) Mem.emp | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val star_associative (p1 p2 p3:vprop)
: Lemma (((p1 `star` p2) `star` p3)
`equiv`
(p1 `star` (p2 `star` p3))) | [] | Steel.Effect.Common.star_associative | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p1: Steel.Effect.Common.vprop -> p2: Steel.Effect.Common.vprop -> p3: Steel.Effect.Common.vprop
-> FStar.Pervasives.Lemma
(ensures
Steel.Effect.Common.equiv (Steel.Effect.Common.star (Steel.Effect.Common.star p1 p2) p3)
(Steel.Effect.Common.star p1 (Steel.Effect.Common.star p2 p3))) | {
"end_col": 85,
"end_line": 111,
"start_col": 32,
"start_line": 111
} |
Prims.Tot | val vdep_sel' (v: vprop) (p: (t_of v -> Tot vprop)) : Tot (selector' (vdep_t v p) (vdep_hp v p)) | [
{
"abbrev": true,
"full_module": "FStar.Algebra.CommMonoid.Equiv",
"short_module": "CE"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommMonoidSimple.Equiv",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let vdep_sel'
(v: vprop)
(p: t_of v -> Tot vprop)
: Tot (selector' (vdep_t v p) (vdep_hp v p))
=
fun (m: Mem.hmem (vdep_hp v p)) ->
interp_vdep_hp v p m;
let x = sel_of v m in
let y = sel_of (p (sel_of v m)) m in
(| x, y |) | val vdep_sel' (v: vprop) (p: (t_of v -> Tot vprop)) : Tot (selector' (vdep_t v p) (vdep_hp v p))
let vdep_sel' (v: vprop) (p: (t_of v -> Tot vprop)) : Tot (selector' (vdep_t v p) (vdep_hp v p)) = | false | null | false | fun (m: Mem.hmem (vdep_hp v p)) ->
interp_vdep_hp v p m;
let x = sel_of v m in
let y = sel_of (p (sel_of v m)) m in
(| x, y |) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"total"
] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.t_of",
"Steel.Memory.hmem",
"Steel.Effect.Common.vdep_hp",
"Prims.Mkdtuple2",
"Steel.Effect.Common.vdep_payload",
"Steel.Effect.Common.sel_of",
"Prims.unit",
"Steel.Effect.Common.interp_vdep_hp",
"Steel.Effect.Common.vdep_t",
"Steel.Effect.Common.selector'"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12
let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2
let lemma_frame_emp h0 h1 p =
FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp'))
let elim_conjunction p1 p1' p2 p2' = ()
let can_be_split_dep_refl p = ()
let equiv_can_be_split p1 p2 = ()
let intro_can_be_split_frame p q frame = ()
let can_be_split_post_elim t1 t2 = ()
let equiv_forall_refl t = ()
let equiv_forall_elim t1 t2 = ()
let equiv_refl x = ()
let equiv_sym x y = ()
let equiv_trans x y z = ()
let cm_identity x =
Mem.emp_unit (hp_of x);
Mem.star_commutative (hp_of x) Mem.emp
let star_commutative p1 p2 = Mem.star_commutative (hp_of p1) (hp_of p2)
let star_associative p1 p2 p3 = Mem.star_associative (hp_of p1) (hp_of p2) (hp_of p3)
let star_congruence p1 p2 p3 p4 = Mem.star_congruence (hp_of p1) (hp_of p2) (hp_of p3) (hp_of p4)
let vrefine_am (v: vprop) (p: (t_of v -> Tot prop)) : Tot (a_mem_prop (hp_of v)) =
fun h -> p (sel_of v h)
let vrefine_hp
v p
= refine_slprop (hp_of v) (vrefine_am v p)
let interp_vrefine_hp
v p m
= ()
let vrefine_sel' (v: vprop) (p: (t_of v -> Tot prop)) : Tot (selector' (vrefine_t v p) (vrefine_hp v p))
=
fun (h: Mem.hmem (vrefine_hp v p)) ->
interp_refine_slprop (hp_of v) (vrefine_am v p) h;
sel_of v h
let vrefine_sel
v p
= assert (sel_depends_only_on (vrefine_sel' v p));
assert (sel_depends_only_on_core (vrefine_sel' v p));
vrefine_sel' v p
let vrefine_sel_eq
v p m
= ()
let vdep_hp_payload
(v: vprop)
(p: (t_of v -> Tot vprop))
(h: Mem.hmem (hp_of v))
: Tot slprop
= hp_of (p (sel_of v h))
let vdep_hp
v p
=
sdep (hp_of v) (vdep_hp_payload v p)
let interp_vdep_hp
v p m
=
interp_sdep (hp_of v) (vdep_hp_payload v p) m;
let left = interp (vdep_hp v p) m in
let right = interp (hp_of v) m /\ interp (hp_of v `Mem.star` hp_of (p (sel_of v m))) m in
let f ()
: Lemma
(requires left)
(ensures right)
= interp_star (hp_of v) (hp_of (p (sel_of v m))) m
in
let g ()
: Lemma
(requires right)
(ensures left)
= interp_star (hp_of v) (hp_of (p (sel_of v m))) m
in
Classical.move_requires f ();
Classical.move_requires g ()
let vdep_sel'
(v: vprop)
(p: t_of v -> Tot vprop)
: Tot (selector' (vdep_t v p) (vdep_hp v p)) | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val vdep_sel' (v: vprop) (p: (t_of v -> Tot vprop)) : Tot (selector' (vdep_t v p) (vdep_hp v p)) | [] | Steel.Effect.Common.vdep_sel' | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | v: Steel.Effect.Common.vprop -> p: (_: Steel.Effect.Common.t_of v -> Steel.Effect.Common.vprop)
-> Steel.Effect.Common.selector' (Steel.Effect.Common.vdep_t v p)
(Steel.Effect.Common.vdep_hp v p) | {
"end_col": 14,
"end_line": 183,
"start_col": 2,
"start_line": 179
} |
Prims.Tot | val vrewrite_sel (v: vprop) (#t: Type) (f: (normal (t_of v) -> GTot t)) : Tot (selector t (normal (hp_of v))) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Algebra.CommMonoid.Equiv",
"short_module": "CE"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommMonoidSimple.Equiv",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let vrewrite_sel
v #t f
=
(fun (h: Mem.hmem (normal (hp_of v))) -> f ((normal (sel_of v) <: selector' _ _) h)) | val vrewrite_sel (v: vprop) (#t: Type) (f: (normal (t_of v) -> GTot t)) : Tot (selector t (normal (hp_of v)))
let vrewrite_sel v #t f = | false | null | false | (fun (h: Mem.hmem (normal (hp_of v))) -> f ((normal (sel_of v) <: selector' _ _) h)) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"total"
] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.normal",
"Steel.Effect.Common.t_of",
"Steel.Memory.hmem",
"Steel.Memory.slprop",
"Steel.Effect.Common.hp_of",
"Steel.Effect.Common.selector'",
"Steel.Effect.Common.sel_of"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12
let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2
let lemma_frame_emp h0 h1 p =
FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp'))
let elim_conjunction p1 p1' p2 p2' = ()
let can_be_split_dep_refl p = ()
let equiv_can_be_split p1 p2 = ()
let intro_can_be_split_frame p q frame = ()
let can_be_split_post_elim t1 t2 = ()
let equiv_forall_refl t = ()
let equiv_forall_elim t1 t2 = ()
let equiv_refl x = ()
let equiv_sym x y = ()
let equiv_trans x y z = ()
let cm_identity x =
Mem.emp_unit (hp_of x);
Mem.star_commutative (hp_of x) Mem.emp
let star_commutative p1 p2 = Mem.star_commutative (hp_of p1) (hp_of p2)
let star_associative p1 p2 p3 = Mem.star_associative (hp_of p1) (hp_of p2) (hp_of p3)
let star_congruence p1 p2 p3 p4 = Mem.star_congruence (hp_of p1) (hp_of p2) (hp_of p3) (hp_of p4)
let vrefine_am (v: vprop) (p: (t_of v -> Tot prop)) : Tot (a_mem_prop (hp_of v)) =
fun h -> p (sel_of v h)
let vrefine_hp
v p
= refine_slprop (hp_of v) (vrefine_am v p)
let interp_vrefine_hp
v p m
= ()
let vrefine_sel' (v: vprop) (p: (t_of v -> Tot prop)) : Tot (selector' (vrefine_t v p) (vrefine_hp v p))
=
fun (h: Mem.hmem (vrefine_hp v p)) ->
interp_refine_slprop (hp_of v) (vrefine_am v p) h;
sel_of v h
let vrefine_sel
v p
= assert (sel_depends_only_on (vrefine_sel' v p));
assert (sel_depends_only_on_core (vrefine_sel' v p));
vrefine_sel' v p
let vrefine_sel_eq
v p m
= ()
let vdep_hp_payload
(v: vprop)
(p: (t_of v -> Tot vprop))
(h: Mem.hmem (hp_of v))
: Tot slprop
= hp_of (p (sel_of v h))
let vdep_hp
v p
=
sdep (hp_of v) (vdep_hp_payload v p)
let interp_vdep_hp
v p m
=
interp_sdep (hp_of v) (vdep_hp_payload v p) m;
let left = interp (vdep_hp v p) m in
let right = interp (hp_of v) m /\ interp (hp_of v `Mem.star` hp_of (p (sel_of v m))) m in
let f ()
: Lemma
(requires left)
(ensures right)
= interp_star (hp_of v) (hp_of (p (sel_of v m))) m
in
let g ()
: Lemma
(requires right)
(ensures left)
= interp_star (hp_of v) (hp_of (p (sel_of v m))) m
in
Classical.move_requires f ();
Classical.move_requires g ()
let vdep_sel'
(v: vprop)
(p: t_of v -> Tot vprop)
: Tot (selector' (vdep_t v p) (vdep_hp v p))
=
fun (m: Mem.hmem (vdep_hp v p)) ->
interp_vdep_hp v p m;
let x = sel_of v m in
let y = sel_of (p (sel_of v m)) m in
(| x, y |)
let vdep_sel
v p
= Classical.forall_intro_2 (Classical.move_requires_2 (fun (m0 m1: mem) -> (join_commutative m0) m1));
vdep_sel' v p
let vdep_sel_eq
v p m
= Classical.forall_intro_2 (Classical.move_requires_2 (fun (m0 m1: mem) -> (join_commutative m0) m1));
()
let vrewrite_sel
v #t f | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val vrewrite_sel (v: vprop) (#t: Type) (f: (normal (t_of v) -> GTot t)) : Tot (selector t (normal (hp_of v))) | [] | Steel.Effect.Common.vrewrite_sel | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
v: Steel.Effect.Common.vprop ->
f: (_: Steel.Effect.Common.normal (Steel.Effect.Common.t_of v) -> Prims.GTot t)
-> Steel.Effect.Common.selector t (Steel.Effect.Common.normal (Steel.Effect.Common.hp_of v)) | {
"end_col": 86,
"end_line": 198,
"start_col": 2,
"start_line": 198
} |
Prims.Tot | val vrefine_am (v: vprop) (p: (t_of v -> Tot prop)) : Tot (a_mem_prop (hp_of v)) | [
{
"abbrev": true,
"full_module": "FStar.Algebra.CommMonoid.Equiv",
"short_module": "CE"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommMonoidSimple.Equiv",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let vrefine_am (v: vprop) (p: (t_of v -> Tot prop)) : Tot (a_mem_prop (hp_of v)) =
fun h -> p (sel_of v h) | val vrefine_am (v: vprop) (p: (t_of v -> Tot prop)) : Tot (a_mem_prop (hp_of v))
let vrefine_am (v: vprop) (p: (t_of v -> Tot prop)) : Tot (a_mem_prop (hp_of v)) = | false | null | false | fun h -> p (sel_of v h) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"total"
] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.t_of",
"Prims.prop",
"Steel.Memory.hmem",
"Steel.Effect.Common.hp_of",
"Steel.Effect.Common.sel_of",
"Steel.Memory.a_mem_prop"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12
let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2
let lemma_frame_emp h0 h1 p =
FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp'))
let elim_conjunction p1 p1' p2 p2' = ()
let can_be_split_dep_refl p = ()
let equiv_can_be_split p1 p2 = ()
let intro_can_be_split_frame p q frame = ()
let can_be_split_post_elim t1 t2 = ()
let equiv_forall_refl t = ()
let equiv_forall_elim t1 t2 = ()
let equiv_refl x = ()
let equiv_sym x y = ()
let equiv_trans x y z = ()
let cm_identity x =
Mem.emp_unit (hp_of x);
Mem.star_commutative (hp_of x) Mem.emp
let star_commutative p1 p2 = Mem.star_commutative (hp_of p1) (hp_of p2)
let star_associative p1 p2 p3 = Mem.star_associative (hp_of p1) (hp_of p2) (hp_of p3)
let star_congruence p1 p2 p3 p4 = Mem.star_congruence (hp_of p1) (hp_of p2) (hp_of p3) (hp_of p4) | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val vrefine_am (v: vprop) (p: (t_of v -> Tot prop)) : Tot (a_mem_prop (hp_of v)) | [] | Steel.Effect.Common.vrefine_am | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | v: Steel.Effect.Common.vprop -> p: (_: Steel.Effect.Common.t_of v -> Prims.prop)
-> Steel.Memory.a_mem_prop (Steel.Effect.Common.hp_of v) | {
"end_col": 25,
"end_line": 115,
"start_col": 2,
"start_line": 115
} |
FStar.Pervasives.Lemma | val lemma_valid_focus_rmem (#r:vprop) (h:rmem r) (r0:vprop{r `can_be_split` r0})
: Lemma (valid_rmem (focus_rmem' h r0)) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0)) | val lemma_valid_focus_rmem (#r:vprop) (h:rmem r) (r0:vprop{r `can_be_split` r0})
: Lemma (valid_rmem (focus_rmem' h r0))
let lemma_valid_focus_rmem #r h r0 = | false | null | true | Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0)) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"lemma"
] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.rmem",
"Steel.Effect.Common.can_be_split",
"FStar.Classical.forall_intro",
"Prims.l_imp",
"Prims.l_and",
"FStar.Classical.move_requires",
"Steel.Effect.Common.can_be_split_trans",
"Prims.unit"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = () | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lemma_valid_focus_rmem (#r:vprop) (h:rmem r) (r0:vprop{r `can_be_split` r0})
: Lemma (valid_rmem (focus_rmem' h r0)) | [] | Steel.Effect.Common.lemma_valid_focus_rmem | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
h: Steel.Effect.Common.rmem r ->
r0: Steel.Effect.Common.vprop{Steel.Effect.Common.can_be_split r r0}
-> FStar.Pervasives.Lemma
(ensures Steel.Effect.Common.valid_rmem (Steel.Effect.Common.focus_rmem' h r0)) | {
"end_col": 76,
"end_line": 66,
"start_col": 2,
"start_line": 66
} |
FStar.Pervasives.Lemma | val reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma (ensures reveal_can_be_split(); (mk_rmem r h) r0 == sel_of r0 h) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h) | val reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma (ensures reveal_can_be_split(); (mk_rmem r h) r0 == sel_of r0 h)
let reveal_mk_rmem (r: vprop) (h: hmem r) (r0: vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h) = | false | null | true | FExt.feq_on_domain_g (unrestricted_mk_rmem r h) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"lemma"
] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.hmem",
"Steel.Effect.Common.can_be_split",
"FStar.FunctionalExtensionality.feq_on_domain_g",
"Steel.Effect.Common.t_of",
"Steel.Effect.Common.unrestricted_mk_rmem",
"Prims.unit",
"Prims.l_True",
"Prims.squash",
"Prims.eq2",
"Steel.Effect.Common.normal",
"Steel.Effect.Common.mk_rmem",
"Steel.Effect.Common.sel_of",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0}) | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma (ensures reveal_can_be_split(); (mk_rmem r h) r0 == sel_of r0 h) | [] | Steel.Effect.Common.reveal_mk_rmem | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
r: Steel.Effect.Common.vprop ->
h: Steel.Effect.Common.hmem r ->
r0: Steel.Effect.Common.vprop{Steel.Effect.Common.can_be_split r r0}
-> FStar.Pervasives.Lemma
(ensures
([@@ FStar.Pervasives.inline_let ]let _ = Steel.Effect.Common.reveal_can_be_split () in
Steel.Effect.Common.mk_rmem r h r0 == Steel.Effect.Common.sel_of r0 h)) | {
"end_col": 51,
"end_line": 55,
"start_col": 4,
"start_line": 55
} |
FStar.Pervasives.Lemma | val vdep_sel_eq (v: vprop) (p: ( (t_of v) -> Tot vprop)) (m: Mem.hmem (vdep_hp v p)) : Lemma
(
interp (hp_of v) m /\
begin let x = sel_of v m in
interp (hp_of (p x)) m /\
vdep_sel v p m == (| x, sel_of (p x) m |)
end
) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Algebra.CommMonoid.Equiv",
"short_module": "CE"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommMonoidSimple.Equiv",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let vdep_sel_eq
v p m
= Classical.forall_intro_2 (Classical.move_requires_2 (fun (m0 m1: mem) -> (join_commutative m0) m1));
() | val vdep_sel_eq (v: vprop) (p: ( (t_of v) -> Tot vprop)) (m: Mem.hmem (vdep_hp v p)) : Lemma
(
interp (hp_of v) m /\
begin let x = sel_of v m in
interp (hp_of (p x)) m /\
vdep_sel v p m == (| x, sel_of (p x) m |)
end
)
let vdep_sel_eq v p m = | false | null | true | Classical.forall_intro_2 (Classical.move_requires_2 (fun (m0: mem) (m1: mem) ->
(join_commutative m0) m1));
() | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"lemma"
] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.t_of",
"Steel.Memory.hmem",
"Steel.Effect.Common.vdep_hp",
"Prims.unit",
"FStar.Classical.forall_intro_2",
"Steel.Memory.mem",
"Prims.l_imp",
"Steel.Memory.disjoint",
"Prims.l_and",
"Prims.eq2",
"Steel.Memory.join",
"FStar.Classical.move_requires_2",
"Steel.Memory.join_commutative"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12
let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2
let lemma_frame_emp h0 h1 p =
FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp'))
let elim_conjunction p1 p1' p2 p2' = ()
let can_be_split_dep_refl p = ()
let equiv_can_be_split p1 p2 = ()
let intro_can_be_split_frame p q frame = ()
let can_be_split_post_elim t1 t2 = ()
let equiv_forall_refl t = ()
let equiv_forall_elim t1 t2 = ()
let equiv_refl x = ()
let equiv_sym x y = ()
let equiv_trans x y z = ()
let cm_identity x =
Mem.emp_unit (hp_of x);
Mem.star_commutative (hp_of x) Mem.emp
let star_commutative p1 p2 = Mem.star_commutative (hp_of p1) (hp_of p2)
let star_associative p1 p2 p3 = Mem.star_associative (hp_of p1) (hp_of p2) (hp_of p3)
let star_congruence p1 p2 p3 p4 = Mem.star_congruence (hp_of p1) (hp_of p2) (hp_of p3) (hp_of p4)
let vrefine_am (v: vprop) (p: (t_of v -> Tot prop)) : Tot (a_mem_prop (hp_of v)) =
fun h -> p (sel_of v h)
let vrefine_hp
v p
= refine_slprop (hp_of v) (vrefine_am v p)
let interp_vrefine_hp
v p m
= ()
let vrefine_sel' (v: vprop) (p: (t_of v -> Tot prop)) : Tot (selector' (vrefine_t v p) (vrefine_hp v p))
=
fun (h: Mem.hmem (vrefine_hp v p)) ->
interp_refine_slprop (hp_of v) (vrefine_am v p) h;
sel_of v h
let vrefine_sel
v p
= assert (sel_depends_only_on (vrefine_sel' v p));
assert (sel_depends_only_on_core (vrefine_sel' v p));
vrefine_sel' v p
let vrefine_sel_eq
v p m
= ()
let vdep_hp_payload
(v: vprop)
(p: (t_of v -> Tot vprop))
(h: Mem.hmem (hp_of v))
: Tot slprop
= hp_of (p (sel_of v h))
let vdep_hp
v p
=
sdep (hp_of v) (vdep_hp_payload v p)
let interp_vdep_hp
v p m
=
interp_sdep (hp_of v) (vdep_hp_payload v p) m;
let left = interp (vdep_hp v p) m in
let right = interp (hp_of v) m /\ interp (hp_of v `Mem.star` hp_of (p (sel_of v m))) m in
let f ()
: Lemma
(requires left)
(ensures right)
= interp_star (hp_of v) (hp_of (p (sel_of v m))) m
in
let g ()
: Lemma
(requires right)
(ensures left)
= interp_star (hp_of v) (hp_of (p (sel_of v m))) m
in
Classical.move_requires f ();
Classical.move_requires g ()
let vdep_sel'
(v: vprop)
(p: t_of v -> Tot vprop)
: Tot (selector' (vdep_t v p) (vdep_hp v p))
=
fun (m: Mem.hmem (vdep_hp v p)) ->
interp_vdep_hp v p m;
let x = sel_of v m in
let y = sel_of (p (sel_of v m)) m in
(| x, y |)
let vdep_sel
v p
= Classical.forall_intro_2 (Classical.move_requires_2 (fun (m0 m1: mem) -> (join_commutative m0) m1));
vdep_sel' v p
let vdep_sel_eq | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val vdep_sel_eq (v: vprop) (p: ( (t_of v) -> Tot vprop)) (m: Mem.hmem (vdep_hp v p)) : Lemma
(
interp (hp_of v) m /\
begin let x = sel_of v m in
interp (hp_of (p x)) m /\
vdep_sel v p m == (| x, sel_of (p x) m |)
end
) | [] | Steel.Effect.Common.vdep_sel_eq | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
v: Steel.Effect.Common.vprop ->
p: (_: Steel.Effect.Common.t_of v -> Steel.Effect.Common.vprop) ->
m: Steel.Memory.hmem (Steel.Effect.Common.vdep_hp v p)
-> FStar.Pervasives.Lemma
(ensures
Steel.Memory.interp (Steel.Effect.Common.hp_of v) m /\
(let x = Steel.Effect.Common.sel_of v m in
Steel.Memory.interp (Steel.Effect.Common.hp_of (p x)) m /\
Steel.Effect.Common.vdep_sel v p m == (| x, Steel.Effect.Common.sel_of (p x) m |))) | {
"end_col": 4,
"end_line": 193,
"start_col": 2,
"start_line": 192
} |
FStar.Pervasives.Lemma | val interp_vdep_hp (v: vprop) (p: ( (t_of v) -> Tot vprop)) (m: mem) : Lemma
(interp (vdep_hp v p) m <==> (interp (hp_of v) m /\ interp (hp_of v `Mem.star` hp_of (p (sel_of v m))) m)) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Algebra.CommMonoid.Equiv",
"short_module": "CE"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommMonoidSimple.Equiv",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let interp_vdep_hp
v p m
=
interp_sdep (hp_of v) (vdep_hp_payload v p) m;
let left = interp (vdep_hp v p) m in
let right = interp (hp_of v) m /\ interp (hp_of v `Mem.star` hp_of (p (sel_of v m))) m in
let f ()
: Lemma
(requires left)
(ensures right)
= interp_star (hp_of v) (hp_of (p (sel_of v m))) m
in
let g ()
: Lemma
(requires right)
(ensures left)
= interp_star (hp_of v) (hp_of (p (sel_of v m))) m
in
Classical.move_requires f ();
Classical.move_requires g () | val interp_vdep_hp (v: vprop) (p: ( (t_of v) -> Tot vprop)) (m: mem) : Lemma
(interp (vdep_hp v p) m <==> (interp (hp_of v) m /\ interp (hp_of v `Mem.star` hp_of (p (sel_of v m))) m))
let interp_vdep_hp v p m = | false | null | true | interp_sdep (hp_of v) (vdep_hp_payload v p) m;
let left = interp (vdep_hp v p) m in
let right = interp (hp_of v) m /\ interp ((hp_of v) `Mem.star` (hp_of (p (sel_of v m)))) m in
let f () : Lemma (requires left) (ensures right) =
interp_star (hp_of v) (hp_of (p (sel_of v m))) m
in
let g () : Lemma (requires right) (ensures left) =
interp_star (hp_of v) (hp_of (p (sel_of v m))) m
in
Classical.move_requires f ();
Classical.move_requires g () | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"lemma"
] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.t_of",
"Steel.Memory.mem",
"FStar.Classical.move_requires",
"Prims.unit",
"Prims.squash",
"Prims.Nil",
"FStar.Pervasives.pattern",
"Steel.Memory.interp_star",
"Steel.Effect.Common.hp_of",
"Steel.Effect.Common.sel_of",
"Prims.logical",
"Prims.l_and",
"Steel.Memory.interp",
"Steel.Memory.star",
"Prims.prop",
"Steel.Effect.Common.vdep_hp",
"Steel.Memory.interp_sdep",
"Steel.Effect.Common.vdep_hp_payload"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12
let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2
let lemma_frame_emp h0 h1 p =
FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp'))
let elim_conjunction p1 p1' p2 p2' = ()
let can_be_split_dep_refl p = ()
let equiv_can_be_split p1 p2 = ()
let intro_can_be_split_frame p q frame = ()
let can_be_split_post_elim t1 t2 = ()
let equiv_forall_refl t = ()
let equiv_forall_elim t1 t2 = ()
let equiv_refl x = ()
let equiv_sym x y = ()
let equiv_trans x y z = ()
let cm_identity x =
Mem.emp_unit (hp_of x);
Mem.star_commutative (hp_of x) Mem.emp
let star_commutative p1 p2 = Mem.star_commutative (hp_of p1) (hp_of p2)
let star_associative p1 p2 p3 = Mem.star_associative (hp_of p1) (hp_of p2) (hp_of p3)
let star_congruence p1 p2 p3 p4 = Mem.star_congruence (hp_of p1) (hp_of p2) (hp_of p3) (hp_of p4)
let vrefine_am (v: vprop) (p: (t_of v -> Tot prop)) : Tot (a_mem_prop (hp_of v)) =
fun h -> p (sel_of v h)
let vrefine_hp
v p
= refine_slprop (hp_of v) (vrefine_am v p)
let interp_vrefine_hp
v p m
= ()
let vrefine_sel' (v: vprop) (p: (t_of v -> Tot prop)) : Tot (selector' (vrefine_t v p) (vrefine_hp v p))
=
fun (h: Mem.hmem (vrefine_hp v p)) ->
interp_refine_slprop (hp_of v) (vrefine_am v p) h;
sel_of v h
let vrefine_sel
v p
= assert (sel_depends_only_on (vrefine_sel' v p));
assert (sel_depends_only_on_core (vrefine_sel' v p));
vrefine_sel' v p
let vrefine_sel_eq
v p m
= ()
let vdep_hp_payload
(v: vprop)
(p: (t_of v -> Tot vprop))
(h: Mem.hmem (hp_of v))
: Tot slprop
= hp_of (p (sel_of v h))
let vdep_hp
v p
=
sdep (hp_of v) (vdep_hp_payload v p)
let interp_vdep_hp
v p m | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val interp_vdep_hp (v: vprop) (p: ( (t_of v) -> Tot vprop)) (m: mem) : Lemma
(interp (vdep_hp v p) m <==> (interp (hp_of v) m /\ interp (hp_of v `Mem.star` hp_of (p (sel_of v m))) m)) | [] | Steel.Effect.Common.interp_vdep_hp | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
v: Steel.Effect.Common.vprop ->
p: (_: Steel.Effect.Common.t_of v -> Steel.Effect.Common.vprop) ->
m: Steel.Memory.mem
-> FStar.Pervasives.Lemma
(ensures
Steel.Memory.interp (Steel.Effect.Common.vdep_hp v p) m <==>
Steel.Memory.interp (Steel.Effect.Common.hp_of v) m /\
Steel.Memory.interp (Steel.Memory.star (Steel.Effect.Common.hp_of v)
(Steel.Effect.Common.hp_of (p (Steel.Effect.Common.sel_of v m))))
m) | {
"end_col": 30,
"end_line": 172,
"start_col": 2,
"start_line": 156
} |
FStar.Pervasives.Lemma | val emp_unit_variant (p:vprop) : Lemma
(ensures can_be_split p (p `star` emp)) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2.Derived.Lemmas",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Algebra.CommMonoid.Equiv",
"short_module": "CE"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommMonoidSimple.Equiv",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let emp_unit_variant p = Mem.emp_unit (hp_of p) | val emp_unit_variant (p:vprop) : Lemma
(ensures can_be_split p (p `star` emp))
let emp_unit_variant p = | false | null | true | Mem.emp_unit (hp_of p) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"lemma"
] | [
"Steel.Effect.Common.vprop",
"Steel.Memory.emp_unit",
"Steel.Effect.Common.hp_of",
"Prims.unit"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12
let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2
let lemma_frame_emp h0 h1 p =
FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp'))
let elim_conjunction p1 p1' p2 p2' = ()
let can_be_split_dep_refl p = ()
let equiv_can_be_split p1 p2 = ()
let intro_can_be_split_frame p q frame = ()
let can_be_split_post_elim t1 t2 = ()
let equiv_forall_refl t = ()
let equiv_forall_elim t1 t2 = ()
let equiv_refl x = ()
let equiv_sym x y = ()
let equiv_trans x y z = ()
let cm_identity x =
Mem.emp_unit (hp_of x);
Mem.star_commutative (hp_of x) Mem.emp
let star_commutative p1 p2 = Mem.star_commutative (hp_of p1) (hp_of p2)
let star_associative p1 p2 p3 = Mem.star_associative (hp_of p1) (hp_of p2) (hp_of p3)
let star_congruence p1 p2 p3 p4 = Mem.star_congruence (hp_of p1) (hp_of p2) (hp_of p3) (hp_of p4)
let vrefine_am (v: vprop) (p: (t_of v -> Tot prop)) : Tot (a_mem_prop (hp_of v)) =
fun h -> p (sel_of v h)
let vrefine_hp
v p
= refine_slprop (hp_of v) (vrefine_am v p)
let interp_vrefine_hp
v p m
= ()
let vrefine_sel' (v: vprop) (p: (t_of v -> Tot prop)) : Tot (selector' (vrefine_t v p) (vrefine_hp v p))
=
fun (h: Mem.hmem (vrefine_hp v p)) ->
interp_refine_slprop (hp_of v) (vrefine_am v p) h;
sel_of v h
let vrefine_sel
v p
= assert (sel_depends_only_on (vrefine_sel' v p));
assert (sel_depends_only_on_core (vrefine_sel' v p));
vrefine_sel' v p
let vrefine_sel_eq
v p m
= ()
let vdep_hp_payload
(v: vprop)
(p: (t_of v -> Tot vprop))
(h: Mem.hmem (hp_of v))
: Tot slprop
= hp_of (p (sel_of v h))
let vdep_hp
v p
=
sdep (hp_of v) (vdep_hp_payload v p)
let interp_vdep_hp
v p m
=
interp_sdep (hp_of v) (vdep_hp_payload v p) m;
let left = interp (vdep_hp v p) m in
let right = interp (hp_of v) m /\ interp (hp_of v `Mem.star` hp_of (p (sel_of v m))) m in
let f ()
: Lemma
(requires left)
(ensures right)
= interp_star (hp_of v) (hp_of (p (sel_of v m))) m
in
let g ()
: Lemma
(requires right)
(ensures left)
= interp_star (hp_of v) (hp_of (p (sel_of v m))) m
in
Classical.move_requires f ();
Classical.move_requires g ()
let vdep_sel'
(v: vprop)
(p: t_of v -> Tot vprop)
: Tot (selector' (vdep_t v p) (vdep_hp v p))
=
fun (m: Mem.hmem (vdep_hp v p)) ->
interp_vdep_hp v p m;
let x = sel_of v m in
let y = sel_of (p (sel_of v m)) m in
(| x, y |)
let vdep_sel
v p
= Classical.forall_intro_2 (Classical.move_requires_2 (fun (m0 m1: mem) -> (join_commutative m0) m1));
vdep_sel' v p
let vdep_sel_eq
v p m
= Classical.forall_intro_2 (Classical.move_requires_2 (fun (m0 m1: mem) -> (join_commutative m0) m1));
()
let vrewrite_sel
v #t f
=
(fun (h: Mem.hmem (normal (hp_of v))) -> f ((normal (sel_of v) <: selector' _ _) h))
let vrewrite_sel_eq
v #t f h
= ()
let solve_can_be_split_for _ = ()
let solve_can_be_split_lookup = () | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val emp_unit_variant (p:vprop) : Lemma
(ensures can_be_split p (p `star` emp)) | [] | Steel.Effect.Common.emp_unit_variant | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p: Steel.Effect.Common.vprop
-> FStar.Pervasives.Lemma
(ensures Steel.Effect.Common.can_be_split p (Steel.Effect.Common.star p Steel.Effect.Common.emp)
) | {
"end_col": 47,
"end_line": 207,
"start_col": 25,
"start_line": 207
} |
Prims.Tot | val vdep_sel (v: vprop) (p: ( (t_of v) -> Tot vprop)) : Tot (selector (vdep_t v p) (vdep_hp v p)) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Algebra.CommMonoid.Equiv",
"short_module": "CE"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommMonoidSimple.Equiv",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let vdep_sel
v p
= Classical.forall_intro_2 (Classical.move_requires_2 (fun (m0 m1: mem) -> (join_commutative m0) m1));
vdep_sel' v p | val vdep_sel (v: vprop) (p: ( (t_of v) -> Tot vprop)) : Tot (selector (vdep_t v p) (vdep_hp v p))
let vdep_sel v p = | false | null | false | Classical.forall_intro_2 (Classical.move_requires_2 (fun (m0: mem) (m1: mem) ->
(join_commutative m0) m1));
vdep_sel' v p | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"total"
] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.t_of",
"Steel.Effect.Common.vdep_sel'",
"Prims.unit",
"FStar.Classical.forall_intro_2",
"Steel.Memory.mem",
"Prims.l_imp",
"Steel.Memory.disjoint",
"Prims.l_and",
"Prims.eq2",
"Steel.Memory.join",
"FStar.Classical.move_requires_2",
"Steel.Memory.join_commutative",
"Steel.Effect.Common.selector",
"Steel.Effect.Common.vdep_t",
"Steel.Effect.Common.vdep_hp"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12
let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2
let lemma_frame_emp h0 h1 p =
FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp'))
let elim_conjunction p1 p1' p2 p2' = ()
let can_be_split_dep_refl p = ()
let equiv_can_be_split p1 p2 = ()
let intro_can_be_split_frame p q frame = ()
let can_be_split_post_elim t1 t2 = ()
let equiv_forall_refl t = ()
let equiv_forall_elim t1 t2 = ()
let equiv_refl x = ()
let equiv_sym x y = ()
let equiv_trans x y z = ()
let cm_identity x =
Mem.emp_unit (hp_of x);
Mem.star_commutative (hp_of x) Mem.emp
let star_commutative p1 p2 = Mem.star_commutative (hp_of p1) (hp_of p2)
let star_associative p1 p2 p3 = Mem.star_associative (hp_of p1) (hp_of p2) (hp_of p3)
let star_congruence p1 p2 p3 p4 = Mem.star_congruence (hp_of p1) (hp_of p2) (hp_of p3) (hp_of p4)
let vrefine_am (v: vprop) (p: (t_of v -> Tot prop)) : Tot (a_mem_prop (hp_of v)) =
fun h -> p (sel_of v h)
let vrefine_hp
v p
= refine_slprop (hp_of v) (vrefine_am v p)
let interp_vrefine_hp
v p m
= ()
let vrefine_sel' (v: vprop) (p: (t_of v -> Tot prop)) : Tot (selector' (vrefine_t v p) (vrefine_hp v p))
=
fun (h: Mem.hmem (vrefine_hp v p)) ->
interp_refine_slprop (hp_of v) (vrefine_am v p) h;
sel_of v h
let vrefine_sel
v p
= assert (sel_depends_only_on (vrefine_sel' v p));
assert (sel_depends_only_on_core (vrefine_sel' v p));
vrefine_sel' v p
let vrefine_sel_eq
v p m
= ()
let vdep_hp_payload
(v: vprop)
(p: (t_of v -> Tot vprop))
(h: Mem.hmem (hp_of v))
: Tot slprop
= hp_of (p (sel_of v h))
let vdep_hp
v p
=
sdep (hp_of v) (vdep_hp_payload v p)
let interp_vdep_hp
v p m
=
interp_sdep (hp_of v) (vdep_hp_payload v p) m;
let left = interp (vdep_hp v p) m in
let right = interp (hp_of v) m /\ interp (hp_of v `Mem.star` hp_of (p (sel_of v m))) m in
let f ()
: Lemma
(requires left)
(ensures right)
= interp_star (hp_of v) (hp_of (p (sel_of v m))) m
in
let g ()
: Lemma
(requires right)
(ensures left)
= interp_star (hp_of v) (hp_of (p (sel_of v m))) m
in
Classical.move_requires f ();
Classical.move_requires g ()
let vdep_sel'
(v: vprop)
(p: t_of v -> Tot vprop)
: Tot (selector' (vdep_t v p) (vdep_hp v p))
=
fun (m: Mem.hmem (vdep_hp v p)) ->
interp_vdep_hp v p m;
let x = sel_of v m in
let y = sel_of (p (sel_of v m)) m in
(| x, y |)
let vdep_sel | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val vdep_sel (v: vprop) (p: ( (t_of v) -> Tot vprop)) : Tot (selector (vdep_t v p) (vdep_hp v p)) | [] | Steel.Effect.Common.vdep_sel | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | v: Steel.Effect.Common.vprop -> p: (_: Steel.Effect.Common.t_of v -> Steel.Effect.Common.vprop)
-> Steel.Effect.Common.selector (Steel.Effect.Common.vdep_t v p) (Steel.Effect.Common.vdep_hp v p) | {
"end_col": 15,
"end_line": 188,
"start_col": 2,
"start_line": 187
} |
FStar.Pervasives.Lemma | val lemma_frame_equalities (frame:vprop) (h0:rmem frame) (h1:rmem frame) (p:Type0)
: Lemma
(requires (h0 frame == h1 frame) == p)
(ensures frame_equalities' frame h0 h1 == p) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2 | val lemma_frame_equalities (frame:vprop) (h0:rmem frame) (h1:rmem frame) (p:Type0)
: Lemma
(requires (h0 frame == h1 frame) == p)
(ensures frame_equalities' frame h0 h1 == p)
let lemma_frame_equalities frame h0 h1 p = | false | null | true | let p1:prop = h0 frame == h1 frame in
let p2:prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2 | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"lemma"
] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.rmem",
"FStar.PropositionalExtensionality.apply",
"Prims.unit",
"Steel.Effect.Common.lemma_frame_refl'",
"Prims.prop",
"Steel.Effect.Common.frame_equalities'",
"Prims.eq2",
"Steel.Effect.Common.normal",
"Steel.Effect.Common.t_of"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12 | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lemma_frame_equalities (frame:vprop) (h0:rmem frame) (h1:rmem frame) (p:Type0)
: Lemma
(requires (h0 frame == h1 frame) == p)
(ensures frame_equalities' frame h0 h1 == p) | [] | Steel.Effect.Common.lemma_frame_equalities | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
frame: Steel.Effect.Common.vprop ->
h0: Steel.Effect.Common.rmem frame ->
h1: Steel.Effect.Common.rmem frame ->
p: Type0
-> FStar.Pervasives.Lemma (requires h0 frame == h1 frame == p)
(ensures Steel.Effect.Common.frame_equalities' frame h0 h1 == p) | {
"end_col": 47,
"end_line": 89,
"start_col": 42,
"start_line": 85
} |
FStar.Pervasives.Lemma | val lemma_frame_refl' (frame: vprop) (h0 h1: rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1) | [
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12 | val lemma_frame_refl' (frame: vprop) (h0 h1: rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
let rec lemma_frame_refl' (frame: vprop) (h0 h1: rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1) = | false | null | true | match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01:rmem p1 = focus_rmem h0 p1 in
let h11:rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12 | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"lemma"
] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.rmem",
"Steel.Effect.Common.vprop'",
"Steel.Effect.Common.lemma_frame_refl'",
"Prims.unit",
"Steel.Effect.Common.rmem'",
"Steel.Effect.Common.valid_rmem",
"Steel.Effect.Common.focus_rmem",
"Steel.Effect.Common.can_be_split_star_r",
"Steel.Effect.Common.can_be_split_star_l",
"Prims.l_True",
"Prims.squash",
"Prims.l_iff",
"Prims.eq2",
"Steel.Effect.Common.normal",
"Steel.Effect.Common.t_of",
"Steel.Effect.Common.frame_equalities'",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame) | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lemma_frame_refl' (frame: vprop) (h0 h1: rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1) | [
"recursion"
] | Steel.Effect.Common.lemma_frame_refl' | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
frame: Steel.Effect.Common.vprop ->
h0: Steel.Effect.Common.rmem frame ->
h1: Steel.Effect.Common.rmem frame
-> FStar.Pervasives.Lemma
(ensures h0 frame == h1 frame <==> Steel.Effect.Common.frame_equalities' frame h0 h1) | {
"end_col": 34,
"end_line": 83,
"start_col": 4,
"start_line": 70
} |
FStar.Pervasives.Lemma | val star_congruence (p1 p2 p3 p4:vprop)
: Lemma (requires p1 `equiv` p3 /\ p2 `equiv` p4)
(ensures (p1 `star` p2) `equiv` (p3 `star` p4)) | [
{
"abbrev": false,
"full_module": "Steel.Semantics.Instantiate",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Semantics.Hoare.MST",
"short_module": "Sem"
},
{
"abbrev": true,
"full_module": "FStar.Algebra.CommMonoid.Equiv",
"short_module": "CE"
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommMonoidSimple.Equiv",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.FunctionalExtensionality",
"short_module": "FExt"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "Mem"
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let star_congruence p1 p2 p3 p4 = Mem.star_congruence (hp_of p1) (hp_of p2) (hp_of p3) (hp_of p4) | val star_congruence (p1 p2 p3 p4:vprop)
: Lemma (requires p1 `equiv` p3 /\ p2 `equiv` p4)
(ensures (p1 `star` p2) `equiv` (p3 `star` p4))
let star_congruence p1 p2 p3 p4 = | false | null | true | Mem.star_congruence (hp_of p1) (hp_of p2) (hp_of p3) (hp_of p4) | {
"checked_file": "Steel.Effect.Common.fst.checked",
"dependencies": [
"Steel.Semantics.Instantiate.fsti.checked",
"Steel.Semantics.Hoare.MST.fst.checked",
"Steel.Memory.fsti.checked",
"prims.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.Effect.Common.fst"
} | [
"lemma"
] | [
"Steel.Effect.Common.vprop",
"Steel.Memory.star_congruence",
"Steel.Effect.Common.hp_of",
"Prims.unit"
] | [] | (*
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.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality
let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})
let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)
let reveal_can_be_split () = ()
let can_be_split_interp r r' h = ()
let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()
let can_be_split_congr_l p q r =
Classical.forall_intro (interp_star (hp_of p) (hp_of r));
Classical.forall_intro (interp_star (hp_of q) (hp_of r))
let can_be_split_congr_r p q r =
Classical.forall_intro (interp_star (hp_of r) (hp_of p));
Classical.forall_intro (interp_star (hp_of r) (hp_of q))
let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()
let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
(h p1, h p2) == h (VStar p1 p2)
let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
: Lemma ((mk_rmem r h) r0 == sel_of r0 h)
= FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
let emp':vprop' =
{ hp = emp;
t = unit;
sel = fun _ -> ()}
let emp = VUnit emp'
let reveal_emp () = ()
let lemma_valid_focus_rmem #r h r0 =
Classical.forall_intro (Classical.move_requires (can_be_split_trans r r0))
let rec lemma_frame_refl' (frame:vprop) (h0:rmem frame) (h1:rmem frame)
: Lemma ((h0 frame == h1 frame) <==> frame_equalities' frame h0 h1)
= match frame with
| VUnit _ -> ()
| VStar p1 p2 ->
can_be_split_star_l p1 p2;
can_be_split_star_r p1 p2;
let h01 : rmem p1 = focus_rmem h0 p1 in
let h11 : rmem p1 = focus_rmem h1 p1 in
let h02 = focus_rmem h0 p2 in
let h12 = focus_rmem h1 p2 in
lemma_frame_refl' p1 h01 h11;
lemma_frame_refl' p2 h02 h12
let lemma_frame_equalities frame h0 h1 p =
let p1 : prop = h0 frame == h1 frame in
let p2 : prop = frame_equalities' frame h0 h1 in
lemma_frame_refl' frame h0 h1;
FStar.PropositionalExtensionality.apply p1 p2
let lemma_frame_emp h0 h1 p =
FStar.PropositionalExtensionality.apply True (h0 (VUnit emp') == h1 (VUnit emp'))
let elim_conjunction p1 p1' p2 p2' = ()
let can_be_split_dep_refl p = ()
let equiv_can_be_split p1 p2 = ()
let intro_can_be_split_frame p q frame = ()
let can_be_split_post_elim t1 t2 = ()
let equiv_forall_refl t = ()
let equiv_forall_elim t1 t2 = ()
let equiv_refl x = ()
let equiv_sym x y = ()
let equiv_trans x y z = ()
let cm_identity x =
Mem.emp_unit (hp_of x);
Mem.star_commutative (hp_of x) Mem.emp
let star_commutative p1 p2 = Mem.star_commutative (hp_of p1) (hp_of p2) | false | false | Steel.Effect.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val star_congruence (p1 p2 p3 p4:vprop)
: Lemma (requires p1 `equiv` p3 /\ p2 `equiv` p4)
(ensures (p1 `star` p2) `equiv` (p3 `star` p4)) | [] | Steel.Effect.Common.star_congruence | {
"file_name": "lib/steel/Steel.Effect.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
p1: Steel.Effect.Common.vprop ->
p2: Steel.Effect.Common.vprop ->
p3: Steel.Effect.Common.vprop ->
p4: Steel.Effect.Common.vprop
-> FStar.Pervasives.Lemma
(requires Steel.Effect.Common.equiv p1 p3 /\ Steel.Effect.Common.equiv p2 p4)
(ensures
Steel.Effect.Common.equiv (Steel.Effect.Common.star p1 p2) (Steel.Effect.Common.star p3 p4)) | {
"end_col": 97,
"end_line": 112,
"start_col": 34,
"start_line": 112
} |
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_Mod_mem_layout = Mod_mem_layout | let va_Mod_mem_layout = | false | null | false | Mod_mem_layout | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.QuickCode.Mod_mem_layout"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_Mod_mem_layout : Vale.X64.QuickCode.mod_t | [] | Vale.X64.QuickCode.va_Mod_mem_layout | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.X64.QuickCode.mod_t | {
"end_col": 57,
"end_line": 30,
"start_col": 43,
"start_line": 30
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_mods_t = mods_t | let va_mods_t = | false | null | false | mods_t | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.QuickCode.mods_t"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_mods_t : Type0 | [] | Vale.X64.QuickCode.va_mods_t | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 29,
"end_line": 22,
"start_col": 23,
"start_line": 22
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_Mod_stack = Mod_stack | let va_Mod_stack = | false | null | false | Mod_stack | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.QuickCode.Mod_stack"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_Mod_stack : Vale.X64.QuickCode.mod_t | [] | Vale.X64.QuickCode.va_Mod_stack | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.X64.QuickCode.mod_t | {
"end_col": 47,
"end_line": 32,
"start_col": 38,
"start_line": 32
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_Mod_stackTaint = Mod_stackTaint | let va_Mod_stackTaint = | false | null | false | Mod_stackTaint | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.QuickCode.Mod_stackTaint"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_Mod_stackTaint : Vale.X64.QuickCode.mod_t | [] | Vale.X64.QuickCode.va_Mod_stackTaint | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.X64.QuickCode.mod_t | {
"end_col": 57,
"end_line": 33,
"start_col": 43,
"start_line": 33
} |
|
Prims.Tot | val va_mod_heaplet (h: heaplet_id) : mod_t | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_mod_heaplet (h:heaplet_id) : mod_t = Mod_mem_heaplet h | val va_mod_heaplet (h: heaplet_id) : mod_t
let va_mod_heaplet (h: heaplet_id) : mod_t = | false | null | false | Mod_mem_heaplet h | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.Decls.heaplet_id",
"Vale.X64.QuickCode.Mod_mem_heaplet",
"Vale.X64.QuickCode.mod_t"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"]
let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false)
[@va_qattr]
let update_state_mod (m:mod_t) (sM sK:vale_state) : vale_state =
match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK
[@va_qattr]
let rec update_state_mods (mods:mods_t) (sM sK:vale_state) : vale_state =
match mods with
| [] -> sK
| m::mods -> update_state_mod m sM (update_state_mods mods sM sK)
[@va_qattr]
unfold let update_state_mods_norm (mods:mods_t) (sM sK:vale_state) : vale_state =
norm [iota; zeta; delta_attr [`%qmodattr]; delta_only [`%update_state_mods; `%update_state_mod]] (update_state_mods mods sM sK)
let va_lemma_norm_mods (mods:mods_t) (sM sK:vale_state) : Lemma
(ensures update_state_mods mods sM sK == update_state_mods_norm mods sM sK)
= ()
[@va_qattr qmodattr]
let va_mod_dst_opr64 (o:operand64) : mod_t =
match o with
| OConst n -> Mod_None
| OReg r -> Mod_reg (Reg 0 r)
| OMem _ -> Mod_None // TODO: support destination memory operands
| OStack _ -> Mod_None // TODO: support destination stack operands
[@va_qattr qmodattr]
let va_mod_reg_opr64 (o:reg_operand) : mod_t =
match o with
| OReg r -> Mod_reg (Reg 0 r) | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_mod_heaplet (h: heaplet_id) : mod_t | [] | Vale.X64.QuickCode.va_mod_heaplet | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | h: Vale.X64.Decls.heaplet_id -> Vale.X64.QuickCode.mod_t | {
"end_col": 82,
"end_line": 89,
"start_col": 65,
"start_line": 89
} |
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let k_true (#a:Type0) (_:vale_state) (_:a) = True | let k_true (#a: Type0) (_: vale_state) (_: a) = | false | null | false | True | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.State.vale_state",
"Prims.l_True",
"Prims.logical"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"]
let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false)
[@va_qattr]
let update_state_mod (m:mod_t) (sM sK:vale_state) : vale_state =
match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK
[@va_qattr]
let rec update_state_mods (mods:mods_t) (sM sK:vale_state) : vale_state =
match mods with
| [] -> sK
| m::mods -> update_state_mod m sM (update_state_mods mods sM sK)
[@va_qattr]
unfold let update_state_mods_norm (mods:mods_t) (sM sK:vale_state) : vale_state =
norm [iota; zeta; delta_attr [`%qmodattr]; delta_only [`%update_state_mods; `%update_state_mod]] (update_state_mods mods sM sK)
let va_lemma_norm_mods (mods:mods_t) (sM sK:vale_state) : Lemma
(ensures update_state_mods mods sM sK == update_state_mods_norm mods sM sK)
= ()
[@va_qattr qmodattr]
let va_mod_dst_opr64 (o:operand64) : mod_t =
match o with
| OConst n -> Mod_None
| OReg r -> Mod_reg (Reg 0 r)
| OMem _ -> Mod_None // TODO: support destination memory operands
| OStack _ -> Mod_None // TODO: support destination stack operands
[@va_qattr qmodattr]
let va_mod_reg_opr64 (o:reg_operand) : mod_t =
match o with
| OReg r -> Mod_reg (Reg 0 r)
[@va_qattr qmodattr] let va_mod_xmm (x:reg_xmm) : mod_t = Mod_reg (Reg 1 x)
[@va_qattr qmodattr] let va_mod_heaplet (h:heaplet_id) : mod_t = Mod_mem_heaplet h
let quickProc_wp (a:Type0) : Type u#1 = (s0:vale_state) -> (wp_continue:vale_state -> a -> Type0) -> Type0 | false | false | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val k_true : _: Vale.X64.State.vale_state -> _: a -> Prims.logical | [] | Vale.X64.QuickCode.k_true | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Vale.X64.State.vale_state -> _: a -> Prims.logical | {
"end_col": 49,
"end_line": 93,
"start_col": 45,
"start_line": 93
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mods_t = list mod_t | let mods_t = | false | null | false | list mod_t | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Prims.list",
"Vale.X64.QuickCode.mod_t"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mods_t : Type0 | [] | Vale.X64.QuickCode.mods_t | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 30,
"end_line": 21,
"start_col": 20,
"start_line": 21
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_Mod_None = Mod_None | let va_Mod_None = | false | null | false | Mod_None | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.QuickCode.Mod_None"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_Mod_None : Vale.X64.QuickCode.mod_t | [] | Vale.X64.QuickCode.va_Mod_None | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.X64.QuickCode.mod_t | {
"end_col": 45,
"end_line": 24,
"start_col": 37,
"start_line": 24
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_Mod_mem = Mod_mem | let va_Mod_mem = | false | null | false | Mod_mem | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.QuickCode.Mod_mem"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r) | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_Mod_mem : Vale.X64.QuickCode.mod_t | [] | Vale.X64.QuickCode.va_Mod_mem | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.X64.QuickCode.mod_t | {
"end_col": 43,
"end_line": 29,
"start_col": 36,
"start_line": 29
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_Mod_ok = Mod_ok | let va_Mod_ok = | false | null | false | Mod_ok | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.QuickCode.Mod_ok"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_Mod_ok : Vale.X64.QuickCode.mod_t | [] | Vale.X64.QuickCode.va_Mod_ok | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.X64.QuickCode.mod_t | {
"end_col": 41,
"end_line": 25,
"start_col": 35,
"start_line": 25
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_Mod_flags = Mod_flags | let va_Mod_flags = | false | null | false | Mod_flags | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.QuickCode.Mod_flags"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r) | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_Mod_flags : Vale.X64.QuickCode.mod_t | [] | Vale.X64.QuickCode.va_Mod_flags | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.X64.QuickCode.mod_t | {
"end_col": 47,
"end_line": 28,
"start_col": 38,
"start_line": 28
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let t_require (s0:va_state) = state_inv s0 | let t_require (s0: va_state) = | false | null | false | state_inv s0 | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.state_inv",
"Vale.Def.Prop_s.prop0"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"]
let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false)
[@va_qattr]
let update_state_mod (m:mod_t) (sM sK:vale_state) : vale_state =
match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK
[@va_qattr]
let rec update_state_mods (mods:mods_t) (sM sK:vale_state) : vale_state =
match mods with
| [] -> sK
| m::mods -> update_state_mod m sM (update_state_mods mods sM sK)
[@va_qattr]
unfold let update_state_mods_norm (mods:mods_t) (sM sK:vale_state) : vale_state =
norm [iota; zeta; delta_attr [`%qmodattr]; delta_only [`%update_state_mods; `%update_state_mod]] (update_state_mods mods sM sK)
let va_lemma_norm_mods (mods:mods_t) (sM sK:vale_state) : Lemma
(ensures update_state_mods mods sM sK == update_state_mods_norm mods sM sK)
= ()
[@va_qattr qmodattr]
let va_mod_dst_opr64 (o:operand64) : mod_t =
match o with
| OConst n -> Mod_None
| OReg r -> Mod_reg (Reg 0 r)
| OMem _ -> Mod_None // TODO: support destination memory operands
| OStack _ -> Mod_None // TODO: support destination stack operands
[@va_qattr qmodattr]
let va_mod_reg_opr64 (o:reg_operand) : mod_t =
match o with
| OReg r -> Mod_reg (Reg 0 r)
[@va_qattr qmodattr] let va_mod_xmm (x:reg_xmm) : mod_t = Mod_reg (Reg 1 x)
[@va_qattr qmodattr] let va_mod_heaplet (h:heaplet_id) : mod_t = Mod_mem_heaplet h
let quickProc_wp (a:Type0) : Type u#1 = (s0:vale_state) -> (wp_continue:vale_state -> a -> Type0) -> Type0
let k_true (#a:Type0) (_:vale_state) (_:a) = True
let t_monotone (#a:Type0) (c:va_code) (wp:quickProc_wp a) : Type =
s0:vale_state -> k1:(vale_state -> a -> Type0) -> k2:(vale_state -> a -> Type0) -> Lemma
(requires (forall (s:vale_state) (g:a). k1 s g ==> k2 s g))
(ensures wp s0 k1 ==> wp s0 k2)
let t_compute (#a:Type0) (c:va_code) (wp:quickProc_wp a) : Type =
s0:vale_state -> Ghost (vale_state & va_fuel & a)
(requires wp s0 k_true)
(ensures fun _ -> True) | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val t_require : s0: Vale.X64.Decls.va_state -> Vale.Def.Prop_s.prop0 | [] | Vale.X64.QuickCode.t_require | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | s0: Vale.X64.Decls.va_state -> Vale.Def.Prop_s.prop0 | {
"end_col": 42,
"end_line": 105,
"start_col": 30,
"start_line": 105
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n | let va_Mod_mem_heaplet (n: heaplet_id) = | false | null | false | Mod_mem_heaplet n | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.Decls.heaplet_id",
"Vale.X64.QuickCode.Mod_mem_heaplet",
"Vale.X64.QuickCode.mod_t"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_Mod_mem_heaplet : n: Vale.X64.Decls.heaplet_id -> Vale.X64.QuickCode.mod_t | [] | Vale.X64.QuickCode.va_Mod_mem_heaplet | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | n: Vale.X64.Decls.heaplet_id -> Vale.X64.QuickCode.mod_t | {
"end_col": 76,
"end_line": 31,
"start_col": 59,
"start_line": 31
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_t_ensure (#a:Type0) (c:va_code) (mods:mods_t) (s0:vale_state) (k:(vale_state -> a -> Type0)) =
fun (sM, f0, g) -> eval_code c s0 f0 sM /\ update_state_mods mods sM s0 == sM /\ state_inv sM /\ k sM g | let va_t_ensure
(#a: Type0)
(c: va_code)
(mods: mods_t)
(s0: vale_state)
(k: (vale_state -> a -> Type0))
= | false | null | false | fun (sM, f0, g) ->
eval_code c s0 f0 sM /\ update_state_mods mods sM s0 == sM /\ state_inv sM /\ k sM g | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_code",
"Vale.X64.QuickCode.mods_t",
"Vale.X64.State.vale_state",
"FStar.Pervasives.Native.tuple3",
"Vale.X64.Decls.va_fuel",
"Prims.l_and",
"Vale.X64.Decls.eval_code",
"Prims.eq2",
"Vale.X64.QuickCode.update_state_mods",
"Vale.X64.Decls.state_inv",
"Prims.logical"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"]
let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false)
[@va_qattr]
let update_state_mod (m:mod_t) (sM sK:vale_state) : vale_state =
match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK
[@va_qattr]
let rec update_state_mods (mods:mods_t) (sM sK:vale_state) : vale_state =
match mods with
| [] -> sK
| m::mods -> update_state_mod m sM (update_state_mods mods sM sK)
[@va_qattr]
unfold let update_state_mods_norm (mods:mods_t) (sM sK:vale_state) : vale_state =
norm [iota; zeta; delta_attr [`%qmodattr]; delta_only [`%update_state_mods; `%update_state_mod]] (update_state_mods mods sM sK)
let va_lemma_norm_mods (mods:mods_t) (sM sK:vale_state) : Lemma
(ensures update_state_mods mods sM sK == update_state_mods_norm mods sM sK)
= ()
[@va_qattr qmodattr]
let va_mod_dst_opr64 (o:operand64) : mod_t =
match o with
| OConst n -> Mod_None
| OReg r -> Mod_reg (Reg 0 r)
| OMem _ -> Mod_None // TODO: support destination memory operands
| OStack _ -> Mod_None // TODO: support destination stack operands
[@va_qattr qmodattr]
let va_mod_reg_opr64 (o:reg_operand) : mod_t =
match o with
| OReg r -> Mod_reg (Reg 0 r)
[@va_qattr qmodattr] let va_mod_xmm (x:reg_xmm) : mod_t = Mod_reg (Reg 1 x)
[@va_qattr qmodattr] let va_mod_heaplet (h:heaplet_id) : mod_t = Mod_mem_heaplet h
let quickProc_wp (a:Type0) : Type u#1 = (s0:vale_state) -> (wp_continue:vale_state -> a -> Type0) -> Type0
let k_true (#a:Type0) (_:vale_state) (_:a) = True
let t_monotone (#a:Type0) (c:va_code) (wp:quickProc_wp a) : Type =
s0:vale_state -> k1:(vale_state -> a -> Type0) -> k2:(vale_state -> a -> Type0) -> Lemma
(requires (forall (s:vale_state) (g:a). k1 s g ==> k2 s g))
(ensures wp s0 k1 ==> wp s0 k2)
let t_compute (#a:Type0) (c:va_code) (wp:quickProc_wp a) : Type =
s0:vale_state -> Ghost (vale_state & va_fuel & a)
(requires wp s0 k_true)
(ensures fun _ -> True)
let t_require (s0:va_state) = state_inv s0
unfold let va_t_require = t_require | false | false | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_t_ensure : c: Vale.X64.Decls.va_code ->
mods: Vale.X64.QuickCode.mods_t ->
s0: Vale.X64.State.vale_state ->
k: (_: Vale.X64.State.vale_state -> _: a -> Type0) ->
_: ((Vale.X64.State.vale_state * Vale.X64.Decls.va_fuel) * a)
-> Prims.logical | [] | Vale.X64.QuickCode.va_t_ensure | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
c: Vale.X64.Decls.va_code ->
mods: Vale.X64.QuickCode.mods_t ->
s0: Vale.X64.State.vale_state ->
k: (_: Vale.X64.State.vale_state -> _: a -> Type0) ->
_: ((Vale.X64.State.vale_state * Vale.X64.Decls.va_fuel) * a)
-> Prims.logical | {
"end_col": 105,
"end_line": 109,
"start_col": 2,
"start_line": 109
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_t_require = t_require | let va_t_require = | false | null | false | t_require | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.QuickCode.t_require"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"]
let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false)
[@va_qattr]
let update_state_mod (m:mod_t) (sM sK:vale_state) : vale_state =
match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK
[@va_qattr]
let rec update_state_mods (mods:mods_t) (sM sK:vale_state) : vale_state =
match mods with
| [] -> sK
| m::mods -> update_state_mod m sM (update_state_mods mods sM sK)
[@va_qattr]
unfold let update_state_mods_norm (mods:mods_t) (sM sK:vale_state) : vale_state =
norm [iota; zeta; delta_attr [`%qmodattr]; delta_only [`%update_state_mods; `%update_state_mod]] (update_state_mods mods sM sK)
let va_lemma_norm_mods (mods:mods_t) (sM sK:vale_state) : Lemma
(ensures update_state_mods mods sM sK == update_state_mods_norm mods sM sK)
= ()
[@va_qattr qmodattr]
let va_mod_dst_opr64 (o:operand64) : mod_t =
match o with
| OConst n -> Mod_None
| OReg r -> Mod_reg (Reg 0 r)
| OMem _ -> Mod_None // TODO: support destination memory operands
| OStack _ -> Mod_None // TODO: support destination stack operands
[@va_qattr qmodattr]
let va_mod_reg_opr64 (o:reg_operand) : mod_t =
match o with
| OReg r -> Mod_reg (Reg 0 r)
[@va_qattr qmodattr] let va_mod_xmm (x:reg_xmm) : mod_t = Mod_reg (Reg 1 x)
[@va_qattr qmodattr] let va_mod_heaplet (h:heaplet_id) : mod_t = Mod_mem_heaplet h
let quickProc_wp (a:Type0) : Type u#1 = (s0:vale_state) -> (wp_continue:vale_state -> a -> Type0) -> Type0
let k_true (#a:Type0) (_:vale_state) (_:a) = True
let t_monotone (#a:Type0) (c:va_code) (wp:quickProc_wp a) : Type =
s0:vale_state -> k1:(vale_state -> a -> Type0) -> k2:(vale_state -> a -> Type0) -> Lemma
(requires (forall (s:vale_state) (g:a). k1 s g ==> k2 s g))
(ensures wp s0 k1 ==> wp s0 k2)
let t_compute (#a:Type0) (c:va_code) (wp:quickProc_wp a) : Type =
s0:vale_state -> Ghost (vale_state & va_fuel & a)
(requires wp s0 k_true)
(ensures fun _ -> True) | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_t_require : s0: Vale.X64.Decls.va_state -> Vale.Def.Prop_s.prop0 | [] | Vale.X64.QuickCode.va_t_require | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | s0: Vale.X64.Decls.va_state -> Vale.Def.Prop_s.prop0 | {
"end_col": 35,
"end_line": 106,
"start_col": 26,
"start_line": 106
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_quickCode = quickCode | let va_quickCode = | false | null | false | quickCode | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.QuickCode.quickCode"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"]
let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false)
[@va_qattr]
let update_state_mod (m:mod_t) (sM sK:vale_state) : vale_state =
match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK
[@va_qattr]
let rec update_state_mods (mods:mods_t) (sM sK:vale_state) : vale_state =
match mods with
| [] -> sK
| m::mods -> update_state_mod m sM (update_state_mods mods sM sK)
[@va_qattr]
unfold let update_state_mods_norm (mods:mods_t) (sM sK:vale_state) : vale_state =
norm [iota; zeta; delta_attr [`%qmodattr]; delta_only [`%update_state_mods; `%update_state_mod]] (update_state_mods mods sM sK)
let va_lemma_norm_mods (mods:mods_t) (sM sK:vale_state) : Lemma
(ensures update_state_mods mods sM sK == update_state_mods_norm mods sM sK)
= ()
[@va_qattr qmodattr]
let va_mod_dst_opr64 (o:operand64) : mod_t =
match o with
| OConst n -> Mod_None
| OReg r -> Mod_reg (Reg 0 r)
| OMem _ -> Mod_None // TODO: support destination memory operands
| OStack _ -> Mod_None // TODO: support destination stack operands
[@va_qattr qmodattr]
let va_mod_reg_opr64 (o:reg_operand) : mod_t =
match o with
| OReg r -> Mod_reg (Reg 0 r)
[@va_qattr qmodattr] let va_mod_xmm (x:reg_xmm) : mod_t = Mod_reg (Reg 1 x)
[@va_qattr qmodattr] let va_mod_heaplet (h:heaplet_id) : mod_t = Mod_mem_heaplet h
let quickProc_wp (a:Type0) : Type u#1 = (s0:vale_state) -> (wp_continue:vale_state -> a -> Type0) -> Type0
let k_true (#a:Type0) (_:vale_state) (_:a) = True
let t_monotone (#a:Type0) (c:va_code) (wp:quickProc_wp a) : Type =
s0:vale_state -> k1:(vale_state -> a -> Type0) -> k2:(vale_state -> a -> Type0) -> Lemma
(requires (forall (s:vale_state) (g:a). k1 s g ==> k2 s g))
(ensures wp s0 k1 ==> wp s0 k2)
let t_compute (#a:Type0) (c:va_code) (wp:quickProc_wp a) : Type =
s0:vale_state -> Ghost (vale_state & va_fuel & a)
(requires wp s0 k_true)
(ensures fun _ -> True)
let t_require (s0:va_state) = state_inv s0
unfold let va_t_require = t_require
let va_t_ensure (#a:Type0) (c:va_code) (mods:mods_t) (s0:vale_state) (k:(vale_state -> a -> Type0)) =
fun (sM, f0, g) -> eval_code c s0 f0 sM /\ update_state_mods mods sM s0 == sM /\ state_inv sM /\ k sM g
let t_proof (#a:Type0) (c:va_code) (mods:mods_t) (wp:quickProc_wp a) : Type =
s0:vale_state -> k:(vale_state -> a -> Type0) -> Ghost (vale_state & va_fuel & a)
(requires t_require s0 /\ wp s0 k)
(ensures va_t_ensure c mods s0 k)
// Code that returns a ghost value of type a
[@va_qattr]
noeq type quickCode (a:Type0) : va_code -> Type =
| QProc:
c:va_code ->
mods:mods_t ->
wp:quickProc_wp a ->
proof:t_proof c mods wp ->
quickCode a c | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_quickCode : a: Type0 -> _: Vale.X64.Machine_s.precode Vale.X64.Decls.ins Vale.X64.Decls.ocmp -> Type | [] | Vale.X64.QuickCode.va_quickCode | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Type0 -> _: Vale.X64.Machine_s.precode Vale.X64.Decls.ins Vale.X64.Decls.ocmp -> Type | {
"end_col": 35,
"end_line": 127,
"start_col": 26,
"start_line": 127
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_QProc = QProc | let va_QProc = | false | null | false | QProc | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.QuickCode.QProc",
"Vale.X64.Machine_s.precode",
"Vale.X64.Decls.ins",
"Vale.X64.Decls.ocmp",
"Prims.list",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.quickProc_wp",
"Vale.X64.QuickCode.t_proof",
"Vale.X64.QuickCode.quickCode"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"]
let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false)
[@va_qattr]
let update_state_mod (m:mod_t) (sM sK:vale_state) : vale_state =
match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK
[@va_qattr]
let rec update_state_mods (mods:mods_t) (sM sK:vale_state) : vale_state =
match mods with
| [] -> sK
| m::mods -> update_state_mod m sM (update_state_mods mods sM sK)
[@va_qattr]
unfold let update_state_mods_norm (mods:mods_t) (sM sK:vale_state) : vale_state =
norm [iota; zeta; delta_attr [`%qmodattr]; delta_only [`%update_state_mods; `%update_state_mod]] (update_state_mods mods sM sK)
let va_lemma_norm_mods (mods:mods_t) (sM sK:vale_state) : Lemma
(ensures update_state_mods mods sM sK == update_state_mods_norm mods sM sK)
= ()
[@va_qattr qmodattr]
let va_mod_dst_opr64 (o:operand64) : mod_t =
match o with
| OConst n -> Mod_None
| OReg r -> Mod_reg (Reg 0 r)
| OMem _ -> Mod_None // TODO: support destination memory operands
| OStack _ -> Mod_None // TODO: support destination stack operands
[@va_qattr qmodattr]
let va_mod_reg_opr64 (o:reg_operand) : mod_t =
match o with
| OReg r -> Mod_reg (Reg 0 r)
[@va_qattr qmodattr] let va_mod_xmm (x:reg_xmm) : mod_t = Mod_reg (Reg 1 x)
[@va_qattr qmodattr] let va_mod_heaplet (h:heaplet_id) : mod_t = Mod_mem_heaplet h
let quickProc_wp (a:Type0) : Type u#1 = (s0:vale_state) -> (wp_continue:vale_state -> a -> Type0) -> Type0
let k_true (#a:Type0) (_:vale_state) (_:a) = True
let t_monotone (#a:Type0) (c:va_code) (wp:quickProc_wp a) : Type =
s0:vale_state -> k1:(vale_state -> a -> Type0) -> k2:(vale_state -> a -> Type0) -> Lemma
(requires (forall (s:vale_state) (g:a). k1 s g ==> k2 s g))
(ensures wp s0 k1 ==> wp s0 k2)
let t_compute (#a:Type0) (c:va_code) (wp:quickProc_wp a) : Type =
s0:vale_state -> Ghost (vale_state & va_fuel & a)
(requires wp s0 k_true)
(ensures fun _ -> True)
let t_require (s0:va_state) = state_inv s0
unfold let va_t_require = t_require
let va_t_ensure (#a:Type0) (c:va_code) (mods:mods_t) (s0:vale_state) (k:(vale_state -> a -> Type0)) =
fun (sM, f0, g) -> eval_code c s0 f0 sM /\ update_state_mods mods sM s0 == sM /\ state_inv sM /\ k sM g
let t_proof (#a:Type0) (c:va_code) (mods:mods_t) (wp:quickProc_wp a) : Type =
s0:vale_state -> k:(vale_state -> a -> Type0) -> Ghost (vale_state & va_fuel & a)
(requires t_require s0 /\ wp s0 k)
(ensures va_t_ensure c mods s0 k)
// Code that returns a ghost value of type a
[@va_qattr]
noeq type quickCode (a:Type0) : va_code -> Type =
| QProc:
c:va_code ->
mods:mods_t ->
wp:quickProc_wp a ->
proof:t_proof c mods wp ->
quickCode a c
[@va_qattr]
unfold let va_quickCode = quickCode | false | false | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_QProc : c: Vale.X64.Machine_s.precode Vale.X64.Decls.ins Vale.X64.Decls.ocmp ->
mods: Prims.list Vale.X64.QuickCode.mod_t ->
wp: Vale.X64.QuickCode.quickProc_wp _ ->
proof: Vale.X64.QuickCode.t_proof c mods wp
-> Vale.X64.QuickCode.quickCode _ c | [] | Vale.X64.QuickCode.va_QProc | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
c: Vale.X64.Machine_s.precode Vale.X64.Decls.ins Vale.X64.Decls.ocmp ->
mods: Prims.list Vale.X64.QuickCode.mod_t ->
wp: Vale.X64.QuickCode.quickProc_wp _ ->
proof: Vale.X64.QuickCode.t_proof c mods wp
-> Vale.X64.QuickCode.quickCode _ c | {
"end_col": 27,
"end_line": 130,
"start_col": 22,
"start_line": 130
} |
|
Prims.Tot | val quickProc_wp (a: Type0) : Type u#1 | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let quickProc_wp (a:Type0) : Type u#1 = (s0:vale_state) -> (wp_continue:vale_state -> a -> Type0) -> Type0 | val quickProc_wp (a: Type0) : Type u#1
let quickProc_wp (a: Type0) : Type u#1 = | false | null | false | s0: vale_state -> (wp_continue: vale_state -> a -> Type0) -> Type0 | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.State.vale_state"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"]
let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false)
[@va_qattr]
let update_state_mod (m:mod_t) (sM sK:vale_state) : vale_state =
match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK
[@va_qattr]
let rec update_state_mods (mods:mods_t) (sM sK:vale_state) : vale_state =
match mods with
| [] -> sK
| m::mods -> update_state_mod m sM (update_state_mods mods sM sK)
[@va_qattr]
unfold let update_state_mods_norm (mods:mods_t) (sM sK:vale_state) : vale_state =
norm [iota; zeta; delta_attr [`%qmodattr]; delta_only [`%update_state_mods; `%update_state_mod]] (update_state_mods mods sM sK)
let va_lemma_norm_mods (mods:mods_t) (sM sK:vale_state) : Lemma
(ensures update_state_mods mods sM sK == update_state_mods_norm mods sM sK)
= ()
[@va_qattr qmodattr]
let va_mod_dst_opr64 (o:operand64) : mod_t =
match o with
| OConst n -> Mod_None
| OReg r -> Mod_reg (Reg 0 r)
| OMem _ -> Mod_None // TODO: support destination memory operands
| OStack _ -> Mod_None // TODO: support destination stack operands
[@va_qattr qmodattr]
let va_mod_reg_opr64 (o:reg_operand) : mod_t =
match o with
| OReg r -> Mod_reg (Reg 0 r)
[@va_qattr qmodattr] let va_mod_xmm (x:reg_xmm) : mod_t = Mod_reg (Reg 1 x)
[@va_qattr qmodattr] let va_mod_heaplet (h:heaplet_id) : mod_t = Mod_mem_heaplet h | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val quickProc_wp (a: Type0) : Type u#1 | [] | Vale.X64.QuickCode.quickProc_wp | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Type0 -> Type | {
"end_col": 106,
"end_line": 91,
"start_col": 40,
"start_line": 91
} |
Prims.Tot | val update_state_mods_norm (mods: mods_t) (sM sK: vale_state) : vale_state | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let update_state_mods_norm (mods:mods_t) (sM sK:vale_state) : vale_state =
norm [iota; zeta; delta_attr [`%qmodattr]; delta_only [`%update_state_mods; `%update_state_mod]] (update_state_mods mods sM sK) | val update_state_mods_norm (mods: mods_t) (sM sK: vale_state) : vale_state
let update_state_mods_norm (mods: mods_t) (sM sK: vale_state) : vale_state = | false | null | false | norm [iota; zeta; delta_attr [`%qmodattr]; delta_only [`%update_state_mods; `%update_state_mod]]
(update_state_mods mods sM sK) | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.QuickCode.mods_t",
"Vale.X64.State.vale_state",
"FStar.Pervasives.norm",
"Prims.Cons",
"FStar.Pervasives.norm_step",
"FStar.Pervasives.iota",
"FStar.Pervasives.zeta",
"FStar.Pervasives.delta_attr",
"Prims.string",
"Prims.Nil",
"FStar.Pervasives.delta_only",
"Vale.X64.QuickCode.update_state_mods"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"]
let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false)
[@va_qattr]
let update_state_mod (m:mod_t) (sM sK:vale_state) : vale_state =
match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK
[@va_qattr]
let rec update_state_mods (mods:mods_t) (sM sK:vale_state) : vale_state =
match mods with
| [] -> sK
| m::mods -> update_state_mod m sM (update_state_mods mods sM sK)
[@va_qattr] | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val update_state_mods_norm (mods: mods_t) (sM sK: vale_state) : vale_state | [] | Vale.X64.QuickCode.update_state_mods_norm | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | mods: Vale.X64.QuickCode.mods_t -> sM: Vale.X64.State.vale_state -> sK: Vale.X64.State.vale_state
-> Vale.X64.State.vale_state | {
"end_col": 129,
"end_line": 69,
"start_col": 2,
"start_line": 69
} |
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r) | let va_Mod_reg64 (r: reg_64) = | false | null | false | Mod_reg (Reg 0 r) | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.Machine_s.reg_64",
"Vale.X64.QuickCode.Mod_reg",
"Vale.X64.Machine_s.Reg",
"Vale.X64.QuickCode.mod_t"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_Mod_reg64 : r: Vale.X64.Machine_s.reg_64 -> Vale.X64.QuickCode.mod_t | [] | Vale.X64.QuickCode.va_Mod_reg64 | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | r: Vale.X64.Machine_s.reg_64 -> Vale.X64.QuickCode.mod_t | {
"end_col": 66,
"end_line": 26,
"start_col": 49,
"start_line": 26
} |
|
Prims.Tot | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r) | let va_Mod_xmm (r: reg_xmm) = | false | null | false | Mod_reg (Reg 1 r) | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.Machine_s.reg_xmm",
"Vale.X64.QuickCode.Mod_reg",
"Vale.X64.Machine_s.Reg",
"Vale.X64.QuickCode.mod_t"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_Mod_xmm : r: Vale.X64.Machine_s.reg_xmm -> Vale.X64.QuickCode.mod_t | [] | Vale.X64.QuickCode.va_Mod_xmm | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | r: Vale.X64.Machine_s.reg_xmm -> Vale.X64.QuickCode.mod_t | {
"end_col": 65,
"end_line": 27,
"start_col": 48,
"start_line": 27
} |
|
Prims.Tot | val va_mod_reg_opr64 (o: reg_operand) : mod_t | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_mod_reg_opr64 (o:reg_operand) : mod_t =
match o with
| OReg r -> Mod_reg (Reg 0 r) | val va_mod_reg_opr64 (o: reg_operand) : mod_t
let va_mod_reg_opr64 (o: reg_operand) : mod_t = | false | null | false | match o with | OReg r -> Mod_reg (Reg 0 r) | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.Decls.reg_operand",
"Vale.X64.Machine_s.reg_64",
"Vale.X64.QuickCode.Mod_reg",
"Vale.X64.Machine_s.Reg",
"Vale.X64.QuickCode.mod_t"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"]
let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false)
[@va_qattr]
let update_state_mod (m:mod_t) (sM sK:vale_state) : vale_state =
match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK
[@va_qattr]
let rec update_state_mods (mods:mods_t) (sM sK:vale_state) : vale_state =
match mods with
| [] -> sK
| m::mods -> update_state_mod m sM (update_state_mods mods sM sK)
[@va_qattr]
unfold let update_state_mods_norm (mods:mods_t) (sM sK:vale_state) : vale_state =
norm [iota; zeta; delta_attr [`%qmodattr]; delta_only [`%update_state_mods; `%update_state_mod]] (update_state_mods mods sM sK)
let va_lemma_norm_mods (mods:mods_t) (sM sK:vale_state) : Lemma
(ensures update_state_mods mods sM sK == update_state_mods_norm mods sM sK)
= ()
[@va_qattr qmodattr]
let va_mod_dst_opr64 (o:operand64) : mod_t =
match o with
| OConst n -> Mod_None
| OReg r -> Mod_reg (Reg 0 r)
| OMem _ -> Mod_None // TODO: support destination memory operands
| OStack _ -> Mod_None // TODO: support destination stack operands
[@va_qattr qmodattr] | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_mod_reg_opr64 (o: reg_operand) : mod_t | [] | Vale.X64.QuickCode.va_mod_reg_opr64 | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | o: Vale.X64.Decls.reg_operand -> Vale.X64.QuickCode.mod_t | {
"end_col": 31,
"end_line": 86,
"start_col": 2,
"start_line": 85
} |
Prims.Tot | val va_mod_xmm (x: reg_xmm) : mod_t | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_mod_xmm (x:reg_xmm) : mod_t = Mod_reg (Reg 1 x) | val va_mod_xmm (x: reg_xmm) : mod_t
let va_mod_xmm (x: reg_xmm) : mod_t = | false | null | false | Mod_reg (Reg 1 x) | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.Machine_s.reg_xmm",
"Vale.X64.QuickCode.Mod_reg",
"Vale.X64.Machine_s.Reg",
"Vale.X64.QuickCode.mod_t"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"]
let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false)
[@va_qattr]
let update_state_mod (m:mod_t) (sM sK:vale_state) : vale_state =
match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK
[@va_qattr]
let rec update_state_mods (mods:mods_t) (sM sK:vale_state) : vale_state =
match mods with
| [] -> sK
| m::mods -> update_state_mod m sM (update_state_mods mods sM sK)
[@va_qattr]
unfold let update_state_mods_norm (mods:mods_t) (sM sK:vale_state) : vale_state =
norm [iota; zeta; delta_attr [`%qmodattr]; delta_only [`%update_state_mods; `%update_state_mod]] (update_state_mods mods sM sK)
let va_lemma_norm_mods (mods:mods_t) (sM sK:vale_state) : Lemma
(ensures update_state_mods mods sM sK == update_state_mods_norm mods sM sK)
= ()
[@va_qattr qmodattr]
let va_mod_dst_opr64 (o:operand64) : mod_t =
match o with
| OConst n -> Mod_None
| OReg r -> Mod_reg (Reg 0 r)
| OMem _ -> Mod_None // TODO: support destination memory operands
| OStack _ -> Mod_None // TODO: support destination stack operands
[@va_qattr qmodattr]
let va_mod_reg_opr64 (o:reg_operand) : mod_t =
match o with
| OReg r -> Mod_reg (Reg 0 r) | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_mod_xmm (x: reg_xmm) : mod_t | [] | Vale.X64.QuickCode.va_mod_xmm | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Vale.X64.Machine_s.reg_xmm -> Vale.X64.QuickCode.mod_t | {
"end_col": 75,
"end_line": 88,
"start_col": 58,
"start_line": 88
} |
Prims.Tot | val update_state_mods (mods: mods_t) (sM sK: vale_state) : vale_state | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec update_state_mods (mods:mods_t) (sM sK:vale_state) : vale_state =
match mods with
| [] -> sK
| m::mods -> update_state_mod m sM (update_state_mods mods sM sK) | val update_state_mods (mods: mods_t) (sM sK: vale_state) : vale_state
let rec update_state_mods (mods: mods_t) (sM sK: vale_state) : vale_state = | false | null | false | match mods with
| [] -> sK
| m :: mods -> update_state_mod m sM (update_state_mods mods sM sK) | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.QuickCode.mods_t",
"Vale.X64.State.vale_state",
"Vale.X64.QuickCode.mod_t",
"Prims.list",
"Vale.X64.QuickCode.update_state_mod",
"Vale.X64.QuickCode.update_state_mods"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"]
let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false)
[@va_qattr]
let update_state_mod (m:mod_t) (sM sK:vale_state) : vale_state =
match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK
[@va_qattr] | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val update_state_mods (mods: mods_t) (sM sK: vale_state) : vale_state | [
"recursion"
] | Vale.X64.QuickCode.update_state_mods | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | mods: Vale.X64.QuickCode.mods_t -> sM: Vale.X64.State.vale_state -> sK: Vale.X64.State.vale_state
-> Vale.X64.State.vale_state | {
"end_col": 67,
"end_line": 65,
"start_col": 2,
"start_line": 63
} |
Prims.Tot | val va_mod_dst_opr64 (o: operand64) : mod_t | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_mod_dst_opr64 (o:operand64) : mod_t =
match o with
| OConst n -> Mod_None
| OReg r -> Mod_reg (Reg 0 r)
| OMem _ -> Mod_None // TODO: support destination memory operands
| OStack _ -> Mod_None | val va_mod_dst_opr64 (o: operand64) : mod_t
let va_mod_dst_opr64 (o: operand64) : mod_t = | false | null | false | match o with
| OConst n -> Mod_None
| OReg r -> Mod_reg (Reg 0 r)
| OMem _ -> Mod_None
| OStack _ -> Mod_None | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.Machine_s.operand64",
"Vale.X64.Machine_s.nat64",
"Vale.X64.QuickCode.Mod_None",
"Vale.X64.Machine_s.reg_64",
"Vale.X64.QuickCode.Mod_reg",
"Vale.X64.Machine_s.Reg",
"Vale.X64.Machine_s.tmaddr",
"Vale.X64.QuickCode.mod_t"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"]
let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false)
[@va_qattr]
let update_state_mod (m:mod_t) (sM sK:vale_state) : vale_state =
match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK
[@va_qattr]
let rec update_state_mods (mods:mods_t) (sM sK:vale_state) : vale_state =
match mods with
| [] -> sK
| m::mods -> update_state_mod m sM (update_state_mods mods sM sK)
[@va_qattr]
unfold let update_state_mods_norm (mods:mods_t) (sM sK:vale_state) : vale_state =
norm [iota; zeta; delta_attr [`%qmodattr]; delta_only [`%update_state_mods; `%update_state_mod]] (update_state_mods mods sM sK)
let va_lemma_norm_mods (mods:mods_t) (sM sK:vale_state) : Lemma
(ensures update_state_mods mods sM sK == update_state_mods_norm mods sM sK)
= ()
[@va_qattr qmodattr] | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_mod_dst_opr64 (o: operand64) : mod_t | [] | Vale.X64.QuickCode.va_mod_dst_opr64 | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | o: Vale.X64.Machine_s.operand64 -> Vale.X64.QuickCode.mod_t | {
"end_col": 24,
"end_line": 81,
"start_col": 2,
"start_line": 77
} |
Prims.Tot | val update_state_mod (m: mod_t) (sM sK: vale_state) : vale_state | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let update_state_mod (m:mod_t) (sM sK:vale_state) : vale_state =
match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK | val update_state_mod (m: mod_t) (sM sK: vale_state) : vale_state
let update_state_mod (m: mod_t) (sM sK: vale_state) : vale_state = | false | null | false | match m with
| Mod_None -> sK
| Mod_ok -> va_update_ok sM sK
| Mod_reg r -> update_register r sM sK
| Mod_flags -> va_update_flags sM sK
| Mod_mem -> va_update_mem sM sK
| Mod_mem_layout -> va_update_mem_layout sM sK
| Mod_mem_heaplet n -> va_update_mem_heaplet n sM sK
| Mod_stack -> va_update_stack sM sK
| Mod_stackTaint -> va_update_stackTaint sM sK | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [
"total"
] | [
"Vale.X64.QuickCode.mod_t",
"Vale.X64.State.vale_state",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Machine_s.reg",
"Vale.X64.Decls.update_register",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_mem",
"Vale.X64.Decls.va_update_mem_layout",
"Vale.X64.Decls.heaplet_id",
"Vale.X64.Decls.va_update_mem_heaplet",
"Vale.X64.Decls.va_update_stack",
"Vale.X64.Decls.va_update_stackTaint"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"]
let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false)
[@va_qattr] | false | true | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val update_state_mod (m: mod_t) (sM sK: vale_state) : vale_state | [] | Vale.X64.QuickCode.update_state_mod | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | m: Vale.X64.QuickCode.mod_t -> sM: Vale.X64.State.vale_state -> sK: Vale.X64.State.vale_state
-> Vale.X64.State.vale_state | {
"end_col": 48,
"end_line": 59,
"start_col": 2,
"start_line": 50
} |
Prims.Pure | val mod_eq (x y: mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) | [
{
"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.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mod_eq (x y:mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) =
match x with
| Mod_None -> (match y with Mod_None -> true | _ -> false)
| Mod_ok -> (match y with Mod_ok -> true | _ -> false)
| Mod_reg rx -> (match y with Mod_reg ry -> rx = ry | _ -> false)
| Mod_flags -> (match y with Mod_flags -> true | _ -> false)
| Mod_mem -> (match y with Mod_mem -> true | _ -> false)
| Mod_mem_layout -> (match y with Mod_mem_layout -> true | _ -> false)
| Mod_mem_heaplet nx -> (match y with Mod_mem_heaplet ny -> nx = ny | _ -> false)
| Mod_stack -> (match y with Mod_stack -> true | _ -> false)
| Mod_stackTaint -> (match y with Mod_stackTaint -> true | _ -> false) | val mod_eq (x y: mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y))
let mod_eq (x y: mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) = | false | null | false | match x with
| Mod_None ->
(match y with
| Mod_None -> true
| _ -> false)
| Mod_ok ->
(match y with
| Mod_ok -> true
| _ -> false)
| Mod_reg rx ->
(match y with
| Mod_reg ry -> rx = ry
| _ -> false)
| Mod_flags ->
(match y with
| Mod_flags -> true
| _ -> false)
| Mod_mem ->
(match y with
| Mod_mem -> true
| _ -> false)
| Mod_mem_layout ->
(match y with
| Mod_mem_layout -> true
| _ -> false)
| Mod_mem_heaplet nx ->
(match y with
| Mod_mem_heaplet ny -> nx = ny
| _ -> false)
| Mod_stack ->
(match y with
| Mod_stack -> true
| _ -> false)
| Mod_stackTaint ->
(match y with
| Mod_stackTaint -> true
| _ -> false) | {
"checked_file": "Vale.X64.QuickCode.fst.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.QuickCode.fst"
} | [] | [
"Vale.X64.QuickCode.mod_t",
"Prims.bool",
"Vale.X64.Machine_s.reg",
"Prims.op_Equality",
"Vale.X64.Decls.heaplet_id",
"Prims.l_True",
"Prims.eq2"
] | [] | module Vale.X64.QuickCode
open FStar.Mul
open Vale.Def.Prop_s
open Vale.X64.Machine_s
open Vale.Arch.HeapImpl
open Vale.X64.State
open Vale.X64.Decls
irreducible let qmodattr = ()
type mod_t =
| Mod_None : mod_t
| Mod_ok: mod_t
| Mod_reg: reg -> mod_t
| Mod_flags: mod_t
| Mod_mem: mod_t
| Mod_mem_layout: mod_t
| Mod_mem_heaplet: heaplet_id -> mod_t
| Mod_stack: mod_t
| Mod_stackTaint: mod_t
unfold let mods_t = list mod_t
unfold let va_mods_t = mods_t
[@va_qattr] unfold let va_Mod_None = Mod_None
[@va_qattr] unfold let va_Mod_ok = Mod_ok
[@va_qattr] unfold let va_Mod_reg64 (r:reg_64) = Mod_reg (Reg 0 r)
[@va_qattr] unfold let va_Mod_xmm (r:reg_xmm) = Mod_reg (Reg 1 r)
[@va_qattr] unfold let va_Mod_flags = Mod_flags
[@va_qattr] unfold let va_Mod_mem = Mod_mem
[@va_qattr] unfold let va_Mod_mem_layout = Mod_mem_layout
[@va_qattr] unfold let va_Mod_mem_heaplet (n:heaplet_id) = Mod_mem_heaplet n
[@va_qattr] unfold let va_Mod_stack = Mod_stack
[@va_qattr] unfold let va_Mod_stackTaint = Mod_stackTaint
[@va_qattr "opaque_to_smt"] | false | false | Vale.X64.QuickCode.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mod_eq (x y: mod_t) : Pure bool (requires True) (ensures fun b -> b == (x = y)) | [] | Vale.X64.QuickCode.mod_eq | {
"file_name": "vale/code/arch/x64/Vale.X64.QuickCode.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Vale.X64.QuickCode.mod_t -> y: Vale.X64.QuickCode.mod_t -> Prims.Pure Prims.bool | {
"end_col": 72,
"end_line": 46,
"start_col": 2,
"start_line": 37
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let raw_comparator (a:Type) = a -> a -> order | let raw_comparator (a: Type) = | false | null | false | a -> a -> order | {
"checked_file": "FStar.Class.TotalOrder.Raw.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Class.TotalOrder.Raw.fst"
} | [
"total"
] | [
"FStar.Order.order"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Class.TotalOrder.Raw
open FStar.Order
let flip = function
| Lt -> Gt
| Eq -> Eq
| Gt -> Lt | false | true | FStar.Class.TotalOrder.Raw.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val raw_comparator : a: Type -> Type | [] | FStar.Class.TotalOrder.Raw.raw_comparator | {
"file_name": "ulib/FStar.Class.TotalOrder.Raw.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: Type -> Type | {
"end_col": 45,
"end_line": 25,
"start_col": 30,
"start_line": 25
} |
|
Prims.Tot | [@@ FStar.Tactics.Typeclasses.tcinstance]
val totalorder_list (#a: _) (d: totalorder a) : totalorder (list a) | [
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | instance totalorder_list #a (d : totalorder a) : totalorder (list a) = {
compare = raw_compare_lists d;
} | [@@ FStar.Tactics.Typeclasses.tcinstance]
val totalorder_list (#a: _) (d: totalorder a) : totalorder (list a)
[@@ FStar.Tactics.Typeclasses.tcinstance]
let totalorder_list #a (d: totalorder a) : totalorder (list a) = | false | null | false | { compare = raw_compare_lists d } | {
"checked_file": "FStar.Class.TotalOrder.Raw.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Class.TotalOrder.Raw.fst"
} | [
"total"
] | [
"FStar.Class.TotalOrder.Raw.totalorder",
"FStar.Class.TotalOrder.Raw.Mktotalorder",
"Prims.list",
"FStar.Class.TotalOrder.Raw.raw_compare_lists"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Class.TotalOrder.Raw
open FStar.Order
let flip = function
| Lt -> Gt
| Eq -> Eq
| Gt -> Lt
let raw_comparator (a:Type) = a -> a -> order
class totalorder (a:Type) = {
compare : raw_comparator a;
}
val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<) x y = compare x y = Lt
val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (>) x y = compare x y = Gt
val (=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (=) x y = compare x y = Eq
val (<=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<=) x y = compare x y <> Gt
val (>=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (>=) x y = compare x y <> Lt
val (<>) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<>) x y = compare x y <> Eq
instance _ : totalorder int = {
compare = Order.compare_int;
}
instance _ : totalorder bool = {
compare = (fun b1 b2 -> match b1, b2 with | false, false | true, true -> Eq | false, _ -> Lt | _ -> Gt);
}
(* Lex order on tuples *)
instance totalorder_pair #a #b (d1 : totalorder a) (d2 : totalorder b) : totalorder (a & b) = {
compare = (fun (xa,xb) (ya, yb) ->
match compare xa ya with
| Lt -> Lt
| Gt -> Gt
| Eq -> compare xb yb);
}
instance totalorder_option #a (d : totalorder a) : totalorder (option a) = {
compare = (fun o1 o2 -> match o1, o2 with
| None, None -> Eq
| None, Some _ -> Lt
| Some _, None -> Gt
| Some a1, Some a2 -> compare a1 a2);
}
let rec raw_compare_lists #a (d : totalorder a) : raw_comparator (list a) =
fun l1 l2 ->
match l1, l2 with
| [], [] -> Eq
| [], _::_ -> Lt
| _::_, [] -> Gt
| x::xs, y::ys ->
match compare x y with
| Lt -> Lt
| Gt -> Gt
| Eq -> raw_compare_lists d xs ys | false | false | FStar.Class.TotalOrder.Raw.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | [@@ FStar.Tactics.Typeclasses.tcinstance]
val totalorder_list (#a: _) (d: totalorder a) : totalorder (list a) | [] | FStar.Class.TotalOrder.Raw.totalorder_list | {
"file_name": "ulib/FStar.Class.TotalOrder.Raw.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | d: FStar.Class.TotalOrder.Raw.totalorder a -> FStar.Class.TotalOrder.Raw.totalorder (Prims.list a) | {
"end_col": 32,
"end_line": 87,
"start_col": 2,
"start_line": 87
} |
Prims.Tot | val (=) : #t:Type -> {|totalorder t|} -> t -> t -> bool | [
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let (=) x y = compare x y = Eq | val (=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let op_Equals x y = | false | null | false | compare x y = Eq | {
"checked_file": "FStar.Class.TotalOrder.Raw.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Class.TotalOrder.Raw.fst"
} | [
"total"
] | [
"FStar.Class.TotalOrder.Raw.totalorder",
"Prims.op_Equality",
"FStar.Order.order",
"FStar.Class.TotalOrder.Raw.compare",
"FStar.Order.Eq",
"Prims.bool"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Class.TotalOrder.Raw
open FStar.Order
let flip = function
| Lt -> Gt
| Eq -> Eq
| Gt -> Lt
let raw_comparator (a:Type) = a -> a -> order
class totalorder (a:Type) = {
compare : raw_comparator a;
}
val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<) x y = compare x y = Lt
val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (>) x y = compare x y = Gt | false | false | FStar.Class.TotalOrder.Raw.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val (=) : #t:Type -> {|totalorder t|} -> t -> t -> bool | [] | FStar.Class.TotalOrder.Raw.op_Equals | {
"file_name": "ulib/FStar.Class.TotalOrder.Raw.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {| _: FStar.Class.TotalOrder.Raw.totalorder t |} -> x: t -> y: t -> Prims.bool | {
"end_col": 30,
"end_line": 38,
"start_col": 14,
"start_line": 38
} |
Prims.Tot | val (<>) : #t:Type -> {|totalorder t|} -> t -> t -> bool | [
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let (<>) x y = compare x y <> Eq | val (<>) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let op_Less_Greater x y = | false | null | false | compare x y <> Eq | {
"checked_file": "FStar.Class.TotalOrder.Raw.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Class.TotalOrder.Raw.fst"
} | [
"total"
] | [
"FStar.Class.TotalOrder.Raw.totalorder",
"Prims.op_disEquality",
"FStar.Order.order",
"FStar.Class.TotalOrder.Raw.compare",
"FStar.Order.Eq",
"Prims.bool"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Class.TotalOrder.Raw
open FStar.Order
let flip = function
| Lt -> Gt
| Eq -> Eq
| Gt -> Lt
let raw_comparator (a:Type) = a -> a -> order
class totalorder (a:Type) = {
compare : raw_comparator a;
}
val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<) x y = compare x y = Lt
val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (>) x y = compare x y = Gt
val (=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (=) x y = compare x y = Eq
val (<=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<=) x y = compare x y <> Gt
val (>=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (>=) x y = compare x y <> Lt | false | false | FStar.Class.TotalOrder.Raw.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val (<>) : #t:Type -> {|totalorder t|} -> t -> t -> bool | [] | FStar.Class.TotalOrder.Raw.op_Less_Greater | {
"file_name": "ulib/FStar.Class.TotalOrder.Raw.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {| _: FStar.Class.TotalOrder.Raw.totalorder t |} -> x: t -> y: t -> Prims.bool | {
"end_col": 32,
"end_line": 47,
"start_col": 15,
"start_line": 47
} |
Prims.Tot | val (>=) : #t:Type -> {|totalorder t|} -> t -> t -> bool | [
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let (>=) x y = compare x y <> Lt | val (>=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let op_Greater_Equals x y = | false | null | false | compare x y <> Lt | {
"checked_file": "FStar.Class.TotalOrder.Raw.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Class.TotalOrder.Raw.fst"
} | [
"total"
] | [
"FStar.Class.TotalOrder.Raw.totalorder",
"Prims.op_disEquality",
"FStar.Order.order",
"FStar.Class.TotalOrder.Raw.compare",
"FStar.Order.Lt",
"Prims.bool"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Class.TotalOrder.Raw
open FStar.Order
let flip = function
| Lt -> Gt
| Eq -> Eq
| Gt -> Lt
let raw_comparator (a:Type) = a -> a -> order
class totalorder (a:Type) = {
compare : raw_comparator a;
}
val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<) x y = compare x y = Lt
val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (>) x y = compare x y = Gt
val (=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (=) x y = compare x y = Eq
val (<=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<=) x y = compare x y <> Gt | false | false | FStar.Class.TotalOrder.Raw.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val (>=) : #t:Type -> {|totalorder t|} -> t -> t -> bool | [] | FStar.Class.TotalOrder.Raw.op_Greater_Equals | {
"file_name": "ulib/FStar.Class.TotalOrder.Raw.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {| _: FStar.Class.TotalOrder.Raw.totalorder t |} -> x: t -> y: t -> Prims.bool | {
"end_col": 32,
"end_line": 44,
"start_col": 15,
"start_line": 44
} |
Prims.Tot | val (<=) : #t:Type -> {|totalorder t|} -> t -> t -> bool | [
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let (<=) x y = compare x y <> Gt | val (<=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let op_Less_Equals x y = | false | null | false | compare x y <> Gt | {
"checked_file": "FStar.Class.TotalOrder.Raw.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Class.TotalOrder.Raw.fst"
} | [
"total"
] | [
"FStar.Class.TotalOrder.Raw.totalorder",
"Prims.op_disEquality",
"FStar.Order.order",
"FStar.Class.TotalOrder.Raw.compare",
"FStar.Order.Gt",
"Prims.bool"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Class.TotalOrder.Raw
open FStar.Order
let flip = function
| Lt -> Gt
| Eq -> Eq
| Gt -> Lt
let raw_comparator (a:Type) = a -> a -> order
class totalorder (a:Type) = {
compare : raw_comparator a;
}
val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<) x y = compare x y = Lt
val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (>) x y = compare x y = Gt
val (=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (=) x y = compare x y = Eq | false | false | FStar.Class.TotalOrder.Raw.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val (<=) : #t:Type -> {|totalorder t|} -> t -> t -> bool | [] | FStar.Class.TotalOrder.Raw.op_Less_Equals | {
"file_name": "ulib/FStar.Class.TotalOrder.Raw.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {| _: FStar.Class.TotalOrder.Raw.totalorder t |} -> x: t -> y: t -> Prims.bool | {
"end_col": 32,
"end_line": 41,
"start_col": 15,
"start_line": 41
} |
Prims.Tot | val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool | [
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let (<) x y = compare x y = Lt | val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let op_Less x y = | false | null | false | compare x y = Lt | {
"checked_file": "FStar.Class.TotalOrder.Raw.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Class.TotalOrder.Raw.fst"
} | [
"total"
] | [
"FStar.Class.TotalOrder.Raw.totalorder",
"Prims.op_Equality",
"FStar.Order.order",
"FStar.Class.TotalOrder.Raw.compare",
"FStar.Order.Lt",
"Prims.bool"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Class.TotalOrder.Raw
open FStar.Order
let flip = function
| Lt -> Gt
| Eq -> Eq
| Gt -> Lt
let raw_comparator (a:Type) = a -> a -> order
class totalorder (a:Type) = {
compare : raw_comparator a;
} | false | false | FStar.Class.TotalOrder.Raw.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool | [] | FStar.Class.TotalOrder.Raw.op_Less | {
"file_name": "ulib/FStar.Class.TotalOrder.Raw.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {| _: FStar.Class.TotalOrder.Raw.totalorder t |} -> x: t -> y: t -> Prims.bool | {
"end_col": 30,
"end_line": 32,
"start_col": 14,
"start_line": 32
} |
Prims.Tot | val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool | [
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let (>) x y = compare x y = Gt | val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let op_Greater x y = | false | null | false | compare x y = Gt | {
"checked_file": "FStar.Class.TotalOrder.Raw.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Class.TotalOrder.Raw.fst"
} | [
"total"
] | [
"FStar.Class.TotalOrder.Raw.totalorder",
"Prims.op_Equality",
"FStar.Order.order",
"FStar.Class.TotalOrder.Raw.compare",
"FStar.Order.Gt",
"Prims.bool"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Class.TotalOrder.Raw
open FStar.Order
let flip = function
| Lt -> Gt
| Eq -> Eq
| Gt -> Lt
let raw_comparator (a:Type) = a -> a -> order
class totalorder (a:Type) = {
compare : raw_comparator a;
}
val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<) x y = compare x y = Lt | false | false | FStar.Class.TotalOrder.Raw.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool | [] | FStar.Class.TotalOrder.Raw.op_Greater | {
"file_name": "ulib/FStar.Class.TotalOrder.Raw.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {| _: FStar.Class.TotalOrder.Raw.totalorder t |} -> x: t -> y: t -> Prims.bool | {
"end_col": 30,
"end_line": 35,
"start_col": 14,
"start_line": 35
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let flip = function
| Lt -> Gt
| Eq -> Eq
| Gt -> Lt | let flip = | false | null | false | function
| Lt -> Gt
| Eq -> Eq
| Gt -> Lt | {
"checked_file": "FStar.Class.TotalOrder.Raw.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Class.TotalOrder.Raw.fst"
} | [
"total"
] | [
"FStar.Order.order",
"FStar.Order.Gt",
"FStar.Order.Eq",
"FStar.Order.Lt"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Class.TotalOrder.Raw
open FStar.Order | false | true | FStar.Class.TotalOrder.Raw.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val flip : _: FStar.Order.order -> FStar.Order.order | [] | FStar.Class.TotalOrder.Raw.flip | {
"file_name": "ulib/FStar.Class.TotalOrder.Raw.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | _: FStar.Order.order -> FStar.Order.order | {
"end_col": 12,
"end_line": 23,
"start_col": 11,
"start_line": 20
} |
|
Prims.Tot | [@@ FStar.Tactics.Typeclasses.tcinstance]
val totalorder_pair (#a #b: _) (d1: totalorder a) (d2: totalorder b) : totalorder (a & b) | [
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | instance totalorder_pair #a #b (d1 : totalorder a) (d2 : totalorder b) : totalorder (a & b) = {
compare = (fun (xa,xb) (ya, yb) ->
match compare xa ya with
| Lt -> Lt
| Gt -> Gt
| Eq -> compare xb yb);
} | [@@ FStar.Tactics.Typeclasses.tcinstance]
val totalorder_pair (#a #b: _) (d1: totalorder a) (d2: totalorder b) : totalorder (a & b)
[@@ FStar.Tactics.Typeclasses.tcinstance]
let totalorder_pair #a #b (d1: totalorder a) (d2: totalorder b) : totalorder (a & b) = | false | null | false | {
compare
=
(fun (xa, xb) (ya, yb) ->
match compare xa ya with
| Lt -> Lt
| Gt -> Gt
| Eq -> compare xb yb)
} | {
"checked_file": "FStar.Class.TotalOrder.Raw.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Class.TotalOrder.Raw.fst"
} | [
"total"
] | [
"FStar.Class.TotalOrder.Raw.totalorder",
"FStar.Class.TotalOrder.Raw.Mktotalorder",
"FStar.Pervasives.Native.tuple2",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Class.TotalOrder.Raw.compare",
"FStar.Order.Lt",
"FStar.Order.Gt",
"FStar.Order.order"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Class.TotalOrder.Raw
open FStar.Order
let flip = function
| Lt -> Gt
| Eq -> Eq
| Gt -> Lt
let raw_comparator (a:Type) = a -> a -> order
class totalorder (a:Type) = {
compare : raw_comparator a;
}
val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<) x y = compare x y = Lt
val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (>) x y = compare x y = Gt
val (=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (=) x y = compare x y = Eq
val (<=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<=) x y = compare x y <> Gt
val (>=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (>=) x y = compare x y <> Lt
val (<>) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<>) x y = compare x y <> Eq
instance _ : totalorder int = {
compare = Order.compare_int;
}
instance _ : totalorder bool = {
compare = (fun b1 b2 -> match b1, b2 with | false, false | true, true -> Eq | false, _ -> Lt | _ -> Gt);
}
(* Lex order on tuples *) | false | false | FStar.Class.TotalOrder.Raw.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | [@@ FStar.Tactics.Typeclasses.tcinstance]
val totalorder_pair (#a #b: _) (d1: totalorder a) (d2: totalorder b) : totalorder (a & b) | [] | FStar.Class.TotalOrder.Raw.totalorder_pair | {
"file_name": "ulib/FStar.Class.TotalOrder.Raw.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | d1: FStar.Class.TotalOrder.Raw.totalorder a -> d2: FStar.Class.TotalOrder.Raw.totalorder b
-> FStar.Class.TotalOrder.Raw.totalorder (a * b) | {
"end_col": 27,
"end_line": 63,
"start_col": 2,
"start_line": 59
} |
Prims.Tot | [@@ FStar.Tactics.Typeclasses.tcinstance]
val totalorder_option (#a: _) (d: totalorder a) : totalorder (option a) | [
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | instance totalorder_option #a (d : totalorder a) : totalorder (option a) = {
compare = (fun o1 o2 -> match o1, o2 with
| None, None -> Eq
| None, Some _ -> Lt
| Some _, None -> Gt
| Some a1, Some a2 -> compare a1 a2);
} | [@@ FStar.Tactics.Typeclasses.tcinstance]
val totalorder_option (#a: _) (d: totalorder a) : totalorder (option a)
[@@ FStar.Tactics.Typeclasses.tcinstance]
let totalorder_option #a (d: totalorder a) : totalorder (option a) = | false | null | false | {
compare
=
(fun o1 o2 ->
match o1, o2 with
| None, None -> Eq
| None, Some _ -> Lt
| Some _, None -> Gt
| Some a1, Some a2 -> compare a1 a2)
} | {
"checked_file": "FStar.Class.TotalOrder.Raw.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Class.TotalOrder.Raw.fst"
} | [
"total"
] | [
"FStar.Class.TotalOrder.Raw.totalorder",
"FStar.Class.TotalOrder.Raw.Mktotalorder",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Order.Eq",
"FStar.Order.Lt",
"FStar.Order.Gt",
"FStar.Class.TotalOrder.Raw.compare",
"FStar.Order.order"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Class.TotalOrder.Raw
open FStar.Order
let flip = function
| Lt -> Gt
| Eq -> Eq
| Gt -> Lt
let raw_comparator (a:Type) = a -> a -> order
class totalorder (a:Type) = {
compare : raw_comparator a;
}
val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<) x y = compare x y = Lt
val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (>) x y = compare x y = Gt
val (=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (=) x y = compare x y = Eq
val (<=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<=) x y = compare x y <> Gt
val (>=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (>=) x y = compare x y <> Lt
val (<>) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<>) x y = compare x y <> Eq
instance _ : totalorder int = {
compare = Order.compare_int;
}
instance _ : totalorder bool = {
compare = (fun b1 b2 -> match b1, b2 with | false, false | true, true -> Eq | false, _ -> Lt | _ -> Gt);
}
(* Lex order on tuples *)
instance totalorder_pair #a #b (d1 : totalorder a) (d2 : totalorder b) : totalorder (a & b) = {
compare = (fun (xa,xb) (ya, yb) ->
match compare xa ya with
| Lt -> Lt
| Gt -> Gt
| Eq -> compare xb yb);
} | false | false | FStar.Class.TotalOrder.Raw.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | [@@ FStar.Tactics.Typeclasses.tcinstance]
val totalorder_option (#a: _) (d: totalorder a) : totalorder (option a) | [] | FStar.Class.TotalOrder.Raw.totalorder_option | {
"file_name": "ulib/FStar.Class.TotalOrder.Raw.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | d: FStar.Class.TotalOrder.Raw.totalorder a
-> FStar.Class.TotalOrder.Raw.totalorder (FStar.Pervasives.Native.option a) | {
"end_col": 41,
"end_line": 71,
"start_col": 2,
"start_line": 67
} |
Prims.Tot | val raw_compare_lists (#a: _) (d: totalorder a) : raw_comparator (list a) | [
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Class.TotalOrder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec raw_compare_lists #a (d : totalorder a) : raw_comparator (list a) =
fun l1 l2 ->
match l1, l2 with
| [], [] -> Eq
| [], _::_ -> Lt
| _::_, [] -> Gt
| x::xs, y::ys ->
match compare x y with
| Lt -> Lt
| Gt -> Gt
| Eq -> raw_compare_lists d xs ys | val raw_compare_lists (#a: _) (d: totalorder a) : raw_comparator (list a)
let rec raw_compare_lists #a (d: totalorder a) : raw_comparator (list a) = | false | null | false | fun l1 l2 ->
match l1, l2 with
| [], [] -> Eq
| [], _ :: _ -> Lt
| _ :: _, [] -> Gt
| x :: xs, y :: ys ->
match compare x y with
| Lt -> Lt
| Gt -> Gt
| Eq -> raw_compare_lists d xs ys | {
"checked_file": "FStar.Class.TotalOrder.Raw.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Class.TotalOrder.Raw.fst"
} | [
"total"
] | [
"FStar.Class.TotalOrder.Raw.totalorder",
"Prims.list",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Order.Eq",
"FStar.Order.Lt",
"FStar.Order.Gt",
"FStar.Class.TotalOrder.Raw.compare",
"FStar.Class.TotalOrder.Raw.raw_compare_lists",
"FStar.Order.order"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Class.TotalOrder.Raw
open FStar.Order
let flip = function
| Lt -> Gt
| Eq -> Eq
| Gt -> Lt
let raw_comparator (a:Type) = a -> a -> order
class totalorder (a:Type) = {
compare : raw_comparator a;
}
val (<) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<) x y = compare x y = Lt
val (>) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (>) x y = compare x y = Gt
val (=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (=) x y = compare x y = Eq
val (<=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<=) x y = compare x y <> Gt
val (>=) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (>=) x y = compare x y <> Lt
val (<>) : #t:Type -> {|totalorder t|} -> t -> t -> bool
let (<>) x y = compare x y <> Eq
instance _ : totalorder int = {
compare = Order.compare_int;
}
instance _ : totalorder bool = {
compare = (fun b1 b2 -> match b1, b2 with | false, false | true, true -> Eq | false, _ -> Lt | _ -> Gt);
}
(* Lex order on tuples *)
instance totalorder_pair #a #b (d1 : totalorder a) (d2 : totalorder b) : totalorder (a & b) = {
compare = (fun (xa,xb) (ya, yb) ->
match compare xa ya with
| Lt -> Lt
| Gt -> Gt
| Eq -> compare xb yb);
}
instance totalorder_option #a (d : totalorder a) : totalorder (option a) = {
compare = (fun o1 o2 -> match o1, o2 with
| None, None -> Eq
| None, Some _ -> Lt
| Some _, None -> Gt
| Some a1, Some a2 -> compare a1 a2);
} | false | false | FStar.Class.TotalOrder.Raw.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val raw_compare_lists (#a: _) (d: totalorder a) : raw_comparator (list a) | [
"recursion"
] | FStar.Class.TotalOrder.Raw.raw_compare_lists | {
"file_name": "ulib/FStar.Class.TotalOrder.Raw.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | d: FStar.Class.TotalOrder.Raw.totalorder a
-> FStar.Class.TotalOrder.Raw.raw_comparator (Prims.list a) | {
"end_col": 41,
"end_line": 84,
"start_col": 2,
"start_line": 75
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let is_weak = function
| WeakHashes
| InplaceHashes -> true
| _ -> false | let is_weak = | false | null | false | function
| WeakHashes | InplaceHashes -> true
| _ -> false | {
"checked_file": "HashingOptions.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "HashingOptions.fst"
} | [
"total"
] | [
"HashingOptions.check_hashes_t",
"Prims.bool"
] | [] | module HashingOptions
type check_hashes_t = | WeakHashes | StrongHashes | InplaceHashes | false | true | HashingOptions.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val is_weak : _: HashingOptions.check_hashes_t -> Prims.bool | [] | HashingOptions.is_weak | {
"file_name": "src/3d/HashingOptions.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | _: HashingOptions.check_hashes_t -> Prims.bool | {
"end_col": 14,
"end_line": 8,
"start_col": 14,
"start_line": 5
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let string_of_input_stream_binding = function
| InputStreamBuffer -> "buffer"
| InputStreamExtern _ -> "extern"
| InputStreamStatic _ -> "static" | let string_of_input_stream_binding = | false | null | false | function
| InputStreamBuffer -> "buffer"
| InputStreamExtern _ -> "extern"
| InputStreamStatic _ -> "static" | {
"checked_file": "HashingOptions.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "HashingOptions.fst"
} | [
"total"
] | [
"HashingOptions.input_stream_binding_t",
"Prims.string"
] | [] | module HashingOptions
type check_hashes_t = | WeakHashes | StrongHashes | InplaceHashes
let is_weak = function
| WeakHashes
| InplaceHashes -> true
| _ -> false
type micro_step_t =
| MicroStepVerify
| MicroStepExtract
| MicroStepCopyClangFormat
| MicroStepEmitConfig
type makefile_type =
| MakefileGMake
| MakefileNMake
type input_stream_binding_t =
| InputStreamBuffer
| InputStreamExtern:
(include_file: string) ->
input_stream_binding_t
| InputStreamStatic:
(include_file: string) ->
input_stream_binding_t | false | true | HashingOptions.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val string_of_input_stream_binding : _: HashingOptions.input_stream_binding_t -> Prims.string | [] | HashingOptions.string_of_input_stream_binding | {
"file_name": "src/3d/HashingOptions.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | _: HashingOptions.input_stream_binding_t -> Prims.string | {
"end_col": 35,
"end_line": 32,
"start_col": 37,
"start_line": 29
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let input_stream_include = function
| InputStreamBuffer -> ""
| InputStreamStatic s
| InputStreamExtern s -> s | let input_stream_include = | false | null | false | function
| InputStreamBuffer -> ""
| InputStreamStatic s | InputStreamExtern s -> s | {
"checked_file": "HashingOptions.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "HashingOptions.fst"
} | [
"total"
] | [
"HashingOptions.input_stream_binding_t",
"Prims.string"
] | [] | module HashingOptions
type check_hashes_t = | WeakHashes | StrongHashes | InplaceHashes
let is_weak = function
| WeakHashes
| InplaceHashes -> true
| _ -> false
type micro_step_t =
| MicroStepVerify
| MicroStepExtract
| MicroStepCopyClangFormat
| MicroStepEmitConfig
type makefile_type =
| MakefileGMake
| MakefileNMake
type input_stream_binding_t =
| InputStreamBuffer
| InputStreamExtern:
(include_file: string) ->
input_stream_binding_t
| InputStreamStatic:
(include_file: string) ->
input_stream_binding_t
let string_of_input_stream_binding = function
| InputStreamBuffer -> "buffer"
| InputStreamExtern _ -> "extern"
| InputStreamStatic _ -> "static" | false | true | HashingOptions.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val input_stream_include : _: HashingOptions.input_stream_binding_t -> Prims.string | [] | HashingOptions.input_stream_include | {
"file_name": "src/3d/HashingOptions.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | _: HashingOptions.input_stream_binding_t -> Prims.string | {
"end_col": 28,
"end_line": 37,
"start_col": 27,
"start_line": 34
} |
|
Prims.GTot | val feval (#w: lanes) (h: mem) (f: felem w) : GTot (LSeq.lseq Vec.pfelem w) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f) | val feval (#w: lanes) (h: mem) (f: felem w) : GTot (LSeq.lseq Vec.pfelem w)
let feval (#w: lanes) (h: mem) (f: felem w) : GTot (LSeq.lseq Vec.pfelem w) = | false | null | false | feval5 (as_tup5 h f) | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [
"sometrivial"
] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"FStar.Monotonic.HyperStack.mem",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Hacl.Spec.Poly1305.Field32xN.feval5",
"Hacl.Impl.Poly1305.Field32xN.as_tup5",
"Lib.Sequence.lseq",
"Hacl.Spec.Poly1305.Vec.pfelem"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val feval (#w: lanes) (h: mem) (f: felem w) : GTot (LSeq.lseq Vec.pfelem w) | [] | Hacl.Impl.Poly1305.Field32xN.feval | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | h: FStar.Monotonic.HyperStack.mem -> f: Hacl.Impl.Poly1305.Field32xN.felem w
-> Prims.GTot (Lib.Sequence.lseq Hacl.Spec.Poly1305.Vec.pfelem w) | {
"end_col": 22,
"end_line": 56,
"start_col": 2,
"start_line": 56
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let op_String_Access #a #len = LSeq.index #a #len | let op_String_Access #a #len = | false | null | false | LSeq.index #a #len | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [
"total"
] | [
"Lib.IntTypes.size_nat",
"Lib.Sequence.index",
"Lib.Sequence.lseq",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_Subtraction",
"Prims.pow2",
"Prims.op_LessThan",
"Prims.eq2",
"FStar.Seq.Base.index",
"Lib.Sequence.to_seq"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_String_Access : s: Lib.Sequence.lseq a len -> i: (n: Prims.nat{n <= Prims.pow2 32 - 1}){i < len}
-> r: a{r == FStar.Seq.Base.index (Lib.Sequence.to_seq s) i} | [] | Hacl.Impl.Poly1305.Field32xN.op_String_Access | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | s: Lib.Sequence.lseq a len -> i: (n: Prims.nat{n <= Prims.pow2 32 - 1}){i < len}
-> r: a{r == FStar.Seq.Base.index (Lib.Sequence.to_seq s) i} | {
"end_col": 49,
"end_line": 31,
"start_col": 31,
"start_line": 31
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let felem_wide (w:lanes) = felem w | let felem_wide (w: lanes) = | false | null | false | felem w | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul | false | true | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val felem_wide : w: Hacl.Spec.Poly1305.Field32xN.lanes -> Type0 | [] | Hacl.Impl.Poly1305.Field32xN.felem_wide | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | w: Hacl.Spec.Poly1305.Field32xN.lanes -> Type0 | {
"end_col": 34,
"end_line": 26,
"start_col": 27,
"start_line": 26
} |
|
Prims.Tot | val felem_less (#w: lanes) (h: mem) (f: felem w) (max: nat) : Type0 | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max | val felem_less (#w: lanes) (h: mem) (f: felem w) (max: nat) : Type0
let felem_less (#w: lanes) (h: mem) (f: felem w) (max: nat) : Type0 = | false | null | false | felem_less5 (as_tup5 h f) max | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"FStar.Monotonic.HyperStack.mem",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Prims.nat",
"Hacl.Spec.Poly1305.Field32xN.felem_less5",
"Hacl.Impl.Poly1305.Field32xN.as_tup5"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val felem_less (#w: lanes) (h: mem) (f: felem w) (max: nat) : Type0 | [] | Hacl.Impl.Poly1305.Field32xN.felem_less | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | h: FStar.Monotonic.HyperStack.mem -> f: Hacl.Impl.Poly1305.Field32xN.felem w -> max: Prims.nat
-> Type0 | {
"end_col": 31,
"end_line": 64,
"start_col": 2,
"start_line": 64
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul | let precomp_r (w: lanes) = | false | null | false | lbuffer (uint64xN w) 20ul | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Lib.Buffer.lbuffer",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"FStar.UInt32.__uint_to_t"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w | false | true | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val precomp_r : w: Hacl.Spec.Poly1305.Field32xN.lanes -> Type0 | [] | Hacl.Impl.Poly1305.Field32xN.precomp_r | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | w: Hacl.Spec.Poly1305.Field32xN.lanes -> Type0 | {
"end_col": 51,
"end_line": 28,
"start_col": 26,
"start_line": 28
} |
|
Prims.Tot | val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m | val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m = | false | null | false | felem_fits5 (as_tup5 h f) m | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"FStar.Monotonic.HyperStack.mem",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Hacl.Spec.Poly1305.Field32xN.scale32_5",
"Hacl.Spec.Poly1305.Field32xN.felem_fits5",
"Hacl.Impl.Poly1305.Field32xN.as_tup5"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 | [] | Hacl.Impl.Poly1305.Field32xN.felem_fits | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
h: FStar.Monotonic.HyperStack.mem ->
f: Hacl.Impl.Poly1305.Field32xN.felem w ->
m: Hacl.Spec.Poly1305.Field32xN.scale32_5
-> Type0 | {
"end_col": 29,
"end_line": 47,
"start_col": 2,
"start_line": 47
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let felem (w:lanes) = lbuffer (uint64xN w) 5ul | let felem (w: lanes) = | false | null | false | lbuffer (uint64xN w) 5ul | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Lib.Buffer.lbuffer",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"FStar.UInt32.__uint_to_t"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'" | false | true | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val felem : w: Hacl.Spec.Poly1305.Field32xN.lanes -> Type0 | [] | Hacl.Impl.Poly1305.Field32xN.felem | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | w: Hacl.Spec.Poly1305.Field32xN.lanes -> Type0 | {
"end_col": 46,
"end_line": 24,
"start_col": 22,
"start_line": 24
} |
|
Prims.GTot | val fas_nat (#w: lanes) (h: mem) (f: felem w) : GTot (LSeq.lseq nat w) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f) | val fas_nat (#w: lanes) (h: mem) (f: felem w) : GTot (LSeq.lseq nat w)
let fas_nat (#w: lanes) (h: mem) (f: felem w) : GTot (LSeq.lseq nat w) = | false | null | false | fas_nat5 (as_tup5 h f) | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [
"sometrivial"
] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"FStar.Monotonic.HyperStack.mem",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Hacl.Spec.Poly1305.Field32xN.fas_nat5",
"Hacl.Impl.Poly1305.Field32xN.as_tup5",
"Lib.Sequence.lseq",
"Prims.nat"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val fas_nat (#w: lanes) (h: mem) (f: felem w) : GTot (LSeq.lseq nat w) | [] | Hacl.Impl.Poly1305.Field32xN.fas_nat | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | h: FStar.Monotonic.HyperStack.mem -> f: Hacl.Impl.Poly1305.Field32xN.felem w
-> Prims.GTot (Lib.Sequence.lseq Prims.nat w) | {
"end_col": 24,
"end_line": 60,
"start_col": 2,
"start_line": 60
} |
Prims.Tot | val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m | val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m = | false | null | false | felem_wide_fits5 (as_tup5 h f) m | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"FStar.Monotonic.HyperStack.mem",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Hacl.Spec.Poly1305.Field32xN.scale32_5",
"Hacl.Spec.Poly1305.Field32xN.felem_wide_fits5",
"Hacl.Impl.Poly1305.Field32xN.as_tup5"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0 | [] | Hacl.Impl.Poly1305.Field32xN.felem_wide_fits | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
h: FStar.Monotonic.HyperStack.mem ->
f: Hacl.Impl.Poly1305.Field32xN.felem w ->
m: Hacl.Spec.Poly1305.Field32xN.scale32_5
-> Type0 | {
"end_col": 34,
"end_line": 52,
"start_col": 2,
"start_line": 52
} |
Prims.Tot | val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0 | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r) | val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp = | false | null | false | let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\ felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r) | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"FStar.Monotonic.HyperStack.mem",
"Hacl.Impl.Poly1305.Field32xN.precomp_r",
"Prims.l_and",
"Hacl.Impl.Poly1305.Field32xN.felem_fits",
"FStar.Pervasives.Native.Mktuple5",
"Prims.nat",
"Prims.eq2",
"Hacl.Spec.Poly1305.Field32xN.felem5",
"Hacl.Impl.Poly1305.Field32xN.as_tup5",
"Hacl.Spec.Poly1305.Field32xN.precomp_r5",
"Lib.Buffer.lbuffer_t",
"Lib.Buffer.MUT",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"FStar.UInt32.uint_to_t",
"FStar.UInt32.t",
"Lib.Buffer.gsub",
"FStar.UInt32.__uint_to_t"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0 | [] | Hacl.Impl.Poly1305.Field32xN.fmul_precomp_r_pre | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | h: FStar.Monotonic.HyperStack.mem -> precomp: Hacl.Impl.Poly1305.Field32xN.precomp_r w -> Type0 | {
"end_col": 43,
"end_line": 87,
"start_col": 37,
"start_line": 82
} |
Prims.GTot | val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4) | val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f = | false | null | false | let s = as_seq h f in
let s0 = s.[ 0 ] in
let s1 = s.[ 1 ] in
let s2 = s.[ 2 ] in
let s3 = s.[ 3 ] in
let s4 = s.[ 4 ] in
(s0, s1, s2, s3, s4) | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [
"sometrivial"
] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"FStar.Monotonic.HyperStack.mem",
"Hacl.Impl.Poly1305.Field32xN.felem",
"FStar.Pervasives.Native.Mktuple5",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"Prims.eq2",
"FStar.Seq.Base.index",
"Lib.Sequence.to_seq",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"FStar.UInt32.uint_to_t",
"FStar.UInt32.t",
"Hacl.Impl.Poly1305.Field32xN.op_String_Access",
"FStar.UInt32.__uint_to_t",
"Lib.Sequence.lseq",
"Lib.Buffer.as_seq",
"Lib.Buffer.MUT",
"Hacl.Spec.Poly1305.Field32xN.felem5"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w) | [] | Hacl.Impl.Poly1305.Field32xN.as_tup5 | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | h: FStar.Monotonic.HyperStack.mem -> f: Hacl.Impl.Poly1305.Field32xN.felem w
-> Prims.GTot (Hacl.Spec.Poly1305.Field32xN.felem5 w) | {
"end_col": 18,
"end_line": 42,
"start_col": 20,
"start_line": 35
} |
FStar.Pervasives.Lemma | val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f) | val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f = | false | null | true | lemma_feval_is_fas_nat (as_tup5 h f) | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [
"lemma"
] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"FStar.Monotonic.HyperStack.mem",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.lemma_feval_is_fas_nat",
"Hacl.Impl.Poly1305.Field32xN.as_tup5",
"Prims.unit"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i])) | [] | Hacl.Impl.Poly1305.Field32xN.lemma_feval_is_fas_nat | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | h: FStar.Monotonic.HyperStack.mem -> f: Hacl.Impl.Poly1305.Field32xN.felem w
-> FStar.Pervasives.Lemma (requires Hacl.Impl.Poly1305.Field32xN.felem_less h f (Prims.pow2 128))
(ensures
forall (i: Prims.nat).
i < w ==>
(Hacl.Impl.Poly1305.Field32xN.feval h f).[ i ] ==
(Hacl.Impl.Poly1305.Field32xN.fas_nat h f).[ i ]) | {
"end_col": 38,
"end_line": 74,
"start_col": 2,
"start_line": 74
} |
Prims.Tot | val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0 | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0] | val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p = | false | null | false | assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\ felem_fits h rn (2, 2, 2, 2, 2) /\ felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\ feval h rn == Vec.compute_rw (feval h r).[ 0 ] | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"FStar.Monotonic.HyperStack.mem",
"Hacl.Impl.Poly1305.Field32xN.precomp_r",
"Prims.l_and",
"Hacl.Impl.Poly1305.Field32xN.fmul_precomp_r_pre",
"Hacl.Impl.Poly1305.Field32xN.felem_fits",
"FStar.Pervasives.Native.Mktuple5",
"Prims.nat",
"Prims.eq2",
"Hacl.Spec.Poly1305.Field32xN.felem5",
"Hacl.Impl.Poly1305.Field32xN.as_tup5",
"Hacl.Spec.Poly1305.Field32xN.precomp_r5",
"Lib.Sequence.lseq",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Impl.Poly1305.Field32xN.feval",
"Hacl.Spec.Poly1305.Vec.compute_rw",
"Hacl.Impl.Poly1305.Field32xN.op_String_Access",
"Lib.Buffer.lbuffer_t",
"Lib.Buffer.MUT",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"FStar.UInt32.uint_to_t",
"FStar.UInt32.t",
"Lib.Buffer.gsub",
"FStar.UInt32.__uint_to_t",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.pow2",
"Hacl.Spec.Poly1305.Vec.prime"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0 | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0 | [] | Hacl.Impl.Poly1305.Field32xN.load_precompute_r_post | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | h: FStar.Monotonic.HyperStack.mem -> p: Hacl.Impl.Poly1305.Field32xN.precomp_r w -> Type0 | {
"end_col": 46,
"end_line": 104,
"start_col": 2,
"start_line": 96
} |
FStar.HyperStack.ST.StackInline | val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r | val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w = | true | null | false | let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Prims.unit",
"Lib.Sequence.eq_intro",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Impl.Poly1305.Field32xN.feval",
"Lib.Sequence.create",
"Hacl.Impl.Poly1305.Field32xN.felem",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Lib.Buffer.lbuffer_t",
"Lib.Buffer.MUT",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"FStar.UInt32.uint_to_t",
"FStar.UInt32.t",
"Lib.Buffer.create",
"FStar.UInt32.__uint_to_t",
"Hacl.Spec.Poly1305.Field32xN.zero",
"Lib.Buffer.lbuffer"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\ | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0) | [] | Hacl.Impl.Poly1305.Field32xN.create_felem | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | w: Hacl.Spec.Poly1305.Field32xN.lanes
-> FStar.HyperStack.ST.StackInline (Hacl.Impl.Poly1305.Field32xN.felem w) | {
"end_col": 3,
"end_line": 118,
"start_col": 20,
"start_line": 114
} |
FStar.HyperStack.ST.Stack | val uints64_from_felem_le:
#w:lanes
-> f:felem w
-> Stack (uint64 & uint64)
(requires fun h ->
live h f /\ felem_fits h f (1, 1, 1, 1, 1))
(ensures fun h0 (lo, hi) h1 -> h0 == h1 /\
v hi * pow2 64 + v lo == (fas_nat h0 f).[0] % pow2 128) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uints64_from_felem_le #w f =
let (f0, f1, f2, f3, f4) = (f.(0ul), f.(1ul), f.(2ul), f.(3ul), f.(4ul)) in
store_felem5 #w (f0, f1, f2, f3, f4) | val uints64_from_felem_le:
#w:lanes
-> f:felem w
-> Stack (uint64 & uint64)
(requires fun h ->
live h f /\ felem_fits h f (1, 1, 1, 1, 1))
(ensures fun h0 (lo, hi) h1 -> h0 == h1 /\
v hi * pow2 64 + v lo == (fas_nat h0 f).[0] % pow2 128)
let uints64_from_felem_le #w f = | true | null | false | let f0, f1, f2, f3, f4 = (f.(0ul), f.(1ul), f.(2ul), f.(3ul), f.(4ul)) in
store_felem5 #w (f0, f1, f2, f3, f4) | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"Hacl.Spec.Poly1305.Field32xN.store_felem5",
"FStar.Pervasives.Native.Mktuple5",
"FStar.Pervasives.Native.tuple2",
"Lib.IntTypes.uint64",
"FStar.Pervasives.Native.tuple5",
"Lib.Buffer.op_Array_Access",
"Lib.Buffer.MUT",
"FStar.UInt32.__uint_to_t"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
inline_for_extraction noextract
val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5
inline_for_extraction noextract
val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0])
let reduce_felem #w f =
let f0 = f.(0ul) in
let f1 = f.(1ul) in
let f2 = f.(2ul) in
let f3 = f.(3ul) in
let f4 = f.(4ul) in
let (f0, f1, f2, f3, f4) =
reduce_felem5 (f0, f1, f2, f3, f4) in
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
inline_for_extraction noextract
val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2))
let precompute_shift_reduce #w f1 f2 =
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
f1.(0ul) <- vec_smul_mod f20 (u64 5);
f1.(1ul) <- vec_smul_mod f21 (u64 5);
f1.(2ul) <- vec_smul_mod f22 (u64 5);
f1.(3ul) <- vec_smul_mod f23 (u64 5);
f1.(4ul) <- vec_smul_mod f24 (u64 5)
inline_for_extraction noextract
val load_felem:
#w:lanes
-> f:felem w
-> lo:uint64xN w
-> hi:uint64xN w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.createi #Vec.pfelem w
(fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i]))
let load_felem #w f lo hi =
let (f0, f1, f2, f3, f4) = load_felem5 #w lo hi in
load_felem5_lemma #w lo hi;
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
#push-options "--max_fuel 2"
inline_for_extraction noextract
val load_precompute_r1:
p:precomp_r 1
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r1 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 1 in
let r_vec1 = vec_load r1 1 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 1 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
copy_felem #_ #(1,1,1,1,1) rn r;
copy_felem #_ #(5,5,5,5,5) rn_5 r5
inline_for_extraction noextract
val load_precompute_r2:
p:precomp_r 2
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r2 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 2 in
let r_vec1 = vec_load r1 2 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 2 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
let h2 = ST.get () in
fmul_r rn r r r5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h2 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r4:
p:precomp_r 4
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r4 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 4 in
let r_vec1 = vec_load r1 4 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 4 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
fmul_r rn r r r5;
precompute_shift_reduce rn_5 rn;
fmul_r rn rn rn rn_5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h1 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r:
#w:lanes
-> p:precomp_r w
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post #w h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create w (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r #w p r0 r1 =
match w with
| 1 -> load_precompute_r1 p r0 r1
| 2 -> load_precompute_r2 p r0 r1
| 4 -> load_precompute_r4 p r0 r1
#pop-options
inline_for_extraction noextract
val load_felem1_le:
f:felem 1
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem1 (as_seq h0 b))
let load_felem1_le f b =
let h0 = ST.get () in
let lo = vec_load_le U64 1 (sub b 0ul 8ul) in
let hi = vec_load_le U64 1 (sub b 8ul 8ul) in
load_felem f lo hi;
let h1 = ST.get () in
uints_from_bytes_le_lemma64_1 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem1 (as_seq h0 b))
inline_for_extraction noextract
val load_felem2_le:
f:felem 2
-> b:lbuffer uint8 32ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem2 (as_seq h0 b))
let load_felem2_le f b =
let h0 = ST.get () in
let b1 = vec_load_le U64 2 (sub b 0ul 16ul) in
let b2 = vec_load_le U64 2 (sub b 16ul 16ul) in
let lo = vec_interleave_low b1 b2 in
let hi = vec_interleave_high b1 b2 in
load_felem f lo hi;
let h1 = ST.get () in
vec_interleave_low_lemma2 b1 b2;
vec_interleave_high_lemma2 b1 b2;
uints_from_bytes_le_lemma64_2 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem2 (as_seq h0 b))
inline_for_extraction noextract
val load_felem4_le:
f:felem 4
-> b:lbuffer uint8 64ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem4 (as_seq h0 b))
let load_felem4_le f b =
let h0 = ST.get () in
let lo = vec_load_le U64 4 (sub b 0ul 32ul) in
let hi = vec_load_le U64 4 (sub b 32ul 32ul) in
let (o0, o1, o2, o3, o4) = load_felem5_4 lo hi in
load_felem5_le (as_seq h0 b);
f.(0ul) <- o0;
f.(1ul) <- o1;
f.(2ul) <- o2;
f.(3ul) <- o3;
f.(4ul) <- o4
inline_for_extraction noextract
val load_felems_le:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 (size w *! 16ul)
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem (as_seq h0 b))
let load_felems_le #w f b =
match w with
| 1 -> load_felem1_le f b
| 2 -> load_felem2_le f b
| 4 -> load_felem4_le f b
inline_for_extraction noextract
val load_blocks:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 (size w *! 16ul)
-> Stack unit
(requires fun h ->
live h b /\ live h f /\ disjoint b f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == Vec.load_blocks #w (as_seq h0 b))
let load_blocks #s f b =
load_felems_le f b;
set_bit128 f
inline_for_extraction noextract
val load_felem_le:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.create w (BSeq.nat_from_bytes_le (as_seq h0 b)))
let load_felem_le #w f b =
let lo = uint_from_bytes_le #U64 (sub b 0ul 8ul) in
let hi = uint_from_bytes_le #U64 (sub b 8ul 8ul) in
let f0 = vec_load lo w in
let f1 = vec_load hi w in
let h0 = ST.get () in
load_felem f f0 f1;
let h1 = ST.get () in
uint_from_bytes_le_lemma (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (LSeq.create w (BSeq.nat_from_bytes_le (as_seq h0 b)))
inline_for_extraction noextract
val uints64_from_felem_le:
#w:lanes
-> f:felem w
-> Stack (uint64 & uint64)
(requires fun h ->
live h f /\ felem_fits h f (1, 1, 1, 1, 1))
(ensures fun h0 (lo, hi) h1 -> h0 == h1 /\ | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val uints64_from_felem_le:
#w:lanes
-> f:felem w
-> Stack (uint64 & uint64)
(requires fun h ->
live h f /\ felem_fits h f (1, 1, 1, 1, 1))
(ensures fun h0 (lo, hi) h1 -> h0 == h1 /\
v hi * pow2 64 + v lo == (fas_nat h0 f).[0] % pow2 128) | [] | Hacl.Impl.Poly1305.Field32xN.uints64_from_felem_le | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: Hacl.Impl.Poly1305.Field32xN.felem w
-> FStar.HyperStack.ST.Stack (Lib.IntTypes.uint64 * Lib.IntTypes.uint64) | {
"end_col": 38,
"end_line": 712,
"start_col": 32,
"start_line": 710
} |
FStar.HyperStack.ST.Stack | val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul) | val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 = | true | null | false | f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul) | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Spec.Poly1305.Field32xN.scale32_5",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Lib.Buffer.op_Array_Assignment",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"FStar.UInt32.__uint_to_t",
"Prims.unit",
"Lib.Buffer.op_Array_Access",
"Lib.Buffer.MUT"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2) | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2) | [] | Hacl.Impl.Poly1305.Field32xN.copy_felem | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f1: Hacl.Impl.Poly1305.Field32xN.felem w -> f2: Hacl.Impl.Poly1305.Field32xN.felem w
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 22,
"end_line": 206,
"start_col": 2,
"start_line": 202
} |
FStar.HyperStack.ST.Stack | val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul))) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5 | val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p = | true | null | false | let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5 | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Hacl.Impl.Poly1305.Field32xN.precomp_r",
"Hacl.Impl.Poly1305.Field32xN.fmul_r",
"Prims.unit",
"Lib.Buffer.lbuffer_t",
"Lib.Buffer.MUT",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"FStar.UInt32.uint_to_t",
"FStar.UInt32.t",
"Lib.Buffer.sub",
"FStar.UInt32.__uint_to_t"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
inline_for_extraction noextract
val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\ | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul))) | [] | Hacl.Impl.Poly1305.Field32xN.fmul_rn | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
out: Hacl.Impl.Poly1305.Field32xN.felem w ->
f1: Hacl.Impl.Poly1305.Field32xN.felem w ->
p: Hacl.Impl.Poly1305.Field32xN.precomp_r w
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 25,
"end_line": 369,
"start_col": 25,
"start_line": 366
} |
FStar.HyperStack.ST.Stack | val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2)) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let precompute_shift_reduce #w f1 f2 =
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
f1.(0ul) <- vec_smul_mod f20 (u64 5);
f1.(1ul) <- vec_smul_mod f21 (u64 5);
f1.(2ul) <- vec_smul_mod f22 (u64 5);
f1.(3ul) <- vec_smul_mod f23 (u64 5);
f1.(4ul) <- vec_smul_mod f24 (u64 5) | val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2))
let precompute_shift_reduce #w f1 f2 = | true | null | false | let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
f1.(0ul) <- vec_smul_mod f20 (u64 5);
f1.(1ul) <- vec_smul_mod f21 (u64 5);
f1.(2ul) <- vec_smul_mod f22 (u64 5);
f1.(3ul) <- vec_smul_mod f23 (u64 5);
f1.(4ul) <- vec_smul_mod f24 (u64 5) | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Lib.Buffer.op_Array_Assignment",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"FStar.UInt32.__uint_to_t",
"Lib.IntVector.vec_smul_mod",
"Lib.IntTypes.U64",
"Lib.IntTypes.u64",
"Prims.unit",
"Lib.Buffer.op_Array_Access",
"Lib.Buffer.MUT"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
inline_for_extraction noextract
val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5
inline_for_extraction noextract
val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0])
let reduce_felem #w f =
let f0 = f.(0ul) in
let f1 = f.(1ul) in
let f2 = f.(2ul) in
let f3 = f.(3ul) in
let f4 = f.(4ul) in
let (f0, f1, f2, f3, f4) =
reduce_felem5 (f0, f1, f2, f3, f4) in
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
inline_for_extraction noextract
val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\ | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2)) | [] | Hacl.Impl.Poly1305.Field32xN.precompute_shift_reduce | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f1: Hacl.Impl.Poly1305.Field32xN.felem w -> f2: Hacl.Impl.Poly1305.Field32xN.felem w
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 38,
"end_line": 416,
"start_col": 38,
"start_line": 406
} |
FStar.HyperStack.ST.Stack | val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0]) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let reduce_felem #w f =
let f0 = f.(0ul) in
let f1 = f.(1ul) in
let f2 = f.(2ul) in
let f3 = f.(3ul) in
let f4 = f.(4ul) in
let (f0, f1, f2, f3, f4) =
reduce_felem5 (f0, f1, f2, f3, f4) in
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4 | val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0])
let reduce_felem #w f = | true | null | false | let f0 = f.(0ul) in
let f1 = f.(1ul) in
let f2 = f.(2ul) in
let f3 = f.(3ul) in
let f4 = f.(4ul) in
let f0, f1, f2, f3, f4 = reduce_felem5 (f0, f1, f2, f3, f4) in
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4 | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"Lib.Buffer.op_Array_Assignment",
"FStar.UInt32.__uint_to_t",
"Prims.unit",
"Hacl.Spec.Poly1305.Field32xN.felem5",
"Hacl.Spec.Poly1305.Field32xN.reduce_felem5",
"FStar.Pervasives.Native.Mktuple5",
"Lib.Buffer.op_Array_Access",
"Lib.Buffer.MUT"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
inline_for_extraction noextract
val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5
inline_for_extraction noextract
val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\ | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0]) | [] | Hacl.Impl.Poly1305.Field32xN.reduce_felem | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: Hacl.Impl.Poly1305.Field32xN.felem w -> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 15,
"end_line": 394,
"start_col": 23,
"start_line": 382
} |
FStar.HyperStack.ST.Stack | val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2)) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4 | val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 = | true | null | false | let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let o0, o1, o2, o3, o4 = fadd5 #w (f10, f11, f12, f13, f14) (f20, f21, f22, f23, f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4 | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"Lib.Buffer.op_Array_Assignment",
"FStar.UInt32.__uint_to_t",
"Prims.unit",
"Hacl.Spec.Poly1305.Field32xN.felem5",
"Hacl.Spec.Poly1305.Field32xN.fadd5",
"FStar.Pervasives.Native.Mktuple5",
"Lib.Buffer.op_Array_Access",
"Lib.Buffer.MUT"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\ | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2)) | [] | Hacl.Impl.Poly1305.Field32xN.fadd | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
out: Hacl.Impl.Poly1305.Field32xN.felem w ->
f1: Hacl.Impl.Poly1305.Field32xN.felem w ->
f2: Hacl.Impl.Poly1305.Field32xN.felem w
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 17,
"end_line": 241,
"start_col": 23,
"start_line": 224
} |
FStar.HyperStack.ST.Stack | val load_blocks:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 (size w *! 16ul)
-> Stack unit
(requires fun h ->
live h b /\ live h f /\ disjoint b f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == Vec.load_blocks #w (as_seq h0 b)) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_blocks #s f b =
load_felems_le f b;
set_bit128 f | val load_blocks:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 (size w *! 16ul)
-> Stack unit
(requires fun h ->
live h b /\ live h f /\ disjoint b f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == Vec.load_blocks #w (as_seq h0 b))
let load_blocks #s f b = | true | null | false | load_felems_le f b;
set_bit128 f | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint8",
"Lib.IntTypes.op_Star_Bang",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Lib.IntTypes.size",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.Poly1305.Field32xN.set_bit128",
"Prims.unit",
"Hacl.Impl.Poly1305.Field32xN.load_felems_le"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
inline_for_extraction noextract
val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5
inline_for_extraction noextract
val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0])
let reduce_felem #w f =
let f0 = f.(0ul) in
let f1 = f.(1ul) in
let f2 = f.(2ul) in
let f3 = f.(3ul) in
let f4 = f.(4ul) in
let (f0, f1, f2, f3, f4) =
reduce_felem5 (f0, f1, f2, f3, f4) in
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
inline_for_extraction noextract
val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2))
let precompute_shift_reduce #w f1 f2 =
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
f1.(0ul) <- vec_smul_mod f20 (u64 5);
f1.(1ul) <- vec_smul_mod f21 (u64 5);
f1.(2ul) <- vec_smul_mod f22 (u64 5);
f1.(3ul) <- vec_smul_mod f23 (u64 5);
f1.(4ul) <- vec_smul_mod f24 (u64 5)
inline_for_extraction noextract
val load_felem:
#w:lanes
-> f:felem w
-> lo:uint64xN w
-> hi:uint64xN w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.createi #Vec.pfelem w
(fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i]))
let load_felem #w f lo hi =
let (f0, f1, f2, f3, f4) = load_felem5 #w lo hi in
load_felem5_lemma #w lo hi;
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
#push-options "--max_fuel 2"
inline_for_extraction noextract
val load_precompute_r1:
p:precomp_r 1
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r1 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 1 in
let r_vec1 = vec_load r1 1 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 1 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
copy_felem #_ #(1,1,1,1,1) rn r;
copy_felem #_ #(5,5,5,5,5) rn_5 r5
inline_for_extraction noextract
val load_precompute_r2:
p:precomp_r 2
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r2 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 2 in
let r_vec1 = vec_load r1 2 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 2 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
let h2 = ST.get () in
fmul_r rn r r r5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h2 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r4:
p:precomp_r 4
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r4 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 4 in
let r_vec1 = vec_load r1 4 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 4 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
fmul_r rn r r r5;
precompute_shift_reduce rn_5 rn;
fmul_r rn rn rn rn_5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h1 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r:
#w:lanes
-> p:precomp_r w
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post #w h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create w (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r #w p r0 r1 =
match w with
| 1 -> load_precompute_r1 p r0 r1
| 2 -> load_precompute_r2 p r0 r1
| 4 -> load_precompute_r4 p r0 r1
#pop-options
inline_for_extraction noextract
val load_felem1_le:
f:felem 1
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem1 (as_seq h0 b))
let load_felem1_le f b =
let h0 = ST.get () in
let lo = vec_load_le U64 1 (sub b 0ul 8ul) in
let hi = vec_load_le U64 1 (sub b 8ul 8ul) in
load_felem f lo hi;
let h1 = ST.get () in
uints_from_bytes_le_lemma64_1 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem1 (as_seq h0 b))
inline_for_extraction noextract
val load_felem2_le:
f:felem 2
-> b:lbuffer uint8 32ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem2 (as_seq h0 b))
let load_felem2_le f b =
let h0 = ST.get () in
let b1 = vec_load_le U64 2 (sub b 0ul 16ul) in
let b2 = vec_load_le U64 2 (sub b 16ul 16ul) in
let lo = vec_interleave_low b1 b2 in
let hi = vec_interleave_high b1 b2 in
load_felem f lo hi;
let h1 = ST.get () in
vec_interleave_low_lemma2 b1 b2;
vec_interleave_high_lemma2 b1 b2;
uints_from_bytes_le_lemma64_2 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem2 (as_seq h0 b))
inline_for_extraction noextract
val load_felem4_le:
f:felem 4
-> b:lbuffer uint8 64ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem4 (as_seq h0 b))
let load_felem4_le f b =
let h0 = ST.get () in
let lo = vec_load_le U64 4 (sub b 0ul 32ul) in
let hi = vec_load_le U64 4 (sub b 32ul 32ul) in
let (o0, o1, o2, o3, o4) = load_felem5_4 lo hi in
load_felem5_le (as_seq h0 b);
f.(0ul) <- o0;
f.(1ul) <- o1;
f.(2ul) <- o2;
f.(3ul) <- o3;
f.(4ul) <- o4
inline_for_extraction noextract
val load_felems_le:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 (size w *! 16ul)
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem (as_seq h0 b))
let load_felems_le #w f b =
match w with
| 1 -> load_felem1_le f b
| 2 -> load_felem2_le f b
| 4 -> load_felem4_le f b
inline_for_extraction noextract
val load_blocks:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 (size w *! 16ul)
-> Stack unit
(requires fun h ->
live h b /\ live h f /\ disjoint b f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == Vec.load_blocks #w (as_seq h0 b)) | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_blocks:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 (size w *! 16ul)
-> Stack unit
(requires fun h ->
live h b /\ live h f /\ disjoint b f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == Vec.load_blocks #w (as_seq h0 b)) | [] | Hacl.Impl.Poly1305.Field32xN.load_blocks | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
f: Hacl.Impl.Poly1305.Field32xN.felem w ->
b: Lib.Buffer.lbuffer Lib.IntTypes.uint8 (Lib.IntTypes.size w *! 16ul)
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 14,
"end_line": 675,
"start_col": 2,
"start_line": 674
} |
FStar.HyperStack.ST.Stack | val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f)) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128 | val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f = | true | null | false | let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128 | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.set_bit5_lemma",
"Lib.Buffer.as_seq",
"Lib.Buffer.MUT",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"FStar.UInt32.__uint_to_t",
"Prims.unit",
"Lib.Buffer.op_Array_Assignment",
"Lib.IntVector.vec_or",
"Lib.IntTypes.U64",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Lib.Buffer.op_Array_Access",
"Lib.IntVector.vec_t",
"Prims.eq2",
"Lib.Sequence.lseq",
"Lib.IntTypes.int_t",
"Lib.IntTypes.SEC",
"Lib.IntVector.vec_v",
"Lib.Sequence.create",
"Lib.IntVector.vec_load",
"Prims._assert",
"Lib.IntTypes.range_t",
"Lib.IntTypes.v",
"Lib.IntTypes.op_Less_Less_Dot",
"Lib.IntTypes.u64",
"FStar.Pervasives.assert_norm",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.pow2",
"Lib.IntTypes.range"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\ | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f)) | [] | Hacl.Impl.Poly1305.Field32xN.set_bit128 | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: Hacl.Impl.Poly1305.Field32xN.felem w -> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 34,
"end_line": 166,
"start_col": 21,
"start_line": 158
} |
FStar.HyperStack.ST.Stack | val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0) | val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f = | true | null | false | f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0) | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Lib.Sequence.eq_intro",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Impl.Poly1305.Field32xN.feval",
"Lib.Sequence.create",
"Prims.unit",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Lib.Buffer.op_Array_Assignment",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"FStar.UInt32.__uint_to_t",
"Hacl.Spec.Poly1305.Field32xN.zero"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0) | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0) | [] | Hacl.Impl.Poly1305.Field32xN.set_zero | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: Hacl.Impl.Poly1305.Field32xN.felem w -> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 46,
"end_line": 185,
"start_col": 2,
"start_line": 179
} |
FStar.HyperStack.ST.Stack | val load_felem4_le:
f:felem 4
-> b:lbuffer uint8 64ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem4 (as_seq h0 b)) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_felem4_le f b =
let h0 = ST.get () in
let lo = vec_load_le U64 4 (sub b 0ul 32ul) in
let hi = vec_load_le U64 4 (sub b 32ul 32ul) in
let (o0, o1, o2, o3, o4) = load_felem5_4 lo hi in
load_felem5_le (as_seq h0 b);
f.(0ul) <- o0;
f.(1ul) <- o1;
f.(2ul) <- o2;
f.(3ul) <- o3;
f.(4ul) <- o4 | val load_felem4_le:
f:felem 4
-> b:lbuffer uint8 64ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem4 (as_seq h0 b))
let load_felem4_le f b = | true | null | false | let h0 = ST.get () in
let lo = vec_load_le U64 4 (sub b 0ul 32ul) in
let hi = vec_load_le U64 4 (sub b 32ul 32ul) in
let o0, o1, o2, o3, o4 = load_felem5_4 lo hi in
load_felem5_le (as_seq h0 b);
f.(0ul) <- o0;
f.(1ul) <- o1;
f.(2ul) <- o2;
f.(3ul) <- o3;
f.(4ul) <- o4 | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Impl.Poly1305.Field32xN.felem",
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint8",
"FStar.UInt32.__uint_to_t",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"Lib.Buffer.op_Array_Assignment",
"Prims.unit",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.load_felem5_le",
"Lib.Buffer.as_seq",
"Lib.Buffer.MUT",
"Hacl.Spec.Poly1305.Field32xN.felem5",
"Hacl.Spec.Poly1305.Field32xN.load_felem5_4",
"Lib.IntVector.vec_t",
"Lib.IntTypes.U64",
"Lib.IntVector.vec_load_le",
"Lib.Buffer.lbuffer_t",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Lib.IntTypes.mul",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Lib.IntTypes.mk_int",
"Lib.Buffer.sub",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
inline_for_extraction noextract
val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5
inline_for_extraction noextract
val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0])
let reduce_felem #w f =
let f0 = f.(0ul) in
let f1 = f.(1ul) in
let f2 = f.(2ul) in
let f3 = f.(3ul) in
let f4 = f.(4ul) in
let (f0, f1, f2, f3, f4) =
reduce_felem5 (f0, f1, f2, f3, f4) in
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
inline_for_extraction noextract
val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2))
let precompute_shift_reduce #w f1 f2 =
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
f1.(0ul) <- vec_smul_mod f20 (u64 5);
f1.(1ul) <- vec_smul_mod f21 (u64 5);
f1.(2ul) <- vec_smul_mod f22 (u64 5);
f1.(3ul) <- vec_smul_mod f23 (u64 5);
f1.(4ul) <- vec_smul_mod f24 (u64 5)
inline_for_extraction noextract
val load_felem:
#w:lanes
-> f:felem w
-> lo:uint64xN w
-> hi:uint64xN w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.createi #Vec.pfelem w
(fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i]))
let load_felem #w f lo hi =
let (f0, f1, f2, f3, f4) = load_felem5 #w lo hi in
load_felem5_lemma #w lo hi;
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
#push-options "--max_fuel 2"
inline_for_extraction noextract
val load_precompute_r1:
p:precomp_r 1
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r1 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 1 in
let r_vec1 = vec_load r1 1 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 1 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
copy_felem #_ #(1,1,1,1,1) rn r;
copy_felem #_ #(5,5,5,5,5) rn_5 r5
inline_for_extraction noextract
val load_precompute_r2:
p:precomp_r 2
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r2 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 2 in
let r_vec1 = vec_load r1 2 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 2 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
let h2 = ST.get () in
fmul_r rn r r r5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h2 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r4:
p:precomp_r 4
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r4 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 4 in
let r_vec1 = vec_load r1 4 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 4 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
fmul_r rn r r r5;
precompute_shift_reduce rn_5 rn;
fmul_r rn rn rn rn_5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h1 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r:
#w:lanes
-> p:precomp_r w
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post #w h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create w (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r #w p r0 r1 =
match w with
| 1 -> load_precompute_r1 p r0 r1
| 2 -> load_precompute_r2 p r0 r1
| 4 -> load_precompute_r4 p r0 r1
#pop-options
inline_for_extraction noextract
val load_felem1_le:
f:felem 1
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem1 (as_seq h0 b))
let load_felem1_le f b =
let h0 = ST.get () in
let lo = vec_load_le U64 1 (sub b 0ul 8ul) in
let hi = vec_load_le U64 1 (sub b 8ul 8ul) in
load_felem f lo hi;
let h1 = ST.get () in
uints_from_bytes_le_lemma64_1 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem1 (as_seq h0 b))
inline_for_extraction noextract
val load_felem2_le:
f:felem 2
-> b:lbuffer uint8 32ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem2 (as_seq h0 b))
let load_felem2_le f b =
let h0 = ST.get () in
let b1 = vec_load_le U64 2 (sub b 0ul 16ul) in
let b2 = vec_load_le U64 2 (sub b 16ul 16ul) in
let lo = vec_interleave_low b1 b2 in
let hi = vec_interleave_high b1 b2 in
load_felem f lo hi;
let h1 = ST.get () in
vec_interleave_low_lemma2 b1 b2;
vec_interleave_high_lemma2 b1 b2;
uints_from_bytes_le_lemma64_2 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem2 (as_seq h0 b))
inline_for_extraction noextract
val load_felem4_le:
f:felem 4
-> b:lbuffer uint8 64ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\ | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_felem4_le:
f:felem 4
-> b:lbuffer uint8 64ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem4 (as_seq h0 b)) | [] | Hacl.Impl.Poly1305.Field32xN.load_felem4_le | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: Hacl.Impl.Poly1305.Field32xN.felem 4 -> b: Lib.Buffer.lbuffer Lib.IntTypes.uint8 64ul
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 15,
"end_line": 640,
"start_col": 24,
"start_line": 630
} |
FStar.HyperStack.ST.Stack | val load_felem1_le:
f:felem 1
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem1 (as_seq h0 b)) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_felem1_le f b =
let h0 = ST.get () in
let lo = vec_load_le U64 1 (sub b 0ul 8ul) in
let hi = vec_load_le U64 1 (sub b 8ul 8ul) in
load_felem f lo hi;
let h1 = ST.get () in
uints_from_bytes_le_lemma64_1 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem1 (as_seq h0 b)) | val load_felem1_le:
f:felem 1
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem1 (as_seq h0 b))
let load_felem1_le f b = | true | null | false | let h0 = ST.get () in
let lo = vec_load_le U64 1 (sub b 0ul 8ul) in
let hi = vec_load_le U64 1 (sub b 8ul 8ul) in
load_felem f lo hi;
let h1 = ST.get () in
uints_from_bytes_le_lemma64_1 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem1 (as_seq h0 b)) | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Impl.Poly1305.Field32xN.felem",
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint8",
"FStar.UInt32.__uint_to_t",
"Lib.Sequence.eq_intro",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Impl.Poly1305.Field32xN.feval",
"Hacl.Spec.Poly1305.Vec.load_elem1",
"Lib.Buffer.as_seq",
"Lib.Buffer.MUT",
"Prims.unit",
"Hacl.Impl.Poly1305.Lemmas.uints_from_bytes_le_lemma64_1",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Hacl.Impl.Poly1305.Field32xN.load_felem",
"Lib.IntVector.vec_t",
"Lib.IntTypes.U64",
"Lib.IntVector.vec_load_le",
"Lib.Buffer.lbuffer_t",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Lib.IntTypes.mul",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Lib.IntTypes.mk_int",
"Lib.Buffer.sub"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
inline_for_extraction noextract
val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5
inline_for_extraction noextract
val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0])
let reduce_felem #w f =
let f0 = f.(0ul) in
let f1 = f.(1ul) in
let f2 = f.(2ul) in
let f3 = f.(3ul) in
let f4 = f.(4ul) in
let (f0, f1, f2, f3, f4) =
reduce_felem5 (f0, f1, f2, f3, f4) in
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
inline_for_extraction noextract
val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2))
let precompute_shift_reduce #w f1 f2 =
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
f1.(0ul) <- vec_smul_mod f20 (u64 5);
f1.(1ul) <- vec_smul_mod f21 (u64 5);
f1.(2ul) <- vec_smul_mod f22 (u64 5);
f1.(3ul) <- vec_smul_mod f23 (u64 5);
f1.(4ul) <- vec_smul_mod f24 (u64 5)
inline_for_extraction noextract
val load_felem:
#w:lanes
-> f:felem w
-> lo:uint64xN w
-> hi:uint64xN w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.createi #Vec.pfelem w
(fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i]))
let load_felem #w f lo hi =
let (f0, f1, f2, f3, f4) = load_felem5 #w lo hi in
load_felem5_lemma #w lo hi;
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
#push-options "--max_fuel 2"
inline_for_extraction noextract
val load_precompute_r1:
p:precomp_r 1
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r1 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 1 in
let r_vec1 = vec_load r1 1 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 1 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
copy_felem #_ #(1,1,1,1,1) rn r;
copy_felem #_ #(5,5,5,5,5) rn_5 r5
inline_for_extraction noextract
val load_precompute_r2:
p:precomp_r 2
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r2 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 2 in
let r_vec1 = vec_load r1 2 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 2 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
let h2 = ST.get () in
fmul_r rn r r r5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h2 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r4:
p:precomp_r 4
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r4 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 4 in
let r_vec1 = vec_load r1 4 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 4 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
fmul_r rn r r r5;
precompute_shift_reduce rn_5 rn;
fmul_r rn rn rn rn_5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h1 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r:
#w:lanes
-> p:precomp_r w
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post #w h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create w (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r #w p r0 r1 =
match w with
| 1 -> load_precompute_r1 p r0 r1
| 2 -> load_precompute_r2 p r0 r1
| 4 -> load_precompute_r4 p r0 r1
#pop-options
inline_for_extraction noextract
val load_felem1_le:
f:felem 1
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\ | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_felem1_le:
f:felem 1
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem1 (as_seq h0 b)) | [] | Hacl.Impl.Poly1305.Field32xN.load_felem1_le | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: Hacl.Impl.Poly1305.Field32xN.felem 1 -> b: Lib.Buffer.lbuffer Lib.IntTypes.uint8 16ul
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 59,
"end_line": 593,
"start_col": 24,
"start_line": 585
} |
FStar.HyperStack.ST.Stack | val load_felems_le:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 (size w *! 16ul)
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem (as_seq h0 b)) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_felems_le #w f b =
match w with
| 1 -> load_felem1_le f b
| 2 -> load_felem2_le f b
| 4 -> load_felem4_le f b | val load_felems_le:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 (size w *! 16ul)
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem (as_seq h0 b))
let load_felems_le #w f b = | true | null | false | match w with
| 1 -> load_felem1_le f b
| 2 -> load_felem2_le f b
| 4 -> load_felem4_le f b | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint8",
"Lib.IntTypes.op_Star_Bang",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Lib.IntTypes.size",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.Poly1305.Field32xN.load_felem1_le",
"Prims.unit",
"Hacl.Impl.Poly1305.Field32xN.load_felem2_le",
"Hacl.Impl.Poly1305.Field32xN.load_felem4_le"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
inline_for_extraction noextract
val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5
inline_for_extraction noextract
val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0])
let reduce_felem #w f =
let f0 = f.(0ul) in
let f1 = f.(1ul) in
let f2 = f.(2ul) in
let f3 = f.(3ul) in
let f4 = f.(4ul) in
let (f0, f1, f2, f3, f4) =
reduce_felem5 (f0, f1, f2, f3, f4) in
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
inline_for_extraction noextract
val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2))
let precompute_shift_reduce #w f1 f2 =
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
f1.(0ul) <- vec_smul_mod f20 (u64 5);
f1.(1ul) <- vec_smul_mod f21 (u64 5);
f1.(2ul) <- vec_smul_mod f22 (u64 5);
f1.(3ul) <- vec_smul_mod f23 (u64 5);
f1.(4ul) <- vec_smul_mod f24 (u64 5)
inline_for_extraction noextract
val load_felem:
#w:lanes
-> f:felem w
-> lo:uint64xN w
-> hi:uint64xN w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.createi #Vec.pfelem w
(fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i]))
let load_felem #w f lo hi =
let (f0, f1, f2, f3, f4) = load_felem5 #w lo hi in
load_felem5_lemma #w lo hi;
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
#push-options "--max_fuel 2"
inline_for_extraction noextract
val load_precompute_r1:
p:precomp_r 1
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r1 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 1 in
let r_vec1 = vec_load r1 1 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 1 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
copy_felem #_ #(1,1,1,1,1) rn r;
copy_felem #_ #(5,5,5,5,5) rn_5 r5
inline_for_extraction noextract
val load_precompute_r2:
p:precomp_r 2
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r2 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 2 in
let r_vec1 = vec_load r1 2 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 2 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
let h2 = ST.get () in
fmul_r rn r r r5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h2 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r4:
p:precomp_r 4
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r4 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 4 in
let r_vec1 = vec_load r1 4 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 4 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
fmul_r rn r r r5;
precompute_shift_reduce rn_5 rn;
fmul_r rn rn rn rn_5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h1 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r:
#w:lanes
-> p:precomp_r w
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post #w h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create w (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r #w p r0 r1 =
match w with
| 1 -> load_precompute_r1 p r0 r1
| 2 -> load_precompute_r2 p r0 r1
| 4 -> load_precompute_r4 p r0 r1
#pop-options
inline_for_extraction noextract
val load_felem1_le:
f:felem 1
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem1 (as_seq h0 b))
let load_felem1_le f b =
let h0 = ST.get () in
let lo = vec_load_le U64 1 (sub b 0ul 8ul) in
let hi = vec_load_le U64 1 (sub b 8ul 8ul) in
load_felem f lo hi;
let h1 = ST.get () in
uints_from_bytes_le_lemma64_1 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem1 (as_seq h0 b))
inline_for_extraction noextract
val load_felem2_le:
f:felem 2
-> b:lbuffer uint8 32ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem2 (as_seq h0 b))
let load_felem2_le f b =
let h0 = ST.get () in
let b1 = vec_load_le U64 2 (sub b 0ul 16ul) in
let b2 = vec_load_le U64 2 (sub b 16ul 16ul) in
let lo = vec_interleave_low b1 b2 in
let hi = vec_interleave_high b1 b2 in
load_felem f lo hi;
let h1 = ST.get () in
vec_interleave_low_lemma2 b1 b2;
vec_interleave_high_lemma2 b1 b2;
uints_from_bytes_le_lemma64_2 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem2 (as_seq h0 b))
inline_for_extraction noextract
val load_felem4_le:
f:felem 4
-> b:lbuffer uint8 64ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem4 (as_seq h0 b))
let load_felem4_le f b =
let h0 = ST.get () in
let lo = vec_load_le U64 4 (sub b 0ul 32ul) in
let hi = vec_load_le U64 4 (sub b 32ul 32ul) in
let (o0, o1, o2, o3, o4) = load_felem5_4 lo hi in
load_felem5_le (as_seq h0 b);
f.(0ul) <- o0;
f.(1ul) <- o1;
f.(2ul) <- o2;
f.(3ul) <- o3;
f.(4ul) <- o4
inline_for_extraction noextract
val load_felems_le:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 (size w *! 16ul)
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem (as_seq h0 b)) | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_felems_le:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 (size w *! 16ul)
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem (as_seq h0 b)) | [] | Hacl.Impl.Poly1305.Field32xN.load_felems_le | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
f: Hacl.Impl.Poly1305.Field32xN.felem w ->
b: Lib.Buffer.lbuffer Lib.IntTypes.uint8 (Lib.IntTypes.size w *! 16ul)
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 27,
"end_line": 659,
"start_col": 2,
"start_line": 656
} |
FStar.HyperStack.ST.Stack | val load_precompute_r:
#w:lanes
-> p:precomp_r w
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post #w h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create w (uint_v r1 * pow2 64 + uint_v r0))) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_precompute_r #w p r0 r1 =
match w with
| 1 -> load_precompute_r1 p r0 r1
| 2 -> load_precompute_r2 p r0 r1
| 4 -> load_precompute_r4 p r0 r1 | val load_precompute_r:
#w:lanes
-> p:precomp_r w
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post #w h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create w (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r #w p r0 r1 = | true | null | false | match w with
| 1 -> load_precompute_r1 p r0 r1
| 2 -> load_precompute_r2 p r0 r1
| 4 -> load_precompute_r4 p r0 r1 | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.precomp_r",
"Lib.IntTypes.uint64",
"Hacl.Impl.Poly1305.Field32xN.load_precompute_r1",
"Prims.unit",
"Hacl.Impl.Poly1305.Field32xN.load_precompute_r2",
"Hacl.Impl.Poly1305.Field32xN.load_precompute_r4"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
inline_for_extraction noextract
val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5
inline_for_extraction noextract
val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0])
let reduce_felem #w f =
let f0 = f.(0ul) in
let f1 = f.(1ul) in
let f2 = f.(2ul) in
let f3 = f.(3ul) in
let f4 = f.(4ul) in
let (f0, f1, f2, f3, f4) =
reduce_felem5 (f0, f1, f2, f3, f4) in
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
inline_for_extraction noextract
val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2))
let precompute_shift_reduce #w f1 f2 =
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
f1.(0ul) <- vec_smul_mod f20 (u64 5);
f1.(1ul) <- vec_smul_mod f21 (u64 5);
f1.(2ul) <- vec_smul_mod f22 (u64 5);
f1.(3ul) <- vec_smul_mod f23 (u64 5);
f1.(4ul) <- vec_smul_mod f24 (u64 5)
inline_for_extraction noextract
val load_felem:
#w:lanes
-> f:felem w
-> lo:uint64xN w
-> hi:uint64xN w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.createi #Vec.pfelem w
(fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i]))
let load_felem #w f lo hi =
let (f0, f1, f2, f3, f4) = load_felem5 #w lo hi in
load_felem5_lemma #w lo hi;
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
#push-options "--max_fuel 2"
inline_for_extraction noextract
val load_precompute_r1:
p:precomp_r 1
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r1 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 1 in
let r_vec1 = vec_load r1 1 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 1 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
copy_felem #_ #(1,1,1,1,1) rn r;
copy_felem #_ #(5,5,5,5,5) rn_5 r5
inline_for_extraction noextract
val load_precompute_r2:
p:precomp_r 2
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r2 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 2 in
let r_vec1 = vec_load r1 2 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 2 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
let h2 = ST.get () in
fmul_r rn r r r5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h2 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r4:
p:precomp_r 4
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r4 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 4 in
let r_vec1 = vec_load r1 4 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 4 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
fmul_r rn r r r5;
precompute_shift_reduce rn_5 rn;
fmul_r rn rn rn rn_5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h1 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r:
#w:lanes
-> p:precomp_r w
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post #w h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create w (uint_v r1 * pow2 64 + uint_v r0))) | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 2,
"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"
} | null | val load_precompute_r:
#w:lanes
-> p:precomp_r w
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post #w h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create w (uint_v r1 * pow2 64 + uint_v r0))) | [] | Hacl.Impl.Poly1305.Field32xN.load_precompute_r | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | p: Hacl.Impl.Poly1305.Field32xN.precomp_r w -> r0: Lib.IntTypes.uint64 -> r1: Lib.IntTypes.uint64
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 35,
"end_line": 570,
"start_col": 2,
"start_line": 567
} |
FStar.HyperStack.ST.Stack | val load_felem:
#w:lanes
-> f:felem w
-> lo:uint64xN w
-> hi:uint64xN w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.createi #Vec.pfelem w
(fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i])) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_felem #w f lo hi =
let (f0, f1, f2, f3, f4) = load_felem5 #w lo hi in
load_felem5_lemma #w lo hi;
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4 | val load_felem:
#w:lanes
-> f:felem w
-> lo:uint64xN w
-> hi:uint64xN w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.createi #Vec.pfelem w
(fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i]))
let load_felem #w f lo hi = | true | null | false | let f0, f1, f2, f3, f4 = load_felem5 #w lo hi in
load_felem5_lemma #w lo hi;
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4 | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"Lib.Buffer.op_Array_Assignment",
"FStar.UInt32.__uint_to_t",
"Prims.unit",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.load_felem5_lemma",
"Hacl.Spec.Poly1305.Field32xN.felem5",
"Hacl.Spec.Poly1305.Field32xN.load_felem5"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
inline_for_extraction noextract
val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5
inline_for_extraction noextract
val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0])
let reduce_felem #w f =
let f0 = f.(0ul) in
let f1 = f.(1ul) in
let f2 = f.(2ul) in
let f3 = f.(3ul) in
let f4 = f.(4ul) in
let (f0, f1, f2, f3, f4) =
reduce_felem5 (f0, f1, f2, f3, f4) in
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
inline_for_extraction noextract
val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2))
let precompute_shift_reduce #w f1 f2 =
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
f1.(0ul) <- vec_smul_mod f20 (u64 5);
f1.(1ul) <- vec_smul_mod f21 (u64 5);
f1.(2ul) <- vec_smul_mod f22 (u64 5);
f1.(3ul) <- vec_smul_mod f23 (u64 5);
f1.(4ul) <- vec_smul_mod f24 (u64 5)
inline_for_extraction noextract
val load_felem:
#w:lanes
-> f:felem w
-> lo:uint64xN w
-> hi:uint64xN w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.createi #Vec.pfelem w | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_felem:
#w:lanes
-> f:felem w
-> lo:uint64xN w
-> hi:uint64xN w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.createi #Vec.pfelem w
(fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i])) | [] | Hacl.Impl.Poly1305.Field32xN.load_felem | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
f: Hacl.Impl.Poly1305.Field32xN.felem w ->
lo: Hacl.Spec.Poly1305.Field32xN.uint64xN w ->
hi: Hacl.Spec.Poly1305.Field32xN.uint64xN w
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 15,
"end_line": 439,
"start_col": 27,
"start_line": 432
} |
FStar.HyperStack.ST.Stack | val load_felem2_le:
f:felem 2
-> b:lbuffer uint8 32ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem2 (as_seq h0 b)) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_felem2_le f b =
let h0 = ST.get () in
let b1 = vec_load_le U64 2 (sub b 0ul 16ul) in
let b2 = vec_load_le U64 2 (sub b 16ul 16ul) in
let lo = vec_interleave_low b1 b2 in
let hi = vec_interleave_high b1 b2 in
load_felem f lo hi;
let h1 = ST.get () in
vec_interleave_low_lemma2 b1 b2;
vec_interleave_high_lemma2 b1 b2;
uints_from_bytes_le_lemma64_2 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem2 (as_seq h0 b)) | val load_felem2_le:
f:felem 2
-> b:lbuffer uint8 32ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem2 (as_seq h0 b))
let load_felem2_le f b = | true | null | false | let h0 = ST.get () in
let b1 = vec_load_le U64 2 (sub b 0ul 16ul) in
let b2 = vec_load_le U64 2 (sub b 16ul 16ul) in
let lo = vec_interleave_low b1 b2 in
let hi = vec_interleave_high b1 b2 in
load_felem f lo hi;
let h1 = ST.get () in
vec_interleave_low_lemma2 b1 b2;
vec_interleave_high_lemma2 b1 b2;
uints_from_bytes_le_lemma64_2 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem2 (as_seq h0 b)) | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Impl.Poly1305.Field32xN.felem",
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint8",
"FStar.UInt32.__uint_to_t",
"Lib.Sequence.eq_intro",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Impl.Poly1305.Field32xN.feval",
"Hacl.Spec.Poly1305.Vec.load_elem2",
"Lib.Buffer.as_seq",
"Lib.Buffer.MUT",
"Prims.unit",
"Hacl.Impl.Poly1305.Lemmas.uints_from_bytes_le_lemma64_2",
"Lib.IntVector.vec_interleave_high_lemma2",
"Lib.IntTypes.U64",
"Lib.IntVector.vec_interleave_low_lemma2",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Hacl.Impl.Poly1305.Field32xN.load_felem",
"Lib.IntVector.vec_t",
"Lib.IntVector.vec_interleave_high",
"Lib.IntVector.vec_interleave_low",
"Lib.IntVector.vec_load_le",
"Lib.Buffer.lbuffer_t",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Lib.IntTypes.mul",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Lib.IntTypes.mk_int",
"Lib.Buffer.sub"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
inline_for_extraction noextract
val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5
inline_for_extraction noextract
val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0])
let reduce_felem #w f =
let f0 = f.(0ul) in
let f1 = f.(1ul) in
let f2 = f.(2ul) in
let f3 = f.(3ul) in
let f4 = f.(4ul) in
let (f0, f1, f2, f3, f4) =
reduce_felem5 (f0, f1, f2, f3, f4) in
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
inline_for_extraction noextract
val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2))
let precompute_shift_reduce #w f1 f2 =
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
f1.(0ul) <- vec_smul_mod f20 (u64 5);
f1.(1ul) <- vec_smul_mod f21 (u64 5);
f1.(2ul) <- vec_smul_mod f22 (u64 5);
f1.(3ul) <- vec_smul_mod f23 (u64 5);
f1.(4ul) <- vec_smul_mod f24 (u64 5)
inline_for_extraction noextract
val load_felem:
#w:lanes
-> f:felem w
-> lo:uint64xN w
-> hi:uint64xN w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.createi #Vec.pfelem w
(fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i]))
let load_felem #w f lo hi =
let (f0, f1, f2, f3, f4) = load_felem5 #w lo hi in
load_felem5_lemma #w lo hi;
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
#push-options "--max_fuel 2"
inline_for_extraction noextract
val load_precompute_r1:
p:precomp_r 1
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r1 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 1 in
let r_vec1 = vec_load r1 1 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 1 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
copy_felem #_ #(1,1,1,1,1) rn r;
copy_felem #_ #(5,5,5,5,5) rn_5 r5
inline_for_extraction noextract
val load_precompute_r2:
p:precomp_r 2
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r2 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 2 in
let r_vec1 = vec_load r1 2 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 2 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
let h2 = ST.get () in
fmul_r rn r r r5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h2 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r4:
p:precomp_r 4
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r4 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 4 in
let r_vec1 = vec_load r1 4 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 4 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
fmul_r rn r r r5;
precompute_shift_reduce rn_5 rn;
fmul_r rn rn rn rn_5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h1 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r:
#w:lanes
-> p:precomp_r w
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post #w h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create w (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r #w p r0 r1 =
match w with
| 1 -> load_precompute_r1 p r0 r1
| 2 -> load_precompute_r2 p r0 r1
| 4 -> load_precompute_r4 p r0 r1
#pop-options
inline_for_extraction noextract
val load_felem1_le:
f:felem 1
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem1 (as_seq h0 b))
let load_felem1_le f b =
let h0 = ST.get () in
let lo = vec_load_le U64 1 (sub b 0ul 8ul) in
let hi = vec_load_le U64 1 (sub b 8ul 8ul) in
load_felem f lo hi;
let h1 = ST.get () in
uints_from_bytes_le_lemma64_1 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem1 (as_seq h0 b))
inline_for_extraction noextract
val load_felem2_le:
f:felem 2
-> b:lbuffer uint8 32ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\ | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_felem2_le:
f:felem 2
-> b:lbuffer uint8 32ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem2 (as_seq h0 b)) | [] | Hacl.Impl.Poly1305.Field32xN.load_felem2_le | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: Hacl.Impl.Poly1305.Field32xN.felem 2 -> b: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 59,
"end_line": 617,
"start_col": 24,
"start_line": 606
} |
FStar.HyperStack.ST.Stack | val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f))) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i) | val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i = | true | null | false | let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i) | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Lib.IntTypes.size_t",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Lib.IntTypes.size_v",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.set_bit5_lemma",
"Lib.Buffer.as_seq",
"Lib.Buffer.MUT",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"FStar.UInt32.__uint_to_t",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Prims.unit",
"Lib.Buffer.op_Array_Assignment",
"Lib.IntTypes.op_Slash_Dot",
"Lib.IntVector.vec_or",
"Lib.IntTypes.U64",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Lib.Buffer.op_Array_Access",
"Lib.IntVector.vec_t",
"Prims.eq2",
"Lib.Sequence.lseq",
"Lib.IntTypes.int_t",
"Lib.IntTypes.SEC",
"Lib.IntVector.vec_v",
"Lib.Sequence.create",
"Lib.IntVector.vec_load",
"Lib.IntTypes.op_Less_Less_Dot",
"Lib.IntTypes.u64",
"Lib.IntTypes.op_Percent_Dot"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i); | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f))) | [] | Hacl.Impl.Poly1305.Field32xN.set_bit | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: Hacl.Impl.Poly1305.Field32xN.felem w -> i: Lib.IntTypes.size_t{Lib.IntTypes.size_v i <= 128}
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 36,
"end_line": 142,
"start_col": 20,
"start_line": 136
} |
FStar.HyperStack.ST.Stack | val load_felem_le:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.create w (BSeq.nat_from_bytes_le (as_seq h0 b))) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_felem_le #w f b =
let lo = uint_from_bytes_le #U64 (sub b 0ul 8ul) in
let hi = uint_from_bytes_le #U64 (sub b 8ul 8ul) in
let f0 = vec_load lo w in
let f1 = vec_load hi w in
let h0 = ST.get () in
load_felem f f0 f1;
let h1 = ST.get () in
uint_from_bytes_le_lemma (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (LSeq.create w (BSeq.nat_from_bytes_le (as_seq h0 b))) | val load_felem_le:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.create w (BSeq.nat_from_bytes_le (as_seq h0 b)))
let load_felem_le #w f b = | true | null | false | let lo = uint_from_bytes_le #U64 (sub b 0ul 8ul) in
let hi = uint_from_bytes_le #U64 (sub b 8ul 8ul) in
let f0 = vec_load lo w in
let f1 = vec_load hi w in
let h0 = ST.get () in
load_felem f f0 f1;
let h1 = ST.get () in
uint_from_bytes_le_lemma (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (LSeq.create w (BSeq.nat_from_bytes_le (as_seq h0 b))) | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint8",
"FStar.UInt32.__uint_to_t",
"Lib.Sequence.eq_intro",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Impl.Poly1305.Field32xN.feval",
"Lib.Sequence.create",
"Lib.ByteSequence.nat_from_bytes_le",
"Lib.IntTypes.SEC",
"Lib.Buffer.as_seq",
"Lib.Buffer.MUT",
"Prims.unit",
"Hacl.Impl.Poly1305.Lemmas.uint_from_bytes_le_lemma",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Hacl.Impl.Poly1305.Field32xN.load_felem",
"Lib.IntVector.vec_t",
"Lib.IntTypes.U64",
"Prims.eq2",
"Lib.Sequence.lseq",
"Lib.IntTypes.int_t",
"Lib.IntVector.vec_v",
"Lib.IntVector.vec_load",
"Lib.ByteBuffer.uint_from_bytes_le",
"Lib.IntTypes.uint_t",
"Lib.Buffer.lbuffer_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.mk_int",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Lib.Buffer.sub"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
inline_for_extraction noextract
val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5
inline_for_extraction noextract
val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0])
let reduce_felem #w f =
let f0 = f.(0ul) in
let f1 = f.(1ul) in
let f2 = f.(2ul) in
let f3 = f.(3ul) in
let f4 = f.(4ul) in
let (f0, f1, f2, f3, f4) =
reduce_felem5 (f0, f1, f2, f3, f4) in
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
inline_for_extraction noextract
val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2))
let precompute_shift_reduce #w f1 f2 =
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
f1.(0ul) <- vec_smul_mod f20 (u64 5);
f1.(1ul) <- vec_smul_mod f21 (u64 5);
f1.(2ul) <- vec_smul_mod f22 (u64 5);
f1.(3ul) <- vec_smul_mod f23 (u64 5);
f1.(4ul) <- vec_smul_mod f24 (u64 5)
inline_for_extraction noextract
val load_felem:
#w:lanes
-> f:felem w
-> lo:uint64xN w
-> hi:uint64xN w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.createi #Vec.pfelem w
(fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i]))
let load_felem #w f lo hi =
let (f0, f1, f2, f3, f4) = load_felem5 #w lo hi in
load_felem5_lemma #w lo hi;
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
#push-options "--max_fuel 2"
inline_for_extraction noextract
val load_precompute_r1:
p:precomp_r 1
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r1 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 1 in
let r_vec1 = vec_load r1 1 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 1 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
copy_felem #_ #(1,1,1,1,1) rn r;
copy_felem #_ #(5,5,5,5,5) rn_5 r5
inline_for_extraction noextract
val load_precompute_r2:
p:precomp_r 2
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r2 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 2 in
let r_vec1 = vec_load r1 2 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 2 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
let h2 = ST.get () in
fmul_r rn r r r5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h2 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r4:
p:precomp_r 4
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r4 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 4 in
let r_vec1 = vec_load r1 4 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 4 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
fmul_r rn r r r5;
precompute_shift_reduce rn_5 rn;
fmul_r rn rn rn rn_5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h1 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r:
#w:lanes
-> p:precomp_r w
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post #w h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create w (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r #w p r0 r1 =
match w with
| 1 -> load_precompute_r1 p r0 r1
| 2 -> load_precompute_r2 p r0 r1
| 4 -> load_precompute_r4 p r0 r1
#pop-options
inline_for_extraction noextract
val load_felem1_le:
f:felem 1
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem1 (as_seq h0 b))
let load_felem1_le f b =
let h0 = ST.get () in
let lo = vec_load_le U64 1 (sub b 0ul 8ul) in
let hi = vec_load_le U64 1 (sub b 8ul 8ul) in
load_felem f lo hi;
let h1 = ST.get () in
uints_from_bytes_le_lemma64_1 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem1 (as_seq h0 b))
inline_for_extraction noextract
val load_felem2_le:
f:felem 2
-> b:lbuffer uint8 32ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem2 (as_seq h0 b))
let load_felem2_le f b =
let h0 = ST.get () in
let b1 = vec_load_le U64 2 (sub b 0ul 16ul) in
let b2 = vec_load_le U64 2 (sub b 16ul 16ul) in
let lo = vec_interleave_low b1 b2 in
let hi = vec_interleave_high b1 b2 in
load_felem f lo hi;
let h1 = ST.get () in
vec_interleave_low_lemma2 b1 b2;
vec_interleave_high_lemma2 b1 b2;
uints_from_bytes_le_lemma64_2 (as_seq h0 b);
LSeq.eq_intro (feval h1 f) (Vec.load_elem2 (as_seq h0 b))
inline_for_extraction noextract
val load_felem4_le:
f:felem 4
-> b:lbuffer uint8 64ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem4 (as_seq h0 b))
let load_felem4_le f b =
let h0 = ST.get () in
let lo = vec_load_le U64 4 (sub b 0ul 32ul) in
let hi = vec_load_le U64 4 (sub b 32ul 32ul) in
let (o0, o1, o2, o3, o4) = load_felem5_4 lo hi in
load_felem5_le (as_seq h0 b);
f.(0ul) <- o0;
f.(1ul) <- o1;
f.(2ul) <- o2;
f.(3ul) <- o3;
f.(4ul) <- o4
inline_for_extraction noextract
val load_felems_le:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 (size w *! 16ul)
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == Vec.load_elem (as_seq h0 b))
let load_felems_le #w f b =
match w with
| 1 -> load_felem1_le f b
| 2 -> load_felem2_le f b
| 4 -> load_felem4_le f b
inline_for_extraction noextract
val load_blocks:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 (size w *! 16ul)
-> Stack unit
(requires fun h ->
live h b /\ live h f /\ disjoint b f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == Vec.load_blocks #w (as_seq h0 b))
let load_blocks #s f b =
load_felems_le f b;
set_bit128 f
inline_for_extraction noextract
val load_felem_le:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\ | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_felem_le:
#w:lanes
-> f:felem w
-> b:lbuffer uint8 16ul
-> Stack unit
(requires fun h -> live h f /\ live h b)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.create w (BSeq.nat_from_bytes_le (as_seq h0 b))) | [] | Hacl.Impl.Poly1305.Field32xN.load_felem_le | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: Hacl.Impl.Poly1305.Field32xN.felem w -> b: Lib.Buffer.lbuffer Lib.IntTypes.uint8 16ul
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 83,
"end_line": 698,
"start_col": 26,
"start_line": 689
} |
FStar.HyperStack.ST.Stack | val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r)) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4 | val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 = | true | null | false | let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let o0, o1, o2, o3, o4 =
fmul_r5 #w (f10, f11, f12, f13, f14) (r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54)
in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4 | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"Lib.Buffer.op_Array_Assignment",
"FStar.UInt32.__uint_to_t",
"Prims.unit",
"Hacl.Spec.Poly1305.Field32xN.felem5",
"Hacl.Spec.Poly1305.Field32xN.fmul_r5",
"FStar.Pervasives.Native.Mktuple5",
"Lib.Buffer.op_Array_Access",
"Lib.Buffer.MUT"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\ | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 1,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r)) | [] | Hacl.Impl.Poly1305.Field32xN.fmul_r | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
out: Hacl.Impl.Poly1305.Field32xN.felem w ->
f1: Hacl.Impl.Poly1305.Field32xN.felem w ->
r: Hacl.Impl.Poly1305.Field32xN.felem w ->
r5: Hacl.Impl.Poly1305.Field32xN.felem w
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 17,
"end_line": 290,
"start_col": 27,
"start_line": 264
} |
FStar.HyperStack.ST.Stack | val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul))) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4 | val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p = | true | null | false | let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let o0, o1, o2, o3, o4 =
fadd_mul_r5 #w
(a0, a1, a2, a3, a4)
(f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4)
(r50, r51, r52, r53, r54)
in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4 | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Spec.Poly1305.Field32xN.lanes",
"Hacl.Impl.Poly1305.Field32xN.felem",
"Hacl.Impl.Poly1305.Field32xN.precomp_r",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"Lib.Buffer.op_Array_Assignment",
"FStar.UInt32.__uint_to_t",
"Prims.unit",
"Hacl.Spec.Poly1305.Field32xN.felem5",
"Hacl.Spec.Poly1305.Field32xN.fadd_mul_r5",
"FStar.Pervasives.Native.Mktuple5",
"Lib.Buffer.op_Array_Access",
"Lib.Buffer.MUT",
"Lib.Buffer.lbuffer_t",
"FStar.UInt32.uint_to_t",
"FStar.UInt32.t",
"Lib.Buffer.sub"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul) | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul))) | [] | Hacl.Impl.Poly1305.Field32xN.fadd_mul_r | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
acc: Hacl.Impl.Poly1305.Field32xN.felem w ->
f1: Hacl.Impl.Poly1305.Field32xN.felem w ->
p: Hacl.Impl.Poly1305.Field32xN.precomp_r w
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 17,
"end_line": 345,
"start_col": 28,
"start_line": 311
} |
FStar.HyperStack.ST.Stack | val load_precompute_r4:
p:precomp_r 4
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0))) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_precompute_r4 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 4 in
let r_vec1 = vec_load r1 4 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 4 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
fmul_r rn r r r5;
precompute_shift_reduce rn_5 rn;
fmul_r rn rn rn rn_5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h1 r).[0]);
precompute_shift_reduce rn_5 rn | val load_precompute_r4:
p:precomp_r 4
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r4 p r0 r1 = | true | null | false | let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 4 in
let r_vec1 = vec_load r1 4 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro (LSeq.createi #Vec.pfelem
4
(fun i -> (uint64xN_v r_vec1).[ i ] * pow2 64 + (uint64xN_v r_vec0).[ i ]))
(LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
fmul_r rn r r r5;
precompute_shift_reduce rn_5 rn;
fmul_r rn rn rn rn_5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h1 r).[ 0 ]);
precompute_shift_reduce rn_5 rn | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Impl.Poly1305.Field32xN.precomp_r",
"Lib.IntTypes.uint64",
"Hacl.Impl.Poly1305.Field32xN.precompute_shift_reduce",
"Prims.unit",
"Lib.Sequence.eq_intro",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Impl.Poly1305.Field32xN.feval",
"Hacl.Spec.Poly1305.Vec.compute_rw",
"Hacl.Impl.Poly1305.Field32xN.op_String_Access",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Hacl.Impl.Poly1305.Field32xN.fmul_r",
"Prims._assert",
"Prims.eq2",
"Lib.Sequence.lseq",
"Lib.Sequence.create",
"Prims.op_Addition",
"FStar.Mul.op_Star",
"Lib.IntTypes.uint_v",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"Prims.pow2",
"Lib.Sequence.createi",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Hacl.Spec.Poly1305.Field32xN.uint64xN_v",
"Hacl.Impl.Poly1305.Field32xN.load_felem",
"Lib.IntVector.vec_t",
"Lib.IntTypes.int_t",
"Lib.IntVector.vec_v",
"Lib.IntVector.vec_load",
"Lib.Buffer.lbuffer_t",
"Lib.Buffer.MUT",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"FStar.UInt32.uint_to_t",
"FStar.UInt32.t",
"Lib.Buffer.sub",
"FStar.UInt32.__uint_to_t"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
inline_for_extraction noextract
val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5
inline_for_extraction noextract
val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0])
let reduce_felem #w f =
let f0 = f.(0ul) in
let f1 = f.(1ul) in
let f2 = f.(2ul) in
let f3 = f.(3ul) in
let f4 = f.(4ul) in
let (f0, f1, f2, f3, f4) =
reduce_felem5 (f0, f1, f2, f3, f4) in
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
inline_for_extraction noextract
val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2))
let precompute_shift_reduce #w f1 f2 =
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
f1.(0ul) <- vec_smul_mod f20 (u64 5);
f1.(1ul) <- vec_smul_mod f21 (u64 5);
f1.(2ul) <- vec_smul_mod f22 (u64 5);
f1.(3ul) <- vec_smul_mod f23 (u64 5);
f1.(4ul) <- vec_smul_mod f24 (u64 5)
inline_for_extraction noextract
val load_felem:
#w:lanes
-> f:felem w
-> lo:uint64xN w
-> hi:uint64xN w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.createi #Vec.pfelem w
(fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i]))
let load_felem #w f lo hi =
let (f0, f1, f2, f3, f4) = load_felem5 #w lo hi in
load_felem5_lemma #w lo hi;
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
#push-options "--max_fuel 2"
inline_for_extraction noextract
val load_precompute_r1:
p:precomp_r 1
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r1 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 1 in
let r_vec1 = vec_load r1 1 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 1 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
copy_felem #_ #(1,1,1,1,1) rn r;
copy_felem #_ #(5,5,5,5,5) rn_5 r5
inline_for_extraction noextract
val load_precompute_r2:
p:precomp_r 2
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r2 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 2 in
let r_vec1 = vec_load r1 2 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 2 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 2 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
let h2 = ST.get () in
fmul_r rn r r r5;
let h3 = ST.get () in
LSeq.eq_intro (feval h3 rn) (Vec.compute_rw (feval h2 r).[0]);
precompute_shift_reduce rn_5 rn
inline_for_extraction noextract
val load_precompute_r4:
p:precomp_r 4
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) == | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 2,
"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"
} | null | val load_precompute_r4:
p:precomp_r 4
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 4 (uint_v r1 * pow2 64 + uint_v r0))) | [] | Hacl.Impl.Poly1305.Field32xN.load_precompute_r4 | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | p: Hacl.Impl.Poly1305.Field32xN.precomp_r 4 -> r0: Lib.IntTypes.uint64 -> r1: Lib.IntTypes.uint64
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 33,
"end_line": 550,
"start_col": 32,
"start_line": 527
} |
FStar.HyperStack.ST.Stack | val load_precompute_r1:
p:precomp_r 1
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0))) | [
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Vec",
"short_module": "Vec"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_precompute_r1 p r0 r1 =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 1 in
let r_vec1 = vec_load r1 1 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro
(LSeq.createi #Vec.pfelem 1 (fun i -> (uint64xN_v r_vec1).[i] * pow2 64 + (uint64xN_v r_vec0).[i]))
(LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
copy_felem #_ #(1,1,1,1,1) rn r;
copy_felem #_ #(5,5,5,5,5) rn_5 r5 | val load_precompute_r1:
p:precomp_r 1
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0)))
let load_precompute_r1 p r0 r1 = | true | null | false | let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let rn = sub p 10ul 5ul in
let rn_5 = sub p 15ul 5ul in
let r_vec0 = vec_load r0 1 in
let r_vec1 = vec_load r1 1 in
let h0 = ST.get () in
load_felem r r_vec0 r_vec1;
let h1 = ST.get () in
LSeq.eq_intro (LSeq.createi #Vec.pfelem
1
(fun i -> (uint64xN_v r_vec1).[ i ] * pow2 64 + (uint64xN_v r_vec0).[ i ]))
(LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
assert (feval h1 r == LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0));
precompute_shift_reduce r5 r;
copy_felem #_ #(1, 1, 1, 1, 1) rn r;
copy_felem #_ #(5, 5, 5, 5, 5) rn_5 r5 | {
"checked_file": "Hacl.Impl.Poly1305.Field32xN.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Poly1305.Vec.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.Lemmas.fst.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Impl.Poly1305.Lemmas.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Poly1305.Field32xN.fst"
} | [] | [
"Hacl.Impl.Poly1305.Field32xN.precomp_r",
"Lib.IntTypes.uint64",
"Hacl.Impl.Poly1305.Field32xN.copy_felem",
"FStar.Pervasives.Native.Mktuple5",
"Prims.nat",
"Prims.unit",
"Hacl.Impl.Poly1305.Field32xN.precompute_shift_reduce",
"Prims._assert",
"Prims.eq2",
"Lib.Sequence.lseq",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Impl.Poly1305.Field32xN.feval",
"Lib.Sequence.create",
"Prims.op_Addition",
"FStar.Mul.op_Star",
"Lib.IntTypes.uint_v",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"Prims.pow2",
"Lib.Sequence.eq_intro",
"Lib.Sequence.createi",
"Prims.b2t",
"Prims.op_LessThan",
"Hacl.Impl.Poly1305.Field32xN.op_String_Access",
"Hacl.Spec.Poly1305.Field32xN.uint64xN_v",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Hacl.Impl.Poly1305.Field32xN.load_felem",
"Lib.IntVector.vec_t",
"Lib.IntTypes.int_t",
"Lib.IntVector.vec_v",
"Lib.IntVector.vec_load",
"Lib.Buffer.lbuffer_t",
"Lib.Buffer.MUT",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"FStar.UInt32.uint_to_t",
"FStar.UInt32.t",
"Lib.Buffer.sub",
"FStar.UInt32.__uint_to_t"
] | [] | module Hacl.Impl.Poly1305.Field32xN
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
include Hacl.Spec.Poly1305.Field32xN
open Hacl.Spec.Poly1305.Field32xN.Lemmas
open Hacl.Impl.Poly1305.Lemmas
module Vec = Hacl.Spec.Poly1305.Vec
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 50 --using_facts_from '* -FStar.Seq'"
inline_for_extraction noextract
let felem (w:lanes) = lbuffer (uint64xN w) 5ul
inline_for_extraction noextract
let felem_wide (w:lanes) = felem w
inline_for_extraction noextract
let precomp_r (w:lanes) = lbuffer (uint64xN w) 20ul
unfold noextract
let op_String_Access #a #len = LSeq.index #a #len
noextract
val as_tup5: #w:lanes -> h:mem -> f:felem w -> GTot (felem5 w)
let as_tup5 #w h f =
let s = as_seq h f in
let s0 = s.[0] in
let s1 = s.[1] in
let s2 = s.[2] in
let s3 = s.[3] in
let s4 = s.[4] in
(s0,s1,s2,s3,s4)
noextract
val felem_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_fits #w h f m =
felem_fits5 (as_tup5 h f) m
noextract
val felem_wide_fits: #w:lanes -> h:mem -> f:felem w -> m:scale32_5 -> Type0
let felem_wide_fits #w h f m =
felem_wide_fits5 (as_tup5 h f) m
noextract
let feval (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq Vec.pfelem w) =
feval5 (as_tup5 h f)
noextract
let fas_nat (#w:lanes) (h:mem) (f:felem w) : GTot (LSeq.lseq nat w) =
fas_nat5 (as_tup5 h f)
noextract
let felem_less (#w:lanes) (h:mem) (f:felem w) (max:nat) : Type0 =
felem_less5 (as_tup5 h f) max
val lemma_feval_is_fas_nat:
#w:lanes
-> h:mem
-> f:felem w
-> Lemma
(requires felem_less h f (pow2 128))
(ensures (forall (i:nat). i < w ==> (feval h f).[i] == (fas_nat h f).[i]))
let lemma_feval_is_fas_nat #w h f =
lemma_feval_is_fas_nat (as_tup5 h f)
inline_for_extraction noextract
val fmul_precomp_r_pre:
#w:lanes
-> h:mem
-> precomp:precomp_r w
-> Type0
let fmul_precomp_r_pre #w h precomp =
let r = gsub precomp 0ul 5ul in
let r_5 = gsub precomp 5ul 5ul in
felem_fits h r (1, 1, 1, 1, 1) /\
felem_fits h r_5 (5, 5, 5, 5, 5) /\
as_tup5 h r_5 == precomp_r5 (as_tup5 h r)
noextract
val load_precompute_r_post:
#w:lanes
-> h:mem
-> p:precomp_r w
-> Type0
let load_precompute_r_post #w h p =
assert_norm (pow2 128 < Vec.prime);
let r = gsub p 0ul 5ul in
let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
fmul_precomp_r_pre h p /\
felem_fits h rn (2, 2, 2, 2, 2) /\
felem_fits h rn_5 (10, 10, 10, 10, 10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn) /\
feval h rn == Vec.compute_rw (feval h r).[0]
inline_for_extraction noextract
val create_felem:
w:lanes
-> StackInline (felem w)
(requires fun h -> True)
(ensures fun h0 b h1 ->
stack_allocated b h0 h1 (LSeq.create 5 (zero w)) /\
feval h1 b == LSeq.create w 0)
let create_felem w =
let r = create 5ul (zero w) in
let h1 = ST.get () in
LSeq.eq_intro (feval h1 r) (LSeq.create w 0);
r
#push-options "--z3rlimit 100"
inline_for_extraction noextract
val set_bit:
#w:lanes
-> f:felem w
-> i:size_t{size_v i <= 128}
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 (v i)))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(Math.Lemmas.pow2_le_compat 128 (v i);
feval h1 f == LSeq.map (Vec.pfadd (pow2 (v i))) (feval h0 f)))
let set_bit #w f i =
let b = u64 1 <<. (i %. 26ul) in
let mask = vec_load b w in
let fi = f.(i /. 26ul) in
let h0 = ST.get () in
f.(i /. 26ul) <- vec_or fi mask;
set_bit5_lemma (as_seq h0 f) (v i)
#pop-options
inline_for_extraction noextract
val set_bit128:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\
felem_fits h f (1, 1, 1, 1, 1) /\
felem_less #w h f (pow2 128))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
feval h1 f == LSeq.map (Vec.pfadd (pow2 128)) (feval h0 f))
let set_bit128 #w f =
let b = u64 0x1000000 in
assert_norm (0x1000000 = pow2 24);
assert (v b == v (u64 1 <<. 24ul));
let mask = vec_load b w in
let f4 = f.(4ul) in
let h0 = ST.get () in
f.(4ul) <- vec_or f4 mask;
set_bit5_lemma (as_seq h0 f) 128
inline_for_extraction noextract
val set_zero:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (0, 0, 0, 0, 0) /\
feval h1 f == LSeq.create w 0)
let set_zero #w f =
f.(0ul) <- zero w;
f.(1ul) <- zero w;
f.(2ul) <- zero w;
f.(3ul) <- zero w;
f.(4ul) <- zero w;
let h1 = ST.get () in
LSeq.eq_intro (feval h1 f) (LSeq.create w 0)
inline_for_extraction noextract
val copy_felem:
#w:lanes
-> #m:scale32_5
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ disjoint f1 f2 /\
felem_fits h f2 m)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
felem_fits h1 f1 m /\
as_tup5 h1 f1 == as_tup5 h0 f2)
let copy_felem #w #m f1 f2 =
f1.(0ul) <- f2.(0ul);
f1.(1ul) <- f2.(1ul);
f1.(2ul) <- f2.(2ul);
f1.(3ul) <- f2.(3ul);
f1.(4ul) <- f2.(4ul)
inline_for_extraction noextract
val fadd:
#w:lanes
-> out:felem w
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h ->
live h f1 /\ live h f2 /\ live h out /\
felem_fits h f1 (2,2,2,2,2) /\
felem_fits h f2 (1,1,1,1,1))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
//as_tup5 h1 out == fadd5 (as_tup5 h0 f1) (as_tup5 h0 f2) /\
felem_fits h1 out (3,3,3,3,3) /\
feval h1 out == LSeq.map2 Vec.pfadd (feval h0 f1) (feval h0 f2))
let fadd #w out f1 f2 =
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
let (o0,o1,o2,o3,o4) =
fadd5 #w (f10,f11,f12,f13,f14) (f20,f21,f22,f23,f24) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#push-options "--max_fuel 1"
inline_for_extraction noextract
val fmul_r:
#w:lanes
-> out:felem w
-> f1:felem w
-> r:felem w
-> r5:felem w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\
live h r /\ live h r5 /\
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h r (2,2,2,2,2) /\
felem_fits h r5 (10,10,10,10,10) /\
as_tup5 h r5 == precomp_r5 (as_tup5 h r))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 (Vec.pfmul) (feval h0 f1) (feval h0 r))
let fmul_r #w out f1 r r5 =
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let (o0, o1, o2, o3, o4) =
fmul_r5 #w (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
#pop-options
inline_for_extraction noextract
val fadd_mul_r:
#w:lanes
-> acc:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h acc /\ live h f1 /\ live h p /\
felem_fits h acc (2,2,2,2,2) /\
felem_fits h f1 (1,1,1,1,1) /\
fmul_precomp_r_pre h p)
(ensures fun h0 _ h1 ->
modifies (loc acc) h0 h1 /\
felem_fits h1 acc (1,2,1,1,2) /\
feval h1 acc == LSeq.map2 (Vec.pfmul)
(LSeq.map2 (Vec.pfadd) (feval h0 acc) (feval h0 f1)) (feval h0 (gsub p 0ul 5ul)))
let fadd_mul_r #w out f1 p =
let r = sub p 0ul 5ul in
let r5 = sub p 5ul 5ul in
let r0 = r.(0ul) in
let r1 = r.(1ul) in
let r2 = r.(2ul) in
let r3 = r.(3ul) in
let r4 = r.(4ul) in
let r50 = r5.(0ul) in
let r51 = r5.(1ul) in
let r52 = r5.(2ul) in
let r53 = r5.(3ul) in
let r54 = r5.(4ul) in
let f10 = f1.(0ul) in
let f11 = f1.(1ul) in
let f12 = f1.(2ul) in
let f13 = f1.(3ul) in
let f14 = f1.(4ul) in
let a0 = out.(0ul) in
let a1 = out.(1ul) in
let a2 = out.(2ul) in
let a3 = out.(3ul) in
let a4 = out.(4ul) in
let (o0, o1, o2, o3, o4) =
fadd_mul_r5 #w (a0, a1, a2, a3, a4) (f10, f11, f12, f13, f14)
(r0, r1, r2, r3, r4) (r50, r51, r52, r53, r54) in
out.(0ul) <- o0;
out.(1ul) <- o1;
out.(2ul) <- o2;
out.(3ul) <- o3;
out.(4ul) <- o4
inline_for_extraction noextract
val fmul_rn:
#w:lanes
-> out:felem w
-> f1:felem w
-> p:precomp_r w
-> Stack unit
(requires fun h ->
live h out /\ live h f1 /\ live h p /\
(let rn = gsub p 10ul 5ul in
let rn_5 = gsub p 15ul 5ul in
felem_fits h f1 (3,3,3,3,3) /\
felem_fits h rn (2,2,2,2,2) /\
felem_fits h rn_5 (10,10,10,10,10) /\
as_tup5 h rn_5 == precomp_r5 (as_tup5 h rn)))
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
felem_fits h1 out (1,2,1,1,2) /\
feval h1 out == LSeq.map2 Vec.pfmul (feval h0 f1) (feval h0 (gsub p 10ul 5ul)))
let fmul_rn #w out f1 p =
let rn = sub p 10ul 5ul in
let rn5 = sub p 15ul 5ul in
fmul_r #w out f1 rn rn5
inline_for_extraction noextract
val reduce_felem:
#w:lanes
-> f:felem w
-> Stack unit
(requires fun h ->
live h f /\ felem_fits h f (2,2,2,2,2))
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
(fas_nat h1 f).[0] == (feval h0 f).[0])
let reduce_felem #w f =
let f0 = f.(0ul) in
let f1 = f.(1ul) in
let f2 = f.(2ul) in
let f3 = f.(3ul) in
let f4 = f.(4ul) in
let (f0, f1, f2, f3, f4) =
reduce_felem5 (f0, f1, f2, f3, f4) in
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
inline_for_extraction noextract
val precompute_shift_reduce:
#w:lanes
-> f1:felem w
-> f2:felem w
-> Stack unit
(requires fun h -> live h f1 /\ live h f2)
(ensures fun h0 _ h1 ->
modifies (loc f1) h0 h1 /\
as_tup5 h1 f1 == precomp_r5 (as_tup5 h0 f2))
let precompute_shift_reduce #w f1 f2 =
let f20 = f2.(0ul) in
let f21 = f2.(1ul) in
let f22 = f2.(2ul) in
let f23 = f2.(3ul) in
let f24 = f2.(4ul) in
f1.(0ul) <- vec_smul_mod f20 (u64 5);
f1.(1ul) <- vec_smul_mod f21 (u64 5);
f1.(2ul) <- vec_smul_mod f22 (u64 5);
f1.(3ul) <- vec_smul_mod f23 (u64 5);
f1.(4ul) <- vec_smul_mod f24 (u64 5)
inline_for_extraction noextract
val load_felem:
#w:lanes
-> f:felem w
-> lo:uint64xN w
-> hi:uint64xN w
-> Stack unit
(requires fun h -> live h f)
(ensures fun h0 _ h1 ->
modifies (loc f) h0 h1 /\
felem_fits h1 f (1, 1, 1, 1, 1) /\
felem_less h1 f (pow2 128) /\
feval h1 f == LSeq.createi #Vec.pfelem w
(fun i -> (uint64xN_v hi).[i] * pow2 64 + (uint64xN_v lo).[i]))
let load_felem #w f lo hi =
let (f0, f1, f2, f3, f4) = load_felem5 #w lo hi in
load_felem5_lemma #w lo hi;
f.(0ul) <- f0;
f.(1ul) <- f1;
f.(2ul) <- f2;
f.(3ul) <- f3;
f.(4ul) <- f4
#push-options "--max_fuel 2"
inline_for_extraction noextract
val load_precompute_r1:
p:precomp_r 1
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) == | false | false | Hacl.Impl.Poly1305.Field32xN.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 2,
"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"
} | null | val load_precompute_r1:
p:precomp_r 1
-> r0:uint64
-> r1:uint64
-> Stack unit
(requires fun h -> live h p)
(ensures fun h0 _ h1 ->
modifies (loc p) h0 h1 /\
load_precompute_r_post h1 p /\
(assert_norm (pow2 64 * pow2 64 = pow2 128);
feval h1 (gsub p 0ul 5ul) ==
LSeq.create 1 (uint_v r1 * pow2 64 + uint_v r0))) | [] | Hacl.Impl.Poly1305.Field32xN.load_precompute_r1 | {
"file_name": "code/poly1305/Hacl.Impl.Poly1305.Field32xN.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | p: Hacl.Impl.Poly1305.Field32xN.precomp_r 1 -> r0: Lib.IntTypes.uint64 -> r1: Lib.IntTypes.uint64
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 36,
"end_line": 475,
"start_col": 32,
"start_line": 456
} |
Subsets and Splits