file_name
stringlengths 5
52
| name
stringlengths 4
95
| original_source_type
stringlengths 0
23k
| source_type
stringlengths 9
23k
| source_definition
stringlengths 9
57.9k
| source
dict | source_range
dict | file_context
stringlengths 0
721k
| dependencies
dict | opens_and_abbrevs
listlengths 2
94
| vconfig
dict | interleaved
bool 1
class | verbose_type
stringlengths 1
7.42k
| effect
stringclasses 118
values | effect_flags
sequencelengths 0
2
| mutual_with
sequencelengths 0
11
| ideal_premises
sequencelengths 0
236
| proof_features
sequencelengths 0
1
| is_simple_lemma
bool 2
classes | is_div
bool 2
classes | is_proof
bool 2
classes | is_simply_typed
bool 2
classes | is_type
bool 2
classes | partial_definition
stringlengths 5
3.99k
| completed_definiton
stringlengths 1
1.63M
| isa_cross_project_example
bool 1
class |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FStar.DM4F.Heap.IntStoreFixed.fst | FStar.DM4F.Heap.IntStoreFixed.index | val index (h:heap) (i:id) : int | val index (h:heap) (i:id) : int | let index h i = Seq.index h i | {
"file_name": "examples/dm4free/FStar.DM4F.Heap.IntStoreFixed.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 29,
"end_line": 25,
"start_col": 0,
"start_line": 25
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.DM4F.Heap.IntStoreFixed
open FStar.Seq
let id = i:nat{i < store_size}
let heap = h:seq int{length h == store_size}
let to_id n = n | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.DM4F.Heap.IntStoreFixed.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | h: FStar.DM4F.Heap.IntStoreFixed.heap -> i: FStar.DM4F.Heap.IntStoreFixed.id -> Prims.int | Prims.Tot | [
"total"
] | [] | [
"FStar.DM4F.Heap.IntStoreFixed.heap",
"FStar.DM4F.Heap.IntStoreFixed.id",
"FStar.Seq.Base.index",
"Prims.int"
] | [] | false | false | false | true | false | let index h i =
| Seq.index h i | false |
FStar.HyperStack.All.fst | FStar.HyperStack.All.all_pre | val all_pre : Type | let all_pre = all_pre_h HyperStack.mem | {
"file_name": "ulib/FStar.HyperStack.All.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 38,
"end_line": 19,
"start_col": 0,
"start_line": 19
} | (*
Copyright 2008-2014 Nikhil Swamy and 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.HyperStack.All
include FStar.HyperStack.ST | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.HyperStack.All.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.all_pre_h",
"FStar.Monotonic.HyperStack.mem"
] | [] | false | false | false | true | true | let all_pre =
| all_pre_h HyperStack.mem | false |
|
FStar.DM4F.Heap.IntStoreFixed.fst | FStar.DM4F.Heap.IntStoreFixed.create | val create (x:int) : heap | val create (x:int) : heap | let create x = create #int store_size x | {
"file_name": "examples/dm4free/FStar.DM4F.Heap.IntStoreFixed.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 39,
"end_line": 29,
"start_col": 0,
"start_line": 29
} | (*
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.DM4F.Heap.IntStoreFixed
open FStar.Seq
let id = i:nat{i < store_size}
let heap = h:seq int{length h == store_size}
let to_id n = n
let index h i = Seq.index h i
let upd h i x = let h1 = upd h i x in assert (length h1 = store_size) ; h1 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.DM4F.Heap.IntStoreFixed.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: Prims.int -> FStar.DM4F.Heap.IntStoreFixed.heap | Prims.Tot | [
"total"
] | [] | [
"Prims.int",
"FStar.Seq.Base.create",
"FStar.DM4F.Heap.IntStoreFixed.store_size",
"FStar.DM4F.Heap.IntStoreFixed.heap"
] | [] | false | false | false | true | false | let create x =
| create #int store_size x | false |
FStar.DM4F.Heap.IntStoreFixed.fst | FStar.DM4F.Heap.IntStoreFixed.upd | val upd (h:heap) (i:id) (x:int) : heap | val upd (h:heap) (i:id) (x:int) : heap | let upd h i x = let h1 = upd h i x in assert (length h1 = store_size) ; h1 | {
"file_name": "examples/dm4free/FStar.DM4F.Heap.IntStoreFixed.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 74,
"end_line": 27,
"start_col": 0,
"start_line": 27
} | (*
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.DM4F.Heap.IntStoreFixed
open FStar.Seq
let id = i:nat{i < store_size}
let heap = h:seq int{length h == store_size}
let to_id n = n
let index h i = Seq.index h i | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.DM4F.Heap.IntStoreFixed.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | h: FStar.DM4F.Heap.IntStoreFixed.heap -> i: FStar.DM4F.Heap.IntStoreFixed.id -> x: Prims.int
-> FStar.DM4F.Heap.IntStoreFixed.heap | Prims.Tot | [
"total"
] | [] | [
"FStar.DM4F.Heap.IntStoreFixed.heap",
"FStar.DM4F.Heap.IntStoreFixed.id",
"Prims.int",
"Prims.unit",
"Prims._assert",
"Prims.b2t",
"Prims.op_Equality",
"FStar.Seq.Base.length",
"FStar.DM4F.Heap.IntStoreFixed.store_size",
"FStar.Seq.Base.seq",
"FStar.Seq.Base.upd"
] | [] | false | false | false | true | false | let upd h i x =
| let h1 = upd h i x in
assert (length h1 = store_size);
h1 | false |
FStar.HyperStack.All.fst | FStar.HyperStack.All.all_post | val all_post : a: Type -> Type | let all_post (a:Type) = all_post_h HyperStack.mem a | {
"file_name": "ulib/FStar.HyperStack.All.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 52,
"end_line": 21,
"start_col": 0,
"start_line": 21
} | (*
Copyright 2008-2014 Nikhil Swamy and 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.HyperStack.All
include FStar.HyperStack.ST
let all_pre = all_pre_h HyperStack.mem | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.HyperStack.All.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Type -> Type | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.all_post_h",
"FStar.Monotonic.HyperStack.mem"
] | [] | false | false | false | true | true | let all_post (a: Type) =
| all_post_h HyperStack.mem a | false |
|
FStar.HyperStack.All.fst | FStar.HyperStack.All.all_wp | val all_wp : a: Type -> Type | let all_wp (a:Type) = all_wp_h HyperStack.mem a | {
"file_name": "ulib/FStar.HyperStack.All.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 47,
"end_line": 22,
"start_col": 0,
"start_line": 22
} | (*
Copyright 2008-2014 Nikhil Swamy and 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.HyperStack.All
include FStar.HyperStack.ST
let all_pre = all_pre_h HyperStack.mem
let all_post' (a:Type) (pre:Type) = all_post_h' HyperStack.mem a pre | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.HyperStack.All.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Type -> Type | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.all_wp_h",
"FStar.Monotonic.HyperStack.mem"
] | [] | false | false | false | true | true | let all_wp (a: Type) =
| all_wp_h HyperStack.mem a | false |
|
FStar.HyperStack.All.fst | FStar.HyperStack.All.lift_state_all | val lift_state_all : a: Type -> wp: FStar.HyperStack.ST.st_wp a -> p: FStar.HyperStack.All.all_post a
-> FStar.Pervasives.st_pre_h FStar.Monotonic.HyperStack.mem | let lift_state_all (a:Type) (wp:st_wp a) (p:all_post a) = wp (fun a -> p (V a)) | {
"file_name": "ulib/FStar.HyperStack.All.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 87,
"end_line": 25,
"start_col": 7,
"start_line": 25
} | (*
Copyright 2008-2014 Nikhil Swamy and 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.HyperStack.All
include FStar.HyperStack.ST
let all_pre = all_pre_h HyperStack.mem
let all_post' (a:Type) (pre:Type) = all_post_h' HyperStack.mem a pre
let all_post (a:Type) = all_post_h HyperStack.mem a
let all_wp (a:Type) = all_wp_h HyperStack.mem a
new_effect ALL = ALL_h HyperStack.mem | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.HyperStack.All.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Type -> wp: FStar.HyperStack.ST.st_wp a -> p: FStar.HyperStack.All.all_post a
-> FStar.Pervasives.st_pre_h FStar.Monotonic.HyperStack.mem | Prims.Tot | [
"total"
] | [] | [
"FStar.HyperStack.ST.st_wp",
"FStar.HyperStack.All.all_post",
"FStar.Pervasives.V",
"FStar.Monotonic.HyperStack.mem",
"Prims.l_True",
"FStar.Pervasives.st_pre_h"
] | [] | false | false | false | true | false | let lift_state_all (a: Type) (wp: st_wp a) (p: all_post a) =
| wp (fun a -> p (V a)) | false |
|
L0Types.fst | L0Types.aliasKeyCRT_t | val aliasKeyCRT_t : Type0 | val aliasKeyCRT_t : Type0 | let aliasKeyCRT_t : Type0 = UInt32.t | {
"file_name": "share/steel/examples/pulse/dice/l0/L0Types.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 36,
"end_line": 30,
"start_col": 0,
"start_line": 30
} | (*
Copyright 2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module L0Types
open Pulse.Lib.Pervasives
let x509_version_t : Type0 = UInt32.t
let x509_serialNumber_t : Type0 = UInt32.t
let deviceIDCRI_t : Type0 = UInt32.t
let deviceIDCSR_t : Type0 = UInt32.t
let aliasKeyTBS_t : Type0 = UInt32.t | {
"checked_file": "/",
"dependencies": [
"Pulse.Lib.Pervasives.fst.checked",
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "L0Types.fst"
} | [
{
"abbrev": false,
"full_module": "Pulse.Lib.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "HACL",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.SizeT",
"short_module": "US"
},
{
"abbrev": true,
"full_module": "Pulse.Lib.Vec",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Pulse.Lib.Reference",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "Pulse.Lib.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"FStar.UInt32.t"
] | [] | false | false | false | true | true | let aliasKeyCRT_t:Type0 =
| UInt32.t | false |
Spec.Box.Test.fst | Spec.Box.Test.test | val test : _: Prims.unit -> FStar.All.ALL Prims.bool | let test () =
let pk1 : lbytes 32 = Spec.Curve25519.secret_to_public sk1 in
let pk2 : lbytes 32 = Spec.Curve25519.secret_to_public sk2 in
let mac_cipher = box_detached sk1 pk2 nonce plain in
let (mac, cipher) =
match mac_cipher with | Some p -> p | None -> (create 16 (u8 0), create 72 (u8 0)) in
let dec = box_open_detached pk1 sk2 nonce mac cipher in
let dec_p = match dec with | Some p -> p | None -> create 72 (u8 0) in
let result_decryption =
for_all2 (fun a b -> uint_to_nat #U8 a = uint_to_nat #U8 b) dec_p plain in
if result_decryption
then begin IO.print_string "\nCryptoBox: Success!\n"; true end
else begin IO.print_string "\nCryptoBox: Failure :("; false end | {
"file_name": "specs/tests/Spec.Box.Test.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 65,
"end_line": 86,
"start_col": 0,
"start_line": 72
} | module Spec.Box.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
open Spec.Box
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let plain : lbytes 72 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x10uy; 0x11uy; 0x12uy; 0x13uy; 0x14uy; 0x15uy;
0x16uy; 0x17uy; 0x18uy; 0x19uy; 0x20uy; 0x21uy; 0x22uy; 0x23uy;
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x10uy; 0x11uy; 0x12uy; 0x13uy; 0x14uy; 0x15uy;
0x16uy; 0x17uy; 0x18uy; 0x19uy; 0x20uy; 0x21uy; 0x22uy; 0x23uy;
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x10uy; 0x11uy; 0x12uy; 0x13uy; 0x14uy; 0x15uy;
0x16uy; 0x17uy; 0x18uy; 0x19uy; 0x20uy; 0x21uy; 0x22uy; 0x23uy
] in
assert_norm (List.Tot.length l == 72);
of_list l
let nonce : lbytes 24 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x10uy; 0x11uy; 0x12uy; 0x13uy; 0x14uy; 0x15uy;
0x16uy; 0x17uy; 0x18uy; 0x19uy; 0x20uy; 0x21uy; 0x22uy; 0x23uy
] in
assert_norm (List.Tot.length l == 24);
of_list l
let key : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x85uy; 0xd6uy; 0xbeuy; 0x78uy; 0x57uy; 0x55uy; 0x6duy; 0x33uy;
0x7fuy; 0x44uy; 0x52uy; 0xfeuy; 0x42uy; 0xd5uy; 0x06uy; 0xa8uy;
0x01uy; 0x03uy; 0x80uy; 0x8auy; 0xfbuy; 0x0duy; 0xb2uy; 0xfduy;
0x4auy; 0xbfuy; 0xf6uy; 0xafuy; 0x41uy; 0x49uy; 0xf5uy; 0x1buy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let sk1 : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x85uy; 0xd6uy; 0xbeuy; 0x78uy; 0x57uy; 0x55uy; 0x6duy; 0x33uy;
0x7fuy; 0x44uy; 0x52uy; 0xfeuy; 0x42uy; 0xd5uy; 0x06uy; 0xa8uy;
0x01uy; 0x03uy; 0x80uy; 0x8auy; 0xfbuy; 0x0duy; 0xb2uy; 0xfduy;
0x4auy; 0xbfuy; 0xf6uy; 0xafuy; 0x41uy; 0x49uy; 0xf5uy; 0x1buy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let sk2 : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x85uy; 0xd6uy; 0xbeuy; 0x78uy; 0x57uy; 0x55uy; 0x6duy; 0x33uy;
0x7fuy; 0x44uy; 0x52uy; 0xfeuy; 0x42uy; 0xd5uy; 0x06uy; 0xa8uy;
0x01uy; 0x03uy; 0x80uy; 0x8auy; 0xfbuy; 0x0duy; 0xb2uy; 0xfduy;
0x4auy; 0xbfuy; 0xf6uy; 0xafuy; 0x41uy; 0x49uy; 0xf5uy; 0x1cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l | {
"checked_file": "/",
"dependencies": [
"Spec.Curve25519.fst.checked",
"Spec.Box.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Box.Test.fst"
} | [
{
"abbrev": false,
"full_module": "Spec.Box",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.RawIntTypes",
"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": "Spec.Box",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Box",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit -> FStar.All.ALL Prims.bool | FStar.All.ALL | [] | [] | [
"Prims.unit",
"Spec.SecretBox.tag",
"Lib.ByteSequence.bytes",
"Prims.b2t",
"Prims.op_Equality",
"Prims.nat",
"Lib.Sequence.length",
"Lib.IntTypes.uint_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Spec.Box.Test.plain",
"Prims.bool",
"FStar.IO.print_string",
"Lib.Sequence.for_all2",
"Prims.l_or",
"Prims.int",
"Prims.op_GreaterThanOrEqual",
"Lib.IntTypes.range",
"Lib.IntTypes.uint_v",
"Lib.RawIntTypes.uint_to_nat",
"Lib.Sequence.lseq",
"Lib.IntTypes.int_t",
"Lib.Sequence.create",
"Lib.IntTypes.u8",
"FStar.Pervasives.Native.option",
"Lib.Sequence.seq",
"Spec.Box.box_open_detached",
"Spec.Box.Test.sk2",
"Spec.Box.Test.nonce",
"FStar.Pervasives.Native.tuple2",
"FStar.Pervasives.Native.Mktuple2",
"Spec.Box.box_detached",
"Spec.Box.Test.sk1",
"Spec.Curve25519.secret_to_public"
] | [] | false | true | false | false | false | let test () =
| let pk1:lbytes 32 = Spec.Curve25519.secret_to_public sk1 in
let pk2:lbytes 32 = Spec.Curve25519.secret_to_public sk2 in
let mac_cipher = box_detached sk1 pk2 nonce plain in
let mac, cipher =
match mac_cipher with
| Some p -> p
| None -> (create 16 (u8 0), create 72 (u8 0))
in
let dec = box_open_detached pk1 sk2 nonce mac cipher in
let dec_p =
match dec with
| Some p -> p
| None -> create 72 (u8 0)
in
let result_decryption = for_all2 (fun a b -> uint_to_nat #U8 a = uint_to_nat #U8 b) dec_p plain in
if result_decryption
then
(IO.print_string "\nCryptoBox: Success!\n";
true)
else
(IO.print_string "\nCryptoBox: Failure :(";
false) | false |
|
FStar.DM4F.Heap.IntStoreFixed.fst | FStar.DM4F.Heap.IntStoreFixed.lemma_index_create | val lemma_index_create: v:int -> i:id -> Lemma
(requires True)
(ensures (index (create v) i == v))
[SMTPat (index (create v) i)] | val lemma_index_create: v:int -> i:id -> Lemma
(requires True)
(ensures (index (create v) i == v))
[SMTPat (index (create v) i)] | let lemma_index_create v i = lemma_index_create #int store_size v i | {
"file_name": "examples/dm4free/FStar.DM4F.Heap.IntStoreFixed.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 67,
"end_line": 35,
"start_col": 0,
"start_line": 35
} | (*
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.DM4F.Heap.IntStoreFixed
open FStar.Seq
let id = i:nat{i < store_size}
let heap = h:seq int{length h == store_size}
let to_id n = n
let index h i = Seq.index h i
let upd h i x = let h1 = upd h i x in assert (length h1 = store_size) ; h1
let create x = create #int store_size x
let lemma_index_upd1 s n v = lemma_index_upd1 #int s n v
let lemma_index_upd2 s n v i = lemma_index_upd2 #int s n v i | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.DM4F.Heap.IntStoreFixed.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | v: Prims.int -> i: FStar.DM4F.Heap.IntStoreFixed.id
-> FStar.Pervasives.Lemma
(ensures FStar.DM4F.Heap.IntStoreFixed.index (FStar.DM4F.Heap.IntStoreFixed.create v) i == v)
[SMTPat (FStar.DM4F.Heap.IntStoreFixed.index (FStar.DM4F.Heap.IntStoreFixed.create v) i)] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.int",
"FStar.DM4F.Heap.IntStoreFixed.id",
"FStar.Seq.Base.lemma_index_create",
"FStar.DM4F.Heap.IntStoreFixed.store_size",
"Prims.unit"
] | [] | true | false | true | false | false | let lemma_index_create v i =
| lemma_index_create #int store_size v i | false |
Hacl.Impl.Chacha20Poly1305.fst | Hacl.Impl.Chacha20Poly1305.aead_encrypt | val aead_encrypt: #w:field_spec -> aead_encrypt_st w | val aead_encrypt: #w:field_spec -> aead_encrypt_st w | let aead_encrypt #w output tag input input_len data data_len key nonce =
chacha20_encrypt #w input_len output input key nonce 1ul;
derive_key_poly1305_do #w key nonce data_len data input_len output tag | {
"file_name": "code/chacha20poly1305/Hacl.Impl.Chacha20Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 72,
"end_line": 173,
"start_col": 0,
"start_line": 171
} | module Hacl.Impl.Chacha20Poly1305
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Hacl.Impl.Chacha20Poly1305.PolyCore
open Hacl.Impl.Poly1305.Fields
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module Spec = Spec.Chacha20Poly1305
module SpecPoly = Spec.Poly1305
module Poly = Hacl.Impl.Poly1305
#reset-options "--z3rlimit 150 --max_fuel 0 --max_ifuel 1 --record_options"
val poly1305_do_:
#w:field_spec
-> k:lbuffer uint8 32ul // key
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen // authenticated additional data
-> mlen:size_t
-> m:lbuffer uint8 mlen // plaintext
-> ctx:Poly.poly1305_ctx w
-> block:lbuffer uint8 16ul ->
Stack unit
(requires fun h ->
live h k /\ live h aad /\ live h m /\ live h ctx /\ live h block /\
disjoint ctx k /\ disjoint ctx aad /\ disjoint ctx m /\ disjoint ctx block /\
disjoint block k /\ disjoint block aad /\ disjoint block m)
(ensures fun h0 _ h1 ->
modifies (loc ctx |+| loc block) h0 h1 /\
(let acc, r = SpecPoly.poly1305_init (as_seq h0 k) in
let acc = if (length aad <> 0) then Spec.poly1305_padded r (as_seq h0 aad) acc else acc in
let acc = if (length m <> 0) then Spec.poly1305_padded r (as_seq h0 m) acc else acc in
let block_s = LSeq.concat (BSeq.uint_to_bytes_le #U64 (u64 (length aad)))
(BSeq.uint_to_bytes_le #U64 (u64 (length m))) in
let acc = SpecPoly.poly1305_update1 r 16 block_s acc in
Poly.as_get_acc h1 ctx == acc /\ as_seq h1 block == block_s /\
Poly.state_inv_t h1 ctx))
[@Meta.Attribute.inline_]
let poly1305_do_ #w k aadlen aad mlen m ctx block =
Poly.poly1305_init ctx k;
if (aadlen <> 0ul) then (
poly1305_padded ctx aadlen aad)
else ();
if (mlen <> 0ul) then (
poly1305_padded ctx mlen m)
else ();
let h0 = ST.get () in
update_sub_f h0 block 0ul 8ul
(fun h -> BSeq.uint_to_bytes_le #U64 (to_u64 aadlen))
(fun _ -> uint_to_bytes_le (sub block 0ul 8ul) (to_u64 aadlen));
let h1 = ST.get () in
//assert (LSeq.sub (as_seq h1 block) 0 8 == BSeq.uint_to_bytes_le #U64 (to_u64 aadlen));
Poly.reveal_ctx_inv ctx h0 h1;
update_sub_f h1 block 8ul 8ul
(fun h -> BSeq.uint_to_bytes_le #U64 (to_u64 mlen))
(fun _ -> uint_to_bytes_le (sub block 8ul 8ul) (to_u64 mlen));
let h2 = ST.get () in
//assert (LSeq.sub (as_seq h2 block) 8 8 == BSeq.uint_to_bytes_le #U64 (to_u64 mlen));
LSeq.eq_intro (LSeq.sub (as_seq h2 block) 0 8) (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen));
LSeq.lemma_concat2 8 (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen)) 8 (BSeq.uint_to_bytes_le #U64 (to_u64 mlen)) (as_seq h2 block);
//assert (as_seq h2 block == LSeq.concat (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen)) (BSeq.uint_to_bytes_le #U64 (to_u64 mlen)));
Poly.reveal_ctx_inv ctx h1 h2;
Poly.poly1305_update1 ctx block
// Implements the actual poly1305_do operation
inline_for_extraction noextract
let poly1305_do_core_st (w:field_spec) =
k:lbuffer uint8 32ul // key
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen // authenticated additional data
-> mlen:size_t
-> m:lbuffer uint8 mlen // plaintext
-> out:lbuffer uint8 16ul -> // output: tag
Stack unit
(requires fun h ->
live h k /\ live h aad /\ live h m /\ live h out /\
disjoint k out)
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
as_seq h1 out == Spec.poly1305_do (as_seq h0 k) (as_seq h0 m) (as_seq h0 aad))
noextract
val poly1305_do: #w:field_spec -> poly1305_do_core_st w
[@Meta.Attribute.specialize]
let poly1305_do #w k aadlen aad mlen m out =
push_frame();
let ctx = create (nlimb w +! precomplen w) (limb_zero w) in
let block = create 16ul (u8 0) in
poly1305_do_ #w k aadlen aad mlen m ctx block;
Poly.poly1305_finish out k ctx;
pop_frame()
unfold noextract
let width_chacha20 (s:field_spec) : Hacl.Spec.Chacha20.Vec.lanes =
match s with
| M32 -> 1
| M128 -> 4
| M256 -> 8
[@ Meta.Attribute.specialize ]
assume val chacha20_encrypt: #w:field_spec ->
Hacl.Impl.Chacha20.Vec.chacha20_encrypt_st (width_chacha20 w)
// Derives the key, and then perform poly1305
val derive_key_poly1305_do:
#w:field_spec
-> k:lbuffer uint8 32ul
-> n:lbuffer uint8 12ul
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen
-> mlen:size_t
-> m:lbuffer uint8 mlen
-> out:lbuffer uint8 16ul ->
Stack unit
(requires fun h ->
live h k /\ live h n /\ live h aad /\ live h m /\ live h out)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
(let key:LSeq.lseq uint8 64 = Spec.Chacha20.chacha20_encrypt_bytes (as_seq h0 k) (as_seq h0 n) 0 (LSeq.create 64 (u8 0)) in
as_seq h1 out == Spec.poly1305_do (LSeq.sub key 0 32) (as_seq h0 m) (as_seq h0 aad)))
[@ Meta.Attribute.inline_ ]
let derive_key_poly1305_do #w k n aadlen aad mlen m out =
push_frame ();
// Create a new buffer to derive the key
let tmp = create 64ul (u8 0) in
chacha20_encrypt #w 64ul tmp tmp k n 0ul;
// The derived key should only be the first 32 bytes
let key = sub tmp 0ul 32ul in
poly1305_do #w key aadlen aad mlen m out;
pop_frame()
inline_for_extraction noextract
let aead_encrypt_st (w:field_spec) =
output:buffer uint8
-> tag:lbuffer uint8 16ul
-> input:buffer uint8
-> input_len:size_t { length input = v input_len /\ length output = v input_len }
-> data:buffer uint8
-> data_len:size_t { length data = v data_len }
-> key:lbuffer uint8 32ul
-> nonce:lbuffer uint8 12ul ->
Stack unit
(requires fun h ->
live h key /\ live h nonce /\ live h data /\
live h input /\ live h output /\ live h tag /\
disjoint key output /\ disjoint nonce output /\
disjoint key tag /\ disjoint nonce tag /\
disjoint output tag /\
eq_or_disjoint (input <: lbuffer uint8 input_len) (output <: lbuffer uint8 input_len) /\
disjoint data output)
(ensures fun h0 _ h1 -> modifies2 output tag h0 h1 /\
Seq.append (as_seq h1 (output <: lbuffer uint8 input_len)) (as_seq h1 tag) ==
Spec.aead_encrypt (as_seq h0 key) (as_seq h0 nonce) (as_seq h0 (input <: lbuffer uint8 input_len)) (as_seq h0 (data <: lbuffer uint8 data_len)))
noextract
val aead_encrypt: #w:field_spec -> aead_encrypt_st w | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"Spec.Chacha20Poly1305.fst.checked",
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"Hacl.Impl.Chacha20Poly1305.PolyCore.fst.checked",
"Hacl.Impl.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20Poly1305.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "Poly"
},
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "SpecPoly"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20Poly1305",
"short_module": "Spec"
},
{
"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": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20Poly1305.PolyCore",
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 150,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Hacl.Impl.Chacha20Poly1305.aead_encrypt_st w | Prims.Tot | [
"total"
] | [] | [
"Hacl.Impl.Poly1305.Fields.field_spec",
"Lib.Buffer.buffer",
"Lib.IntTypes.uint8",
"Lib.Buffer.lbuffer",
"FStar.UInt32.__uint_to_t",
"Lib.IntTypes.size_t",
"Prims.l_and",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"Prims.op_GreaterThanOrEqual",
"Lib.IntTypes.range",
"Lib.IntTypes.U32",
"Lib.Buffer.length",
"Lib.Buffer.MUT",
"Lib.IntTypes.v",
"Lib.IntTypes.PUB",
"Hacl.Impl.Chacha20Poly1305.derive_key_poly1305_do",
"Prims.unit",
"Hacl.Impl.Chacha20Poly1305.chacha20_encrypt"
] | [] | false | false | false | false | false | let aead_encrypt #w output tag input input_len data data_len key nonce =
| chacha20_encrypt #w input_len output input key nonce 1ul;
derive_key_poly1305_do #w key nonce data_len data input_len output tag | false |
Even.fst | Even.prove_even | val prove_even : _: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit | let prove_even () = compute (); ignore (repeat (fun () -> apply (`Even_SS))); apply (`Even_Z) | {
"file_name": "examples/tactics/Even.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 93,
"end_line": 24,
"start_col": 0,
"start_line": 24
} | (*
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 Even
open FStar.Tactics.V2
type unat = | Z : unat | S : unat → unat
let rec nat2unary (n: nat) : Tot unat = if n = 0 then Z else S (nat2unary (n - 1))
type even : unat → Type = | Even_Z : even Z | Even_SS : #n: unat → even n → even (S (S n)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Even.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.unit",
"FStar.Tactics.V2.Derived.apply",
"FStar.Pervasives.ignore",
"Prims.list",
"FStar.Tactics.V2.Derived.repeat",
"FStar.Tactics.V2.Derived.compute"
] | [] | false | true | false | false | false | let prove_even () =
| compute ();
ignore (repeat (fun () -> apply (`Even_SS)));
apply (`Even_Z) | false |
|
FStar.HyperStack.All.fst | FStar.HyperStack.All.lift_exn_all | val lift_exn_all : a: Type ->
wp: FStar.Pervasives.ex_wp a ->
p: FStar.HyperStack.All.all_post a ->
h: FStar.Monotonic.HyperStack.mem
-> FStar.Pervasives.ex_pre | let lift_exn_all (a:Type) (wp:ex_wp a) (p:all_post a) (h:HyperStack.mem) = wp (fun ra -> p ra h) | {
"file_name": "ulib/FStar.HyperStack.All.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 105,
"end_line": 28,
"start_col": 7,
"start_line": 28
} | (*
Copyright 2008-2014 Nikhil Swamy and 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.HyperStack.All
include FStar.HyperStack.ST
let all_pre = all_pre_h HyperStack.mem
let all_post' (a:Type) (pre:Type) = all_post_h' HyperStack.mem a pre
let all_post (a:Type) = all_post_h HyperStack.mem a
let all_wp (a:Type) = all_wp_h HyperStack.mem a
new_effect ALL = ALL_h HyperStack.mem
unfold let lift_state_all (a:Type) (wp:st_wp a) (p:all_post a) = wp (fun a -> p (V a))
sub_effect STATE ~> ALL = lift_state_all | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.HyperStack.All.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
a: Type ->
wp: FStar.Pervasives.ex_wp a ->
p: FStar.HyperStack.All.all_post a ->
h: FStar.Monotonic.HyperStack.mem
-> FStar.Pervasives.ex_pre | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.ex_wp",
"FStar.HyperStack.All.all_post",
"FStar.Monotonic.HyperStack.mem",
"FStar.Pervasives.result",
"Prims.l_True",
"FStar.Pervasives.ex_pre"
] | [] | false | false | false | true | false | let lift_exn_all (a: Type) (wp: ex_wp a) (p: all_post a) (h: HyperStack.mem) =
| wp (fun ra -> p ra h) | false |
|
Even.fst | Even.even10 | val even10:even (normalize_term (nat2unary 10)) | val even10:even (normalize_term (nat2unary 10)) | let even10 : even (normalize_term (nat2unary 10)) = synth prove_even | {
"file_name": "examples/tactics/Even.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 68,
"end_line": 26,
"start_col": 0,
"start_line": 26
} | (*
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 Even
open FStar.Tactics.V2
type unat = | Z : unat | S : unat → unat
let rec nat2unary (n: nat) : Tot unat = if n = 0 then Z else S (nat2unary (n - 1))
type even : unat → Type = | Even_Z : even Z | Even_SS : #n: unat → even n → even (S (S n))
let prove_even () = compute (); ignore (repeat (fun () -> apply (`Even_SS))); apply (`Even_Z) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Even.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Even.even (Even.S
(Even.S (Even.S (Even.S (Even.S (Even.S (Even.S (Even.S (Even.S (Even.S Even.Z)))))))))) | Prims.Tot | [
"total"
] | [] | [
"Even.Even_SS",
"Even.S",
"Even.Z",
"Even.Even_Z"
] | [] | false | false | false | true | false | let even10:even (normalize_term (nat2unary 10)) =
| FStar.Tactics.Effect.synth_by_tactic prove_even | false |
FStar.DM4F.Heap.IntStoreFixed.fst | FStar.DM4F.Heap.IntStoreFixed.lemma_index_upd1 | val lemma_index_upd1: s:heap -> n:id -> v:int -> Lemma
(requires True)
(ensures (index (upd s n v) n == v))
[SMTPat (index (upd s n v) n)] | val lemma_index_upd1: s:heap -> n:id -> v:int -> Lemma
(requires True)
(ensures (index (upd s n v) n == v))
[SMTPat (index (upd s n v) n)] | let lemma_index_upd1 s n v = lemma_index_upd1 #int s n v | {
"file_name": "examples/dm4free/FStar.DM4F.Heap.IntStoreFixed.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 56,
"end_line": 31,
"start_col": 0,
"start_line": 31
} | (*
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.DM4F.Heap.IntStoreFixed
open FStar.Seq
let id = i:nat{i < store_size}
let heap = h:seq int{length h == store_size}
let to_id n = n
let index h i = Seq.index h i
let upd h i x = let h1 = upd h i x in assert (length h1 = store_size) ; h1
let create x = create #int store_size x | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.DM4F.Heap.IntStoreFixed.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | s: FStar.DM4F.Heap.IntStoreFixed.heap -> n: FStar.DM4F.Heap.IntStoreFixed.id -> v: Prims.int
-> FStar.Pervasives.Lemma
(ensures FStar.DM4F.Heap.IntStoreFixed.index (FStar.DM4F.Heap.IntStoreFixed.upd s n v) n == v)
[SMTPat (FStar.DM4F.Heap.IntStoreFixed.index (FStar.DM4F.Heap.IntStoreFixed.upd s n v) n)] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"FStar.DM4F.Heap.IntStoreFixed.heap",
"FStar.DM4F.Heap.IntStoreFixed.id",
"Prims.int",
"FStar.Seq.Base.lemma_index_upd1",
"Prims.unit"
] | [] | true | false | true | false | false | let lemma_index_upd1 s n v =
| lemma_index_upd1 #int s n v | false |
Steel.ST.SeqMatch.fst | Steel.ST.SeqMatch.seq_seq_match_weaken | val seq_seq_match_weaken
(#opened: _)
(#t1 #t2: Type)
(p p': (t1 -> t2 -> vprop))
(w: (x1: t1 -> x2: t2 -> STGhostT unit opened (p x1 x2) (fun _ -> p' x1 x2)))
(c1 c1': Seq.seq t1)
(c2 c2': Seq.seq t2)
(i j: nat)
: STGhost unit
opened
(seq_seq_match p c1 c2 i j)
(fun _ -> seq_seq_match p' c1' c2' i j)
(i <= j /\
(i == j \/
(j <= Seq.length c1 /\ j <= Seq.length c2 /\ j <= Seq.length c1' /\ j <= Seq.length c2' /\
(Seq.slice c1 i j) `Seq.equal` (Seq.slice c1' i j) /\
(Seq.slice c2 i j) `Seq.equal` (Seq.slice c2' i j))))
(fun _ -> True) | val seq_seq_match_weaken
(#opened: _)
(#t1 #t2: Type)
(p p': (t1 -> t2 -> vprop))
(w: (x1: t1 -> x2: t2 -> STGhostT unit opened (p x1 x2) (fun _ -> p' x1 x2)))
(c1 c1': Seq.seq t1)
(c2 c2': Seq.seq t2)
(i j: nat)
: STGhost unit
opened
(seq_seq_match p c1 c2 i j)
(fun _ -> seq_seq_match p' c1' c2' i j)
(i <= j /\
(i == j \/
(j <= Seq.length c1 /\ j <= Seq.length c2 /\ j <= Seq.length c1' /\ j <= Seq.length c2' /\
(Seq.slice c1 i j) `Seq.equal` (Seq.slice c1' i j) /\
(Seq.slice c2 i j) `Seq.equal` (Seq.slice c2' i j))))
(fun _ -> True) | let seq_seq_match_weaken
(#opened: _)
(#t1 #t2: Type)
(p p': t1 -> t2 -> vprop)
(w: ((x1: t1) -> (x2: t2) -> STGhostT unit opened
(p x1 x2) (fun _ -> p' x1 x2)
))
(c1 c1': Seq.seq t1)
(c2 c2': Seq.seq t2)
(i j: nat)
: STGhost unit opened
(seq_seq_match p c1 c2 i j)
(fun _ -> seq_seq_match p' c1' c2' i j)
(i <= j /\ (i == j \/ (
j <= Seq.length c1 /\ j <= Seq.length c2 /\
j <= Seq.length c1' /\ j <= Seq.length c2' /\
Seq.slice c1 i j `Seq.equal` Seq.slice c1' i j /\
Seq.slice c2 i j `Seq.equal` Seq.slice c2' i j
)))
(fun _ -> True)
=
on_range_weaken
(seq_seq_match_item p c1 c2)
(seq_seq_match_item p' c1' c2')
i j
(fun k ->
rewrite (seq_seq_match_item p c1 c2 k) (p (Seq.index (Seq.slice c1 i j) (k - i)) (Seq.index (Seq.slice c2 i j) (k - i)));
w _ _;
rewrite (p' _ _) (seq_seq_match_item p' c1' c2' k)
) | {
"file_name": "lib/steel/Steel.ST.SeqMatch.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 5,
"end_line": 290,
"start_col": 0,
"start_line": 261
} | module Steel.ST.SeqMatch
include Steel.ST.OnRange
open Steel.ST.GenElim
module Seq = FStar.Seq
module SZ = FStar.SizeT
(* `seq_list_match` describes how to match a sequence of low-level
values (the low-level contents of an array) with a list of high-level
values. `seq_list_match` is carefully designed to be usable within
(mutually) recursive definitions of matching functions on the type of
high-level values. *)
[@@__reduce__]
let seq_list_match_nil0
(#t: Type)
(c: Seq.seq t)
: Tot vprop
= pure (c `Seq.equal` Seq.empty)
[@@__reduce__]
let seq_list_match_cons0
(#t #t': Type)
(c: Seq.seq t)
(l: list t' { Cons? l })
(item_match: (t -> (v': t' { v' << l }) -> vprop))
(seq_list_match: (Seq.seq t -> (v': list t') -> (raw_data_item_match: (t -> (v'': t' { v'' << v' }) -> vprop) { v' << l }) ->
vprop))
: Tot vprop
= exists_ (fun (c1: t) -> exists_ (fun (c2: Seq.seq t) ->
item_match c1 (List.Tot.hd l) `star`
seq_list_match c2 (List.Tot.tl l) item_match `star`
pure (c `Seq.equal` Seq.cons c1 c2)
))
let rec seq_list_match
(#t #t': Type)
(c: Seq.seq t)
(v: list t')
(item_match: (t -> (v': t' { v' << v }) -> vprop))
: Tot vprop
(decreases v)
= if Nil? v
then seq_list_match_nil0 c
else seq_list_match_cons0 c v item_match seq_list_match
let seq_list_match_cons_eq
(#t #t': Type)
(c: Seq.seq t)
(v: list t')
(item_match: (t -> (v': t' { v' << v }) -> vprop))
: Lemma
(requires (Cons? v))
(ensures (
seq_list_match c v item_match ==
seq_list_match_cons0 c v item_match seq_list_match
))
= let a :: q = v in
assert_norm (seq_list_match c (a :: q) item_match ==
seq_list_match_cons0 c (a :: q) item_match seq_list_match
)
let seq_list_match_nil
(#opened: _)
(#t #t': Type)
(c: Seq.seq t)
(v: list t')
(item_match: (t -> (v': t' { v' << v }) -> vprop))
: STGhost unit opened
emp
(fun _ -> seq_list_match c v item_match)
(c `Seq.equal` Seq.empty /\
Nil? v)
(fun _ -> True)
= noop ();
rewrite
(seq_list_match_nil0 c)
(seq_list_match c v item_match)
let list_cons_precedes
(#t: Type)
(a: t)
(q: list t)
: Lemma
((a << a :: q) /\ (q << a :: q))
[SMTPat (a :: q)]
= assert (List.Tot.hd (a :: q) << (a :: q));
assert (List.Tot.tl (a :: q) << (a :: q))
let seq_list_match_cons_intro
(#opened: _)
(#t #t': Type)
(a: t)
(a' : t')
(c: Seq.seq t)
(v: list t')
(item_match: (t -> (v': t' { v' << a' :: v }) -> vprop))
: STGhostT unit opened
(item_match a a' `star` seq_list_match c v item_match)
(fun _ -> seq_list_match (Seq.cons a c) (a' :: v) item_match)
= seq_list_match_cons_eq (Seq.cons a c) (a' :: v) item_match;
noop ();
rewrite
(seq_list_match_cons0 (Seq.cons a c) (a' :: v) item_match seq_list_match)
(seq_list_match (Seq.cons a c) (a' :: v) item_match)
let seq_list_match_cons_elim
(#opened: _)
(#t #t': Type)
(c: Seq.seq t)
(v: list t' { Cons? v \/ Seq.length c > 0 })
(item_match: (t -> (v': t' { v' << v }) -> vprop))
: STGhostT (squash (Cons? v /\ Seq.length c > 0)) opened
(seq_list_match c v item_match)
(fun _ -> item_match (Seq.head c) (List.Tot.hd v) `star`
seq_list_match (Seq.tail c) (List.Tot.tl v) item_match)
= if Nil? v
then begin
rewrite
(seq_list_match c v item_match)
(seq_list_match_nil0 c);
let _ = gen_elim () in
assert False;
rewrite // by contradiction
emp
(item_match (Seq.head c) (List.Tot.hd v) `star`
seq_list_match (Seq.tail c) (List.Tot.tl v) item_match)
end else begin
seq_list_match_cons_eq c v item_match;
noop ();
rewrite
(seq_list_match c v item_match)
(seq_list_match_cons0 c v item_match seq_list_match);
let _ = gen_elim () in
let prf : squash (Cons? v /\ Seq.length c > 0) = () in
let c1 = vpattern (fun c1 -> item_match c1 (List.Tot.hd v)) in
let c2 = vpattern (fun c2 -> seq_list_match c2 (List.Tot.tl v) item_match) in
Seq.lemma_cons_inj c1 (Seq.head c) c2 (Seq.tail c);
vpattern_rewrite (fun c1 -> item_match c1 (List.Tot.hd v)) (Seq.head c);
vpattern_rewrite (fun c2 -> seq_list_match c2 (List.Tot.tl v) item_match) (Seq.tail c);
prf
end
// this one cannot be proven with seq_seq_match because of the << refinement in the type of item_match
let rec seq_list_match_weaken
(#opened: _)
(#t #t': Type)
(c: Seq.seq t)
(v: list t')
(item_match1 item_match2: (t -> (v': t' { v' << v }) -> vprop))
(prf: (
(#opened: _) ->
(c': t) ->
(v': t' { v' << v }) ->
STGhostT unit opened
(item_match1 c' v')
(fun _ -> item_match2 c' v')
))
: STGhostT unit opened
(seq_list_match c v item_match1)
(fun _ -> seq_list_match c v item_match2)
(decreases v)
= if Nil? v
then
rewrite (seq_list_match c v item_match1) (seq_list_match c v item_match2)
else begin
let _ : squash (Cons? v) = () in
seq_list_match_cons_eq c v item_match1;
seq_list_match_cons_eq c v item_match2;
rewrite
(seq_list_match c v item_match1)
(seq_list_match_cons0 c v item_match1 seq_list_match);
let _ = gen_elim () in
prf _ _;
seq_list_match_weaken _ (List.Tot.tl v) item_match1 item_match2 prf;
rewrite
(seq_list_match_cons0 c v item_match2 seq_list_match)
(seq_list_match c v item_match2)
end
(* `seq_seq_match` describes how to match a sequence of low-level
values (the low-level contents of an array) with a sequence of high-level
values. Contrary to `seq_list_match`, `seq_seq_match` is not meant to be usable within
(mutually) recursive definitions of matching functions on the type of
high-level values, because no lemma ensures that `Seq.index s i << s` *)
let seq_seq_match_item
(#t1 #t2: Type)
(p: t1 -> t2 -> vprop)
(c: Seq.seq t1)
(l: Seq.seq t2)
(i: nat)
: Tot vprop
= if i < Seq.length c && i < Seq.length l
then
p (Seq.index c i) (Seq.index l i)
else
pure (squash False)
let seq_seq_match_item_tail
(#t1 #t2: Type)
(p: t1 -> t2 -> vprop)
(c: Seq.seq t1)
(l: Seq.seq t2)
(delta: nat)
(i: nat)
: Lemma
(requires (
i + delta <= Seq.length c /\
i + delta <= Seq.length l
))
(ensures (
seq_seq_match_item p (Seq.slice c delta (Seq.length c)) (Seq.slice l delta (Seq.length l)) i ==
seq_seq_match_item p c l (i + delta)
))
= ()
[@@__reduce__]
let seq_seq_match
(#t1 #t2: Type)
(p: t1 -> t2 -> vprop)
(c: Seq.seq t1)
(l: Seq.seq t2)
(i j: nat)
: Tot vprop
= on_range (seq_seq_match_item p c l) i j
let seq_seq_match_length
(#opened: _)
(#t1 #t2: Type)
(p: t1 -> t2 -> vprop)
(s1: Seq.seq t1)
(s2: Seq.seq t2)
(i j: nat)
: STGhost unit opened
(seq_seq_match p s1 s2 i j)
(fun _ -> seq_seq_match p s1 s2 i j)
True
(fun _ -> i <= j /\ (i == j \/ (j <= Seq.length s1 /\ j <= Seq.length s2)))
= on_range_le (seq_seq_match_item p s1 s2) i j;
if i = j
then noop ()
else begin
let j' = j - 1 in
if j' < Seq.length s1 && j' < Seq.length s2
then noop ()
else begin
on_range_unsnoc
(seq_seq_match_item p s1 s2)
i j' j;
rewrite
(seq_seq_match_item p _ _ _)
(pure (squash False));
let _ = gen_elim () in
rewrite
(seq_seq_match p s1 s2 i j')
(seq_seq_match p s1 s2 i j) // by contradiction
end
end | {
"checked_file": "/",
"dependencies": [
"Steel.ST.OnRange.fsti.checked",
"Steel.ST.GenElim.fsti.checked",
"prims.fst.checked",
"FStar.SizeT.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Steel.ST.SeqMatch.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.SizeT",
"short_module": "SZ"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": false,
"full_module": "Steel.ST.GenElim",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.OnRange",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
p: (_: t1 -> _: t2 -> Steel.Effect.Common.vprop) ->
p': (_: t1 -> _: t2 -> Steel.Effect.Common.vprop) ->
w: (x1: t1 -> x2: t2 -> Steel.ST.Effect.Ghost.STGhostT Prims.unit) ->
c1: FStar.Seq.Base.seq t1 ->
c1': FStar.Seq.Base.seq t1 ->
c2: FStar.Seq.Base.seq t2 ->
c2': FStar.Seq.Base.seq t2 ->
i: Prims.nat ->
j: Prims.nat
-> Steel.ST.Effect.Ghost.STGhost Prims.unit | Steel.ST.Effect.Ghost.STGhost | [] | [] | [
"Steel.Memory.inames",
"Steel.Effect.Common.vprop",
"Prims.unit",
"FStar.Seq.Base.seq",
"Prims.nat",
"Steel.ST.OnRange.on_range_weaken",
"Steel.ST.SeqMatch.seq_seq_match_item",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"Steel.ST.Util.rewrite",
"FStar.Seq.Base.index",
"FStar.Seq.Base.slice",
"Prims.op_Subtraction",
"Steel.ST.SeqMatch.seq_seq_match",
"Prims.l_or",
"Prims.eq2",
"FStar.Seq.Base.length",
"FStar.Seq.Base.equal",
"Prims.l_True"
] | [] | false | true | false | false | false | let seq_seq_match_weaken
(#opened: _)
(#t1 #t2: Type)
(p p': (t1 -> t2 -> vprop))
(w: (x1: t1 -> x2: t2 -> STGhostT unit opened (p x1 x2) (fun _ -> p' x1 x2)))
(c1 c1': Seq.seq t1)
(c2 c2': Seq.seq t2)
(i j: nat)
: STGhost unit
opened
(seq_seq_match p c1 c2 i j)
(fun _ -> seq_seq_match p' c1' c2' i j)
(i <= j /\
(i == j \/
(j <= Seq.length c1 /\ j <= Seq.length c2 /\ j <= Seq.length c1' /\ j <= Seq.length c2' /\
(Seq.slice c1 i j) `Seq.equal` (Seq.slice c1' i j) /\
(Seq.slice c2 i j) `Seq.equal` (Seq.slice c2' i j))))
(fun _ -> True) =
| on_range_weaken (seq_seq_match_item p c1 c2)
(seq_seq_match_item p' c1' c2')
i
j
(fun k ->
rewrite (seq_seq_match_item p c1 c2 k)
(p (Seq.index (Seq.slice c1 i j) (k - i)) (Seq.index (Seq.slice c2 i j) (k - i)));
w _ _;
rewrite (p' _ _) (seq_seq_match_item p' c1' c2' k)) | false |
FStar.Array.fsti | FStar.Array.contains | val contains (#a: Type0) (h: heap) (s: array a) : Type0 | val contains (#a: Type0) (h: heap) (s: array a) : Type0 | let contains (#a:Type0) (h:heap) (s:array a) : Type0 = Heap.contains h (as_ref s) | {
"file_name": "ulib/legacy/FStar.Array.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 81,
"end_line": 37,
"start_col": 0,
"start_line": 37
} | (*
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.Array
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
open FStar.All
open FStar.Seq
open FStar.Ref
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
val array (a:Type0) : Type0
val as_ref (#a:Type0) (arr:array a) : GTot (ref (seq a))
let sel (#a:Type0) (h:heap) (s:array a) : GTot (seq a) = Heap.sel h (as_ref s) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Heap.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Array.fsti"
} | [
{
"abbrev": false,
"full_module": "FStar.Ref",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | h: FStar.Monotonic.Heap.heap -> s: FStar.Array.array a -> Type0 | Prims.Tot | [
"total"
] | [] | [
"FStar.Monotonic.Heap.heap",
"FStar.Array.array",
"FStar.Monotonic.Heap.contains",
"FStar.Seq.Base.seq",
"FStar.Heap.trivial_preorder",
"FStar.Array.as_ref"
] | [] | false | false | false | true | true | let contains (#a: Type0) (h: heap) (s: array a) : Type0 =
| Heap.contains h (as_ref s) | false |
FStar.DM4F.Heap.IntStoreFixed.fst | FStar.DM4F.Heap.IntStoreFixed.lemma_index_upd2 | val lemma_index_upd2: s:heap -> n:id -> v:int -> i:id{i<>n} -> Lemma
(requires True)
(ensures (index (upd s n v) i == index s i))
[SMTPat (index (upd s n v) i)] | val lemma_index_upd2: s:heap -> n:id -> v:int -> i:id{i<>n} -> Lemma
(requires True)
(ensures (index (upd s n v) i == index s i))
[SMTPat (index (upd s n v) i)] | let lemma_index_upd2 s n v i = lemma_index_upd2 #int s n v i | {
"file_name": "examples/dm4free/FStar.DM4F.Heap.IntStoreFixed.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 60,
"end_line": 33,
"start_col": 0,
"start_line": 33
} | (*
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.DM4F.Heap.IntStoreFixed
open FStar.Seq
let id = i:nat{i < store_size}
let heap = h:seq int{length h == store_size}
let to_id n = n
let index h i = Seq.index h i
let upd h i x = let h1 = upd h i x in assert (length h1 = store_size) ; h1
let create x = create #int store_size x
let lemma_index_upd1 s n v = lemma_index_upd1 #int s n v | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.DM4F.Heap.IntStoreFixed.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
s: FStar.DM4F.Heap.IntStoreFixed.heap ->
n: FStar.DM4F.Heap.IntStoreFixed.id ->
v: Prims.int ->
i: FStar.DM4F.Heap.IntStoreFixed.id{i <> n}
-> FStar.Pervasives.Lemma
(ensures
FStar.DM4F.Heap.IntStoreFixed.index (FStar.DM4F.Heap.IntStoreFixed.upd s n v) i ==
FStar.DM4F.Heap.IntStoreFixed.index s i)
[SMTPat (FStar.DM4F.Heap.IntStoreFixed.index (FStar.DM4F.Heap.IntStoreFixed.upd s n v) i)] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"FStar.DM4F.Heap.IntStoreFixed.heap",
"FStar.DM4F.Heap.IntStoreFixed.id",
"Prims.int",
"Prims.b2t",
"Prims.op_disEquality",
"FStar.Seq.Base.lemma_index_upd2",
"Prims.unit"
] | [] | true | false | true | false | false | let lemma_index_upd2 s n v i =
| lemma_index_upd2 #int s n v i | false |
FStar.Array.fsti | FStar.Array.sel | val sel (#a: Type0) (h: heap) (s: array a) : GTot (seq a) | val sel (#a: Type0) (h: heap) (s: array a) : GTot (seq a) | let sel (#a:Type0) (h:heap) (s:array a) : GTot (seq a) = Heap.sel h (as_ref s) | {
"file_name": "ulib/legacy/FStar.Array.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 78,
"end_line": 35,
"start_col": 0,
"start_line": 35
} | (*
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.Array
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
open FStar.All
open FStar.Seq
open FStar.Ref
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
val array (a:Type0) : Type0
val as_ref (#a:Type0) (arr:array a) : GTot (ref (seq a)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Heap.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Array.fsti"
} | [
{
"abbrev": false,
"full_module": "FStar.Ref",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | h: FStar.Monotonic.Heap.heap -> s: FStar.Array.array a -> Prims.GTot (FStar.Seq.Base.seq a) | Prims.GTot | [
"sometrivial"
] | [] | [
"FStar.Monotonic.Heap.heap",
"FStar.Array.array",
"FStar.Monotonic.Heap.sel",
"FStar.Seq.Base.seq",
"FStar.Heap.trivial_preorder",
"FStar.Array.as_ref"
] | [] | false | false | false | false | false | let sel (#a: Type0) (h: heap) (s: array a) : GTot (seq a) =
| Heap.sel h (as_ref s) | false |
Hacl.Impl.Chacha20Poly1305.fst | Hacl.Impl.Chacha20Poly1305.aead_encrypt_st | val aead_encrypt_st : w: Hacl.Impl.Poly1305.Fields.field_spec -> Type0 | let aead_encrypt_st (w:field_spec) =
output:buffer uint8
-> tag:lbuffer uint8 16ul
-> input:buffer uint8
-> input_len:size_t { length input = v input_len /\ length output = v input_len }
-> data:buffer uint8
-> data_len:size_t { length data = v data_len }
-> key:lbuffer uint8 32ul
-> nonce:lbuffer uint8 12ul ->
Stack unit
(requires fun h ->
live h key /\ live h nonce /\ live h data /\
live h input /\ live h output /\ live h tag /\
disjoint key output /\ disjoint nonce output /\
disjoint key tag /\ disjoint nonce tag /\
disjoint output tag /\
eq_or_disjoint (input <: lbuffer uint8 input_len) (output <: lbuffer uint8 input_len) /\
disjoint data output)
(ensures fun h0 _ h1 -> modifies2 output tag h0 h1 /\
Seq.append (as_seq h1 (output <: lbuffer uint8 input_len)) (as_seq h1 tag) ==
Spec.aead_encrypt (as_seq h0 key) (as_seq h0 nonce) (as_seq h0 (input <: lbuffer uint8 input_len)) (as_seq h0 (data <: lbuffer uint8 data_len))) | {
"file_name": "code/chacha20poly1305/Hacl.Impl.Chacha20Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 148,
"end_line": 165,
"start_col": 0,
"start_line": 145
} | module Hacl.Impl.Chacha20Poly1305
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Hacl.Impl.Chacha20Poly1305.PolyCore
open Hacl.Impl.Poly1305.Fields
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module Spec = Spec.Chacha20Poly1305
module SpecPoly = Spec.Poly1305
module Poly = Hacl.Impl.Poly1305
#reset-options "--z3rlimit 150 --max_fuel 0 --max_ifuel 1 --record_options"
val poly1305_do_:
#w:field_spec
-> k:lbuffer uint8 32ul // key
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen // authenticated additional data
-> mlen:size_t
-> m:lbuffer uint8 mlen // plaintext
-> ctx:Poly.poly1305_ctx w
-> block:lbuffer uint8 16ul ->
Stack unit
(requires fun h ->
live h k /\ live h aad /\ live h m /\ live h ctx /\ live h block /\
disjoint ctx k /\ disjoint ctx aad /\ disjoint ctx m /\ disjoint ctx block /\
disjoint block k /\ disjoint block aad /\ disjoint block m)
(ensures fun h0 _ h1 ->
modifies (loc ctx |+| loc block) h0 h1 /\
(let acc, r = SpecPoly.poly1305_init (as_seq h0 k) in
let acc = if (length aad <> 0) then Spec.poly1305_padded r (as_seq h0 aad) acc else acc in
let acc = if (length m <> 0) then Spec.poly1305_padded r (as_seq h0 m) acc else acc in
let block_s = LSeq.concat (BSeq.uint_to_bytes_le #U64 (u64 (length aad)))
(BSeq.uint_to_bytes_le #U64 (u64 (length m))) in
let acc = SpecPoly.poly1305_update1 r 16 block_s acc in
Poly.as_get_acc h1 ctx == acc /\ as_seq h1 block == block_s /\
Poly.state_inv_t h1 ctx))
[@Meta.Attribute.inline_]
let poly1305_do_ #w k aadlen aad mlen m ctx block =
Poly.poly1305_init ctx k;
if (aadlen <> 0ul) then (
poly1305_padded ctx aadlen aad)
else ();
if (mlen <> 0ul) then (
poly1305_padded ctx mlen m)
else ();
let h0 = ST.get () in
update_sub_f h0 block 0ul 8ul
(fun h -> BSeq.uint_to_bytes_le #U64 (to_u64 aadlen))
(fun _ -> uint_to_bytes_le (sub block 0ul 8ul) (to_u64 aadlen));
let h1 = ST.get () in
//assert (LSeq.sub (as_seq h1 block) 0 8 == BSeq.uint_to_bytes_le #U64 (to_u64 aadlen));
Poly.reveal_ctx_inv ctx h0 h1;
update_sub_f h1 block 8ul 8ul
(fun h -> BSeq.uint_to_bytes_le #U64 (to_u64 mlen))
(fun _ -> uint_to_bytes_le (sub block 8ul 8ul) (to_u64 mlen));
let h2 = ST.get () in
//assert (LSeq.sub (as_seq h2 block) 8 8 == BSeq.uint_to_bytes_le #U64 (to_u64 mlen));
LSeq.eq_intro (LSeq.sub (as_seq h2 block) 0 8) (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen));
LSeq.lemma_concat2 8 (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen)) 8 (BSeq.uint_to_bytes_le #U64 (to_u64 mlen)) (as_seq h2 block);
//assert (as_seq h2 block == LSeq.concat (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen)) (BSeq.uint_to_bytes_le #U64 (to_u64 mlen)));
Poly.reveal_ctx_inv ctx h1 h2;
Poly.poly1305_update1 ctx block
// Implements the actual poly1305_do operation
inline_for_extraction noextract
let poly1305_do_core_st (w:field_spec) =
k:lbuffer uint8 32ul // key
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen // authenticated additional data
-> mlen:size_t
-> m:lbuffer uint8 mlen // plaintext
-> out:lbuffer uint8 16ul -> // output: tag
Stack unit
(requires fun h ->
live h k /\ live h aad /\ live h m /\ live h out /\
disjoint k out)
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
as_seq h1 out == Spec.poly1305_do (as_seq h0 k) (as_seq h0 m) (as_seq h0 aad))
noextract
val poly1305_do: #w:field_spec -> poly1305_do_core_st w
[@Meta.Attribute.specialize]
let poly1305_do #w k aadlen aad mlen m out =
push_frame();
let ctx = create (nlimb w +! precomplen w) (limb_zero w) in
let block = create 16ul (u8 0) in
poly1305_do_ #w k aadlen aad mlen m ctx block;
Poly.poly1305_finish out k ctx;
pop_frame()
unfold noextract
let width_chacha20 (s:field_spec) : Hacl.Spec.Chacha20.Vec.lanes =
match s with
| M32 -> 1
| M128 -> 4
| M256 -> 8
[@ Meta.Attribute.specialize ]
assume val chacha20_encrypt: #w:field_spec ->
Hacl.Impl.Chacha20.Vec.chacha20_encrypt_st (width_chacha20 w)
// Derives the key, and then perform poly1305
val derive_key_poly1305_do:
#w:field_spec
-> k:lbuffer uint8 32ul
-> n:lbuffer uint8 12ul
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen
-> mlen:size_t
-> m:lbuffer uint8 mlen
-> out:lbuffer uint8 16ul ->
Stack unit
(requires fun h ->
live h k /\ live h n /\ live h aad /\ live h m /\ live h out)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
(let key:LSeq.lseq uint8 64 = Spec.Chacha20.chacha20_encrypt_bytes (as_seq h0 k) (as_seq h0 n) 0 (LSeq.create 64 (u8 0)) in
as_seq h1 out == Spec.poly1305_do (LSeq.sub key 0 32) (as_seq h0 m) (as_seq h0 aad)))
[@ Meta.Attribute.inline_ ]
let derive_key_poly1305_do #w k n aadlen aad mlen m out =
push_frame ();
// Create a new buffer to derive the key
let tmp = create 64ul (u8 0) in
chacha20_encrypt #w 64ul tmp tmp k n 0ul;
// The derived key should only be the first 32 bytes
let key = sub tmp 0ul 32ul in
poly1305_do #w key aadlen aad mlen m out;
pop_frame() | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"Spec.Chacha20Poly1305.fst.checked",
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"Hacl.Impl.Chacha20Poly1305.PolyCore.fst.checked",
"Hacl.Impl.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20Poly1305.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "Poly"
},
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "SpecPoly"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20Poly1305",
"short_module": "Spec"
},
{
"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": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20Poly1305.PolyCore",
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 150,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | w: Hacl.Impl.Poly1305.Fields.field_spec -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Hacl.Impl.Poly1305.Fields.field_spec",
"Lib.Buffer.buffer",
"Lib.IntTypes.uint8",
"Lib.Buffer.lbuffer",
"FStar.UInt32.__uint_to_t",
"Lib.IntTypes.size_t",
"Prims.l_and",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"Prims.op_GreaterThanOrEqual",
"Lib.IntTypes.range",
"Lib.IntTypes.U32",
"Lib.Buffer.length",
"Lib.Buffer.MUT",
"Lib.IntTypes.v",
"Lib.IntTypes.PUB",
"Prims.unit",
"FStar.Monotonic.HyperStack.mem",
"Lib.Buffer.live",
"Lib.Buffer.disjoint",
"Lib.Buffer.eq_or_disjoint",
"Lib.Buffer.modifies2",
"Prims.eq2",
"FStar.Seq.Base.seq",
"Lib.IntTypes.uint_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"FStar.Seq.Base.append",
"Lib.Buffer.as_seq",
"Spec.Chacha20Poly1305.aead_encrypt"
] | [] | false | false | false | true | true | let aead_encrypt_st (w: field_spec) =
|
output: buffer uint8 ->
tag: lbuffer uint8 16ul ->
input: buffer uint8 ->
input_len: size_t{length input = v input_len /\ length output = v input_len} ->
data: buffer uint8 ->
data_len: size_t{length data = v data_len} ->
key: lbuffer uint8 32ul ->
nonce: lbuffer uint8 12ul
-> Stack unit
(requires
fun h ->
live h key /\ live h nonce /\ live h data /\ live h input /\ live h output /\ live h tag /\
disjoint key output /\ disjoint nonce output /\ disjoint key tag /\ disjoint nonce tag /\
disjoint output tag /\
eq_or_disjoint (input <: lbuffer uint8 input_len) (output <: lbuffer uint8 input_len) /\
disjoint data output)
(ensures
fun h0 _ h1 ->
modifies2 output tag h0 h1 /\
Seq.append (as_seq h1 (output <: lbuffer uint8 input_len)) (as_seq h1 tag) ==
Spec.aead_encrypt (as_seq h0 key)
(as_seq h0 nonce)
(as_seq h0 (input <: lbuffer uint8 input_len))
(as_seq h0 (data <: lbuffer uint8 data_len))) | false |
|
FStar.Array.fsti | FStar.Array.addr_of | val addr_of (#a: Type0) (arr: array a) : GTot nat | val addr_of (#a: Type0) (arr: array a) : GTot nat | let addr_of (#a:Type0) (arr:array a) : GTot nat = addr_of (as_ref arr) | {
"file_name": "ulib/legacy/FStar.Array.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 70,
"end_line": 43,
"start_col": 0,
"start_line": 43
} | (*
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.Array
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
open FStar.All
open FStar.Seq
open FStar.Ref
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
val array (a:Type0) : Type0
val as_ref (#a:Type0) (arr:array a) : GTot (ref (seq a))
let sel (#a:Type0) (h:heap) (s:array a) : GTot (seq a) = Heap.sel h (as_ref s)
let contains (#a:Type0) (h:heap) (s:array a) : Type0 = Heap.contains h (as_ref s)
let unused_in (#a:Type0) (arr:array a) (h:heap) : Type0 = Heap.unused_in (as_ref arr) h
let heap_upd (#a:Type0) (h:heap) (r:array a) (v:seq a) : GTot heap = Heap.upd h (as_ref r) v | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Heap.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Array.fsti"
} | [
{
"abbrev": false,
"full_module": "FStar.Ref",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | arr: FStar.Array.array a -> Prims.GTot Prims.nat | Prims.GTot | [
"sometrivial"
] | [] | [
"FStar.Array.array",
"FStar.Ref.addr_of",
"FStar.Seq.Base.seq",
"FStar.Array.as_ref",
"Prims.nat"
] | [] | false | false | false | false | false | let addr_of (#a: Type0) (arr: array a) : GTot nat =
| addr_of (as_ref arr) | false |
FStar.Array.fsti | FStar.Array.heap_upd | val heap_upd (#a: Type0) (h: heap) (r: array a) (v: seq a) : GTot heap | val heap_upd (#a: Type0) (h: heap) (r: array a) (v: seq a) : GTot heap | let heap_upd (#a:Type0) (h:heap) (r:array a) (v:seq a) : GTot heap = Heap.upd h (as_ref r) v | {
"file_name": "ulib/legacy/FStar.Array.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 92,
"end_line": 41,
"start_col": 0,
"start_line": 41
} | (*
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.Array
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
open FStar.All
open FStar.Seq
open FStar.Ref
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
val array (a:Type0) : Type0
val as_ref (#a:Type0) (arr:array a) : GTot (ref (seq a))
let sel (#a:Type0) (h:heap) (s:array a) : GTot (seq a) = Heap.sel h (as_ref s)
let contains (#a:Type0) (h:heap) (s:array a) : Type0 = Heap.contains h (as_ref s)
let unused_in (#a:Type0) (arr:array a) (h:heap) : Type0 = Heap.unused_in (as_ref arr) h | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Heap.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Array.fsti"
} | [
{
"abbrev": false,
"full_module": "FStar.Ref",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | h: FStar.Monotonic.Heap.heap -> r: FStar.Array.array a -> v: FStar.Seq.Base.seq a
-> Prims.GTot FStar.Monotonic.Heap.heap | Prims.GTot | [
"sometrivial"
] | [] | [
"FStar.Monotonic.Heap.heap",
"FStar.Array.array",
"FStar.Seq.Base.seq",
"FStar.Monotonic.Heap.upd",
"FStar.Heap.trivial_preorder",
"FStar.Array.as_ref"
] | [] | false | false | false | false | false | let heap_upd (#a: Type0) (h: heap) (r: array a) (v: seq a) : GTot heap =
| Heap.upd h (as_ref r) v | false |
FStar.Array.fsti | FStar.Array.unused_in | val unused_in (#a: Type0) (arr: array a) (h: heap) : Type0 | val unused_in (#a: Type0) (arr: array a) (h: heap) : Type0 | let unused_in (#a:Type0) (arr:array a) (h:heap) : Type0 = Heap.unused_in (as_ref arr) h | {
"file_name": "ulib/legacy/FStar.Array.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 87,
"end_line": 39,
"start_col": 0,
"start_line": 39
} | (*
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.Array
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
open FStar.All
open FStar.Seq
open FStar.Ref
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
val array (a:Type0) : Type0
val as_ref (#a:Type0) (arr:array a) : GTot (ref (seq a))
let sel (#a:Type0) (h:heap) (s:array a) : GTot (seq a) = Heap.sel h (as_ref s)
let contains (#a:Type0) (h:heap) (s:array a) : Type0 = Heap.contains h (as_ref s) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Heap.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Array.fsti"
} | [
{
"abbrev": false,
"full_module": "FStar.Ref",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | arr: FStar.Array.array a -> h: FStar.Monotonic.Heap.heap -> Type0 | Prims.Tot | [
"total"
] | [] | [
"FStar.Array.array",
"FStar.Monotonic.Heap.heap",
"FStar.Monotonic.Heap.unused_in",
"FStar.Seq.Base.seq",
"FStar.Heap.trivial_preorder",
"FStar.Array.as_ref"
] | [] | false | false | false | true | true | let unused_in (#a: Type0) (arr: array a) (h: heap) : Type0 =
| Heap.unused_in (as_ref arr) h | false |
Hacl.Impl.Chacha20Poly1305.fst | Hacl.Impl.Chacha20Poly1305.aead_decrypt_st | val aead_decrypt_st : w: Hacl.Impl.Poly1305.Fields.field_spec -> Type0 | let aead_decrypt_st (w:field_spec) =
output:buffer uint8
-> input:buffer uint8
-> input_len:size_t { length input = v input_len /\ length output = v input_len }
-> data:buffer uint8
-> data_len:size_t { length data = v data_len }
-> key:lbuffer uint8 32ul
-> nonce:lbuffer uint8 12ul
-> tag:lbuffer uint8 16ul ->
Stack UInt32.t
(requires fun h ->
live h key /\ live h nonce /\ live h (data <: lbuffer uint8 data_len) /\
live h input /\ live h output /\ live h tag /\
eq_or_disjoint (input <: lbuffer uint8 input_len) (output <: lbuffer uint8 input_len))
(ensures fun h0 z h1 -> modifies1 output h0 h1 /\
(let plain = Spec.aead_decrypt (as_seq h0 key) (as_seq h0 nonce) (as_seq h0 (input <: lbuffer uint8 input_len)) (as_seq h0 tag) (as_seq h0 (data <: lbuffer uint8 data_len)) in
match z with
| 0ul -> Some? plain /\ as_seq h1 (output <: lbuffer uint8 input_len) == Some?.v plain // decryption succeeded
| 1ul -> None? plain
| _ -> false) // decryption failed
) | {
"file_name": "code/chacha20poly1305/Hacl.Impl.Chacha20Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 198,
"start_col": 0,
"start_line": 178
} | module Hacl.Impl.Chacha20Poly1305
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Hacl.Impl.Chacha20Poly1305.PolyCore
open Hacl.Impl.Poly1305.Fields
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module Spec = Spec.Chacha20Poly1305
module SpecPoly = Spec.Poly1305
module Poly = Hacl.Impl.Poly1305
#reset-options "--z3rlimit 150 --max_fuel 0 --max_ifuel 1 --record_options"
val poly1305_do_:
#w:field_spec
-> k:lbuffer uint8 32ul // key
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen // authenticated additional data
-> mlen:size_t
-> m:lbuffer uint8 mlen // plaintext
-> ctx:Poly.poly1305_ctx w
-> block:lbuffer uint8 16ul ->
Stack unit
(requires fun h ->
live h k /\ live h aad /\ live h m /\ live h ctx /\ live h block /\
disjoint ctx k /\ disjoint ctx aad /\ disjoint ctx m /\ disjoint ctx block /\
disjoint block k /\ disjoint block aad /\ disjoint block m)
(ensures fun h0 _ h1 ->
modifies (loc ctx |+| loc block) h0 h1 /\
(let acc, r = SpecPoly.poly1305_init (as_seq h0 k) in
let acc = if (length aad <> 0) then Spec.poly1305_padded r (as_seq h0 aad) acc else acc in
let acc = if (length m <> 0) then Spec.poly1305_padded r (as_seq h0 m) acc else acc in
let block_s = LSeq.concat (BSeq.uint_to_bytes_le #U64 (u64 (length aad)))
(BSeq.uint_to_bytes_le #U64 (u64 (length m))) in
let acc = SpecPoly.poly1305_update1 r 16 block_s acc in
Poly.as_get_acc h1 ctx == acc /\ as_seq h1 block == block_s /\
Poly.state_inv_t h1 ctx))
[@Meta.Attribute.inline_]
let poly1305_do_ #w k aadlen aad mlen m ctx block =
Poly.poly1305_init ctx k;
if (aadlen <> 0ul) then (
poly1305_padded ctx aadlen aad)
else ();
if (mlen <> 0ul) then (
poly1305_padded ctx mlen m)
else ();
let h0 = ST.get () in
update_sub_f h0 block 0ul 8ul
(fun h -> BSeq.uint_to_bytes_le #U64 (to_u64 aadlen))
(fun _ -> uint_to_bytes_le (sub block 0ul 8ul) (to_u64 aadlen));
let h1 = ST.get () in
//assert (LSeq.sub (as_seq h1 block) 0 8 == BSeq.uint_to_bytes_le #U64 (to_u64 aadlen));
Poly.reveal_ctx_inv ctx h0 h1;
update_sub_f h1 block 8ul 8ul
(fun h -> BSeq.uint_to_bytes_le #U64 (to_u64 mlen))
(fun _ -> uint_to_bytes_le (sub block 8ul 8ul) (to_u64 mlen));
let h2 = ST.get () in
//assert (LSeq.sub (as_seq h2 block) 8 8 == BSeq.uint_to_bytes_le #U64 (to_u64 mlen));
LSeq.eq_intro (LSeq.sub (as_seq h2 block) 0 8) (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen));
LSeq.lemma_concat2 8 (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen)) 8 (BSeq.uint_to_bytes_le #U64 (to_u64 mlen)) (as_seq h2 block);
//assert (as_seq h2 block == LSeq.concat (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen)) (BSeq.uint_to_bytes_le #U64 (to_u64 mlen)));
Poly.reveal_ctx_inv ctx h1 h2;
Poly.poly1305_update1 ctx block
// Implements the actual poly1305_do operation
inline_for_extraction noextract
let poly1305_do_core_st (w:field_spec) =
k:lbuffer uint8 32ul // key
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen // authenticated additional data
-> mlen:size_t
-> m:lbuffer uint8 mlen // plaintext
-> out:lbuffer uint8 16ul -> // output: tag
Stack unit
(requires fun h ->
live h k /\ live h aad /\ live h m /\ live h out /\
disjoint k out)
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
as_seq h1 out == Spec.poly1305_do (as_seq h0 k) (as_seq h0 m) (as_seq h0 aad))
noextract
val poly1305_do: #w:field_spec -> poly1305_do_core_st w
[@Meta.Attribute.specialize]
let poly1305_do #w k aadlen aad mlen m out =
push_frame();
let ctx = create (nlimb w +! precomplen w) (limb_zero w) in
let block = create 16ul (u8 0) in
poly1305_do_ #w k aadlen aad mlen m ctx block;
Poly.poly1305_finish out k ctx;
pop_frame()
unfold noextract
let width_chacha20 (s:field_spec) : Hacl.Spec.Chacha20.Vec.lanes =
match s with
| M32 -> 1
| M128 -> 4
| M256 -> 8
[@ Meta.Attribute.specialize ]
assume val chacha20_encrypt: #w:field_spec ->
Hacl.Impl.Chacha20.Vec.chacha20_encrypt_st (width_chacha20 w)
// Derives the key, and then perform poly1305
val derive_key_poly1305_do:
#w:field_spec
-> k:lbuffer uint8 32ul
-> n:lbuffer uint8 12ul
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen
-> mlen:size_t
-> m:lbuffer uint8 mlen
-> out:lbuffer uint8 16ul ->
Stack unit
(requires fun h ->
live h k /\ live h n /\ live h aad /\ live h m /\ live h out)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
(let key:LSeq.lseq uint8 64 = Spec.Chacha20.chacha20_encrypt_bytes (as_seq h0 k) (as_seq h0 n) 0 (LSeq.create 64 (u8 0)) in
as_seq h1 out == Spec.poly1305_do (LSeq.sub key 0 32) (as_seq h0 m) (as_seq h0 aad)))
[@ Meta.Attribute.inline_ ]
let derive_key_poly1305_do #w k n aadlen aad mlen m out =
push_frame ();
// Create a new buffer to derive the key
let tmp = create 64ul (u8 0) in
chacha20_encrypt #w 64ul tmp tmp k n 0ul;
// The derived key should only be the first 32 bytes
let key = sub tmp 0ul 32ul in
poly1305_do #w key aadlen aad mlen m out;
pop_frame()
inline_for_extraction noextract
let aead_encrypt_st (w:field_spec) =
output:buffer uint8
-> tag:lbuffer uint8 16ul
-> input:buffer uint8
-> input_len:size_t { length input = v input_len /\ length output = v input_len }
-> data:buffer uint8
-> data_len:size_t { length data = v data_len }
-> key:lbuffer uint8 32ul
-> nonce:lbuffer uint8 12ul ->
Stack unit
(requires fun h ->
live h key /\ live h nonce /\ live h data /\
live h input /\ live h output /\ live h tag /\
disjoint key output /\ disjoint nonce output /\
disjoint key tag /\ disjoint nonce tag /\
disjoint output tag /\
eq_or_disjoint (input <: lbuffer uint8 input_len) (output <: lbuffer uint8 input_len) /\
disjoint data output)
(ensures fun h0 _ h1 -> modifies2 output tag h0 h1 /\
Seq.append (as_seq h1 (output <: lbuffer uint8 input_len)) (as_seq h1 tag) ==
Spec.aead_encrypt (as_seq h0 key) (as_seq h0 nonce) (as_seq h0 (input <: lbuffer uint8 input_len)) (as_seq h0 (data <: lbuffer uint8 data_len)))
noextract
val aead_encrypt: #w:field_spec -> aead_encrypt_st w
[@ Meta.Attribute.specialize ]
let aead_encrypt #w output tag input input_len data data_len key nonce =
chacha20_encrypt #w input_len output input key nonce 1ul;
derive_key_poly1305_do #w key nonce data_len data input_len output tag | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"Spec.Chacha20Poly1305.fst.checked",
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"Hacl.Impl.Chacha20Poly1305.PolyCore.fst.checked",
"Hacl.Impl.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20Poly1305.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "Poly"
},
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "SpecPoly"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20Poly1305",
"short_module": "Spec"
},
{
"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": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20Poly1305.PolyCore",
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 150,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | w: Hacl.Impl.Poly1305.Fields.field_spec -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Hacl.Impl.Poly1305.Fields.field_spec",
"Lib.Buffer.buffer",
"Lib.IntTypes.uint8",
"Lib.IntTypes.size_t",
"Prims.l_and",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"Prims.op_GreaterThanOrEqual",
"Lib.IntTypes.range",
"Lib.IntTypes.U32",
"Lib.Buffer.length",
"Lib.Buffer.MUT",
"Lib.IntTypes.v",
"Lib.IntTypes.PUB",
"Lib.Buffer.lbuffer",
"FStar.UInt32.__uint_to_t",
"FStar.UInt32.t",
"FStar.Monotonic.HyperStack.mem",
"Lib.Buffer.live",
"Lib.Buffer.eq_or_disjoint",
"Lib.Buffer.modifies1",
"FStar.Pervasives.Native.uu___is_Some",
"Lib.ByteSequence.lbytes",
"Lib.Sequence.length",
"Lib.IntTypes.uint_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Lib.Buffer.as_seq",
"Prims.eq2",
"Lib.Sequence.seq",
"Prims.nat",
"FStar.Seq.Base.length",
"FStar.Pervasives.Native.__proj__Some__item__v",
"FStar.Pervasives.Native.uu___is_None",
"Prims.logical",
"FStar.Pervasives.Native.option",
"Lib.Sequence.lseq",
"Lib.IntTypes.int_t",
"Spec.Chacha20Poly1305.aead_decrypt"
] | [] | false | false | false | true | true | let aead_decrypt_st (w: field_spec) =
|
output: buffer uint8 ->
input: buffer uint8 ->
input_len: size_t{length input = v input_len /\ length output = v input_len} ->
data: buffer uint8 ->
data_len: size_t{length data = v data_len} ->
key: lbuffer uint8 32ul ->
nonce: lbuffer uint8 12ul ->
tag: lbuffer uint8 16ul
-> Stack UInt32.t
(requires
fun h ->
live h key /\ live h nonce /\ live h (data <: lbuffer uint8 data_len) /\ live h input /\
live h output /\ live h tag /\
eq_or_disjoint (input <: lbuffer uint8 input_len) (output <: lbuffer uint8 input_len))
(ensures
fun h0 z h1 ->
modifies1 output h0 h1 /\
(let plain =
Spec.aead_decrypt (as_seq h0 key)
(as_seq h0 nonce)
(as_seq h0 (input <: lbuffer uint8 input_len))
(as_seq h0 tag)
(as_seq h0 (data <: lbuffer uint8 data_len))
in
match z with
| 0ul -> Some? plain /\ as_seq h1 (output <: lbuffer uint8 input_len) == Some?.v plain
| 1ul -> None? plain
| _ -> false)) | false |
|
Even.fst | Even.nat2unary | val nat2unary (n: nat) : Tot unat | val nat2unary (n: nat) : Tot unat | let rec nat2unary (n: nat) : Tot unat = if n = 0 then Z else S (nat2unary (n - 1)) | {
"file_name": "examples/tactics/Even.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 82,
"end_line": 21,
"start_col": 0,
"start_line": 21
} | (*
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 Even
open FStar.Tactics.V2 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Even.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | n: Prims.nat -> Even.unat | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Prims.op_Equality",
"Prims.int",
"Even.Z",
"Prims.bool",
"Even.S",
"Even.nat2unary",
"Prims.op_Subtraction",
"Even.unat"
] | [
"recursion"
] | false | false | false | true | false | let rec nat2unary (n: nat) : Tot unat =
| if n = 0 then Z else S (nat2unary (n - 1)) | false |
FStar.Array.fsti | FStar.Array.create_post | val create_post: #a: Type0 -> s: seq a -> heap -> array a -> heap -> Type0 | val create_post: #a: Type0 -> s: seq a -> heap -> array a -> heap -> Type0 | let create_post (#a:Type0) (s:seq a)
: heap -> array a -> heap -> Type0
= fun h0 x h1 ->
x `unused_in` h0 /\
contains h1 x /\
modifies Set.empty h0 h1 /\
sel h1 x== s | {
"file_name": "ulib/legacy/FStar.Array.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 14,
"end_line": 60,
"start_col": 7,
"start_line": 54
} | (*
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.Array
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
open FStar.All
open FStar.Seq
open FStar.Ref
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
val array (a:Type0) : Type0
val as_ref (#a:Type0) (arr:array a) : GTot (ref (seq a))
let sel (#a:Type0) (h:heap) (s:array a) : GTot (seq a) = Heap.sel h (as_ref s)
let contains (#a:Type0) (h:heap) (s:array a) : Type0 = Heap.contains h (as_ref s)
let unused_in (#a:Type0) (arr:array a) (h:heap) : Type0 = Heap.unused_in (as_ref arr) h
let heap_upd (#a:Type0) (h:heap) (r:array a) (v:seq a) : GTot heap = Heap.upd h (as_ref r) v
let addr_of (#a:Type0) (arr:array a) : GTot nat = addr_of (as_ref arr)
let only (#a:Type0) (arr:array a) : GTot (Set.set nat) = Set.singleton (addr_of arr)
val op_At_Bar (#a:Type0) (s1:array a) (s2:array a)
: ST (array a)
(requires (fun h -> contains h s1 /\ contains h s2))
(ensures (fun h0 s h1 -> contains h0 s1 /\ contains h0 s2 /\ contains h1 s /\
sel h1 s == Seq.append (sel h0 s1) (sel h0 s2) /\
modifies Set.empty h0 h1)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Heap.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Array.fsti"
} | [
{
"abbrev": false,
"full_module": "FStar.Ref",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
s: FStar.Seq.Base.seq a ->
_: FStar.Monotonic.Heap.heap ->
_: FStar.Array.array a ->
_: FStar.Monotonic.Heap.heap
-> Type0 | Prims.Tot | [
"total"
] | [] | [
"FStar.Seq.Base.seq",
"FStar.Monotonic.Heap.heap",
"FStar.Array.array",
"Prims.l_and",
"FStar.Array.unused_in",
"FStar.Array.contains",
"FStar.Monotonic.Heap.modifies",
"FStar.Set.empty",
"Prims.nat",
"Prims.eq2",
"FStar.Array.sel"
] | [] | false | false | false | true | true | let create_post (#a: Type0) (s: seq a) : heap -> array a -> heap -> Type0 =
| fun h0 x h1 -> x `unused_in` h0 /\ contains h1 x /\ modifies Set.empty h0 h1 /\ sel h1 x == s | false |
FStar.Array.fsti | FStar.Array.only | val only (#a: Type0) (arr: array a) : GTot (Set.set nat) | val only (#a: Type0) (arr: array a) : GTot (Set.set nat) | let only (#a:Type0) (arr:array a) : GTot (Set.set nat) = Set.singleton (addr_of arr) | {
"file_name": "ulib/legacy/FStar.Array.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 84,
"end_line": 45,
"start_col": 0,
"start_line": 45
} | (*
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.Array
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
open FStar.All
open FStar.Seq
open FStar.Ref
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
val array (a:Type0) : Type0
val as_ref (#a:Type0) (arr:array a) : GTot (ref (seq a))
let sel (#a:Type0) (h:heap) (s:array a) : GTot (seq a) = Heap.sel h (as_ref s)
let contains (#a:Type0) (h:heap) (s:array a) : Type0 = Heap.contains h (as_ref s)
let unused_in (#a:Type0) (arr:array a) (h:heap) : Type0 = Heap.unused_in (as_ref arr) h
let heap_upd (#a:Type0) (h:heap) (r:array a) (v:seq a) : GTot heap = Heap.upd h (as_ref r) v
let addr_of (#a:Type0) (arr:array a) : GTot nat = addr_of (as_ref arr) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Heap.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Array.fsti"
} | [
{
"abbrev": false,
"full_module": "FStar.Ref",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | arr: FStar.Array.array a -> Prims.GTot (FStar.Set.set Prims.nat) | Prims.GTot | [
"sometrivial"
] | [] | [
"FStar.Array.array",
"FStar.Set.singleton",
"Prims.nat",
"FStar.Array.addr_of",
"FStar.Set.set"
] | [] | false | false | false | false | false | let only (#a: Type0) (arr: array a) : GTot (Set.set nat) =
| Set.singleton (addr_of arr) | false |
Hacl.Spec.K256.Field52.Lemmas4.fst | Hacl.Spec.K256.Field52.Lemmas4.lemma_fmul_simplify | val lemma_fmul_simplify
(r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3
a0 a1 a2 a3 a4 b0 b1 b2 b3 b4:nat) : Lemma
(requires (
let r = 0x1000003D10 in
let sum0 = a0 * b0 in
let sum1 = a0 * b1 + a1 * b0 in
let sum2 = a0 * b2 + a1 * b1 + a2 * b0 in
let sum3 = a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0 in
let sum4 = a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0 in
let sum5 = a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 in
let sum6 = a2 * b4 + a3 * b3 + a4 * b2 in
let sum7 = a3 * b4 + a4 * b3 in
let sum8 = a4 * b4 in
d4 = (sum3 + r * (sum8 % pow2 64)) / pow2 52 + sum4 + r * pow2 12 * (sum8 / pow2 64) /\
t3 = (sum3 + r * (sum8 % pow2 64)) % pow2 52 /\
d8 = (d4 / pow2 52 + sum5) / pow2 52 + sum6 /\
c3 = sum0 + ((d4 % pow2 52) / pow2 48 + ((d4 / pow2 52 + sum5) % pow2 52) * pow2 4) * (r / pow2 4) /\
d10 = d8 / pow2 52 + sum7 /\
r0 = c3 % pow2 52 /\ c6 = c3 / pow2 52 + sum1 + d8 % pow2 52 * r /\
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48))
(ensures
(r0 + r1 * pow52 + r2 * pow104 + r3 * pow156 + r4 * pow208) % S.prime =
(a0 + a1 * pow52 + a2 * pow104 + a3 * pow156 + a4 * pow208) *
(b0 + b1 * pow52 + b2 * pow104 + b3 * pow156 + b4 * pow208) % S.prime) | val lemma_fmul_simplify
(r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3
a0 a1 a2 a3 a4 b0 b1 b2 b3 b4:nat) : Lemma
(requires (
let r = 0x1000003D10 in
let sum0 = a0 * b0 in
let sum1 = a0 * b1 + a1 * b0 in
let sum2 = a0 * b2 + a1 * b1 + a2 * b0 in
let sum3 = a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0 in
let sum4 = a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0 in
let sum5 = a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 in
let sum6 = a2 * b4 + a3 * b3 + a4 * b2 in
let sum7 = a3 * b4 + a4 * b3 in
let sum8 = a4 * b4 in
d4 = (sum3 + r * (sum8 % pow2 64)) / pow2 52 + sum4 + r * pow2 12 * (sum8 / pow2 64) /\
t3 = (sum3 + r * (sum8 % pow2 64)) % pow2 52 /\
d8 = (d4 / pow2 52 + sum5) / pow2 52 + sum6 /\
c3 = sum0 + ((d4 % pow2 52) / pow2 48 + ((d4 / pow2 52 + sum5) % pow2 52) * pow2 4) * (r / pow2 4) /\
d10 = d8 / pow2 52 + sum7 /\
r0 = c3 % pow2 52 /\ c6 = c3 / pow2 52 + sum1 + d8 % pow2 52 * r /\
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48))
(ensures
(r0 + r1 * pow52 + r2 * pow104 + r3 * pow156 + r4 * pow208) % S.prime =
(a0 + a1 * pow52 + a2 * pow104 + a3 * pow156 + a4 * pow208) *
(b0 + b1 * pow52 + b2 * pow104 + b3 * pow156 + b4 * pow208) % S.prime) | let lemma_fmul_simplify r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 a0 a1 a2 a3 a4 b0 b1 b2 b3 b4 =
let r = 0x1000003D10 in
let sum0 = a0 * b0 in
let sum1 = a0 * b1 + a1 * b0 in
let sum2 = a0 * b2 + a1 * b1 + a2 * b0 in
let sum3 = a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0 in
let sum4 = a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0 in
let sum5 = a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 in
let sum6 = a2 * b4 + a3 * b3 + a4 * b2 in
let sum7 = a3 * b4 + a4 * b3 in
let sum8 = a4 * b4 in
lemma_nat_r43210 r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 r sum1 sum2 sum7;
lemma_nat_r43210_mod_prime c3 d4 d8 t3 r sum0 sum1 sum2 sum3 sum4 sum5 sum6 sum7 sum8;
lemma_fmul_ab a0 a1 a2 a3 a4 b0 b1 b2 b3 b4 | {
"file_name": "code/k256/Hacl.Spec.K256.Field52.Lemmas4.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 45,
"end_line": 399,
"start_col": 0,
"start_line": 385
} | module Hacl.Spec.K256.Field52.Lemmas4
open FStar.Mul
open Lib.IntTypes
module S = Spec.K256
include Hacl.Spec.K256.Field52.Definitions
include Hacl.Spec.K256.Field52
module ML = Hacl.Spec.K256.MathLemmas
module LD = Hacl.Spec.K256.Field52.Definitions.Lemmas
#set-options "--z3rlimit 100 --fuel 0 --ifuel 0"
val lemma_nat_r432 (r2 r3 r4 c9 c11 d4 d11 t3 r:nat) : Lemma
(requires
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
(r4 * pow2 52 + r3) * pow2 52 + r2 =
c9 + r * d11 * pow2 64 + t3 * pow2 52 + (d4 % pow2 48) * pow2 104)
let lemma_nat_r432 r2 r3 r4 c9 c11 d4 d11 t3 r =
let k = d4 % pow2 48 in
calc (==) {
(r4 * pow2 52 + r3) * pow2 52 + r2;
(==) { Math.Lemmas.pow2_modulo_modulo_lemma_1 d4 48 52 }
((c11 / pow2 52 + k) * pow2 52 + c11 % pow2 52) * pow2 52 + r2;
(==) { ML.lemma_distr_eucl c11 k }
(c9 / pow2 52 + r * pow2 12 * d11 + t3 + k * pow2 52) * pow2 52 + c9 % pow2 52;
(==) { ML.lemma_distr_eucl c9 (r * pow2 12 * d11 + t3 + k * pow2 52) }
c9 + (r * pow2 12 * d11 + t3 + k * pow2 52) * pow2 52;
(==) { ML.lemma_distr_pow (r * pow2 12 * d11 + t3) k 52 52 }
c9 + (r * pow2 12 * d11 + t3) * pow2 52 + k * pow2 104;
(==) { ML.lemma_swap_mul3 r (pow2 12) d11 }
c9 + (r * d11 * pow2 12 + t3) * pow2 52 + k * pow2 104;
(==) { ML.lemma_distr_pow t3 (r * d11) 12 52 }
c9 + r * d11 * pow2 64 + t3 * pow2 52 + k * pow2 104;
}
val lemma_nat_r4321 (r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2:nat) : Lemma
(requires
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1 =
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + t3 * pow2 104 + (d4 % pow2 48) * pow2 156)
let lemma_nat_r4321 r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2 =
let k = d4 % pow2 48 in
let tmp1 = t3 * pow2 52 + k * pow2 104 in
calc (==) {
((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1;
(==) { lemma_nat_r432 r2 r3 r4 c9 c11 d4 d11 t3 r }
(c9 + r * d11 * pow2 64 + tmp1) * pow2 52 + r1;
(==) { }
(c6 / pow2 52 + sum2 + r * (d10 % pow2 64) + r * d11 * pow2 64 + tmp1) * pow2 52 + c6 % pow2 52;
(==) { ML.lemma_distr_eucl_mul r d10 (pow2 64) }
(c6 / pow2 52 + sum2 + r * d10 + tmp1) * pow2 52 + c6 % pow2 52;
(==) { ML.lemma_distr_eucl c6 (sum2 + r * d10 + tmp1) }
c6 + (sum2 + r * d10 + tmp1) * pow2 52;
(==) { Math.Lemmas.distributivity_add_left (sum2 + r * d10) tmp1 (pow2 52) }
c6 + (sum2 + r * d10) * pow2 52 + tmp1 * pow2 52;
(==) { Math.Lemmas.distributivity_add_left sum2 (r * d10) (pow2 52) }
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + tmp1 * pow2 52;
(==) { ML.lemma_distr_pow_pow t3 52 k 104 52 }
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + t3 * pow2 104 + k * pow2 156;
}
val lemma_nat_r43210 (r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 r sum1 sum2 sum7:nat) : Lemma
(requires
d10 == d8 / pow2 52 + sum7 /\
r0 = c3 % pow2 52 /\ c6 = c3 / pow2 52 + sum1 + d8 % pow2 52 * r /\
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
r0 + r1 * pow52 + r2 * pow104 + r3 * pow156 + r4 * pow208 =
c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 + t3 * pow2 156 + (d4 % pow2 48) * pow2 208)
let lemma_nat_r43210 r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 r sum1 sum2 sum7 =
let k = d4 % pow2 48 in
let tmp1 = sum2 * pow2 52 + t3 * pow2 104 + k * pow2 156 in
calc (==) { // tmp1 * pow2 52
(sum2 * pow2 52 + t3 * pow2 104 + k * pow2 156) * pow2 52;
(==) { ML.lemma_distr_pow (sum2 * pow2 52 + t3 * pow2 104) k 156 52 }
(sum2 * pow2 52 + t3 * pow2 104) * pow2 52 + k * pow2 208;
(==) { ML.lemma_distr_pow_pow sum2 52 t3 104 52 }
sum2 * pow2 104 + t3 * pow2 156 + k * pow2 208;
};
calc (==) {
r0 + r1 * pow52 + r2 * pow104 + r3 * pow156 + r4 * pow208;
(==) { ML.lemma_as_nat_horner r0 r1 r2 r3 r4 }
(((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1) * pow2 52 + r0;
(==) { lemma_nat_r4321 r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2 }
(c3 / pow2 52 + sum1 + d8 % pow2 52 * r + r * (d8 / pow2 52 + sum7) * pow2 52 + tmp1) * pow2 52 + c3 % pow2 52;
(==) { ML.lemma_distr_eucl_mul_add r d8 sum7 (pow2 52) }
(c3 / pow2 52 + sum1 + r * d8 + r * sum7 * pow2 52 + tmp1) * pow2 52 + c3 % pow2 52;
(==) { ML.lemma_distr_eucl c3 (sum1 + r * d8 + r * sum7 * pow2 52 + tmp1) }
c3 + (sum1 + r * d8 + r * sum7 * pow2 52 + tmp1) * pow2 52;
(==) { ML.lemma_distr_pow (sum1 + r * d8 + tmp1) (r * sum7) 52 52 }
c3 + (sum1 + r * d8 + tmp1) * pow2 52 + r * sum7 * pow2 104;
(==) { Math.Lemmas.distributivity_add_left (sum1 + r * d8) tmp1 (pow2 52) }
c3 + (sum1 + r * d8) * pow2 52 + sum2 * pow2 104 + t3 * pow2 156 + k * pow2 208 + r * sum7 * pow2 104;
(==) { Math.Lemmas.distributivity_add_left sum2 (r * sum7) (pow2 104) }
c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 + t3 * pow2 156 + k * pow2 208;
}
val simplify_c3 (d4 r sum5:nat) : Lemma
(requires r % pow2 4 = 0)
(ensures (let k = (d4 / pow2 52 + sum5) % pow2 52 in
((d4 % pow2 52) / pow2 48 + k * pow2 4) * (r / pow2 4) ==
(d4 / pow2 48) * (r / pow2 4) + (k - (d4 / pow2 52)) * r))
let simplify_c3 d4 r sum5 =
let k = (d4 / pow2 52 + sum5) % pow2 52 in
calc (==) { //simplify c3
((d4 % pow2 52) / pow2 48 + k * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.pow2_modulo_division_lemma_1 d4 48 52 }
((d4 / pow2 48) % pow2 4 + k * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.euclidean_division_definition (d4 / pow2 48) (pow2 4) }
(d4 / pow2 48 - (d4 / pow2 48 / pow2 4) * pow2 4 + k * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.division_multiplication_lemma d4 (pow2 48) (pow2 4); Math.Lemmas.pow2_plus 48 4 }
(d4 / pow2 48 - (d4 / pow2 52) * pow2 4 + k * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.distributivity_sub_left k (d4 / pow2 52) (pow2 4) }
(d4 / pow2 48 + (k - d4 / pow2 52) * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.distributivity_add_left (d4 / pow2 48) ((k - d4 / pow2 52) * pow2 4) (r / pow2 4) }
(d4 / pow2 48) * (r / pow2 4) + (k - d4 / pow2 52) * pow2 4 * (r / pow2 4);
(==) { Math.Lemmas.paren_mul_right (k - d4 / pow2 52) (pow2 4) (r / pow2 4); Math.Lemmas.div_exact_r r (pow2 4) }
(d4 / pow2 48) * (r / pow2 4) + (k - d4 / pow2 52) * r;
}
val lemma_nat_r43210_mod_prime (c3 d4 d8 t3 r sum0 sum1 sum2 sum3 sum4 sum5 sum6 sum7 sum8: nat) : Lemma
(requires
r = 0x1000003D10 /\
d4 = (sum3 + r * (sum8 % pow2 64)) / pow2 52 + sum4 + r * pow2 12 * (sum8 / pow2 64) /\
t3 = (sum3 + r * (sum8 % pow2 64)) % pow2 52 /\
d8 = (d4 / pow2 52 + sum5) / pow2 52 + sum6 /\
c3 = sum0 + ((d4 % pow2 52) / pow2 48 + ((d4 / pow2 52 + sum5) % pow2 52) * pow2 4) * (r / pow2 4))
(ensures
(c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 +
t3 * pow2 156 + (d4 % pow2 48) * pow2 208) % S.prime ==
(sum0 + sum5 * r + (sum1 + sum6 * r) * pow2 52 + (sum2 + r * sum7) * pow2 104 +
(sum3 + r * sum8) * pow2 156 + sum4 * pow2 208) % S.prime)
let lemma_nat_r43210_mod_prime c3 d4 d8 t3 r sum0 sum1 sum2 sum3 sum4 sum5 sum6 sum7 sum8 =
let tmp2 = sum3 + r * (sum8 % pow2 64) in
let tmp1 = d4 / pow2 52 + sum5 in
let tmp0 = sum0 + (tmp1 % pow2 52 - d4 / pow2 52) * r in
let d4mod = (d4 % pow2 48) * pow2 208 + (d4 / pow2 48) * 0x1000003D1 in
calc (==) {
c3 + (d4 % pow2 48) * pow2 208 + (sum1 + r * d8) * pow2 52;
(==) { simplify_c3 d4 r sum5; assert_norm (0x1000003D10 / pow2 4 = 0x1000003D1) }
d4mod + tmp0 + (sum1 + r * d8) * pow2 52;
(==) { Math.Lemmas.distributivity_add_left sum1 (r * d8) (pow2 52) }
d4mod + sum0 + (tmp1 % pow2 52 - d4 / pow2 52) * r + sum1 * pow2 52 + r * (tmp1 / pow2 52 + sum6) * pow2 52;
(==) { Math.Lemmas.distributivity_sub_left (tmp1 % pow2 52) (d4 / pow2 52) r }
d4mod + sum0 + (tmp1 % pow2 52) * r - d4 / pow2 52 * r + sum1 * pow2 52 + r * (tmp1 / pow2 52 + sum6) * pow2 52;
(==) { ML.lemma_distr_eucl_mul_add r tmp1 sum6 (pow2 52) }
d4mod + sum0 + r * (d4 / pow2 52 + sum5) - d4 / pow2 52 * r + sum1 * pow2 52 + r * sum6 * pow2 52;
(==) { Math.Lemmas.distributivity_add_right r (d4 / pow2 52) sum5 }
d4mod + sum0 + r * sum5 + sum1 * pow2 52 + r * sum6 * pow2 52;
(==) { Math.Lemmas.distributivity_add_left sum1 (r * sum6) (pow2 52) }
d4mod + sum0 + r * sum5 + (sum1 + r * sum6) * pow2 52;
};
calc (==) { //t3 * pow2 156 + d4 * pow2 208;
(tmp2 % pow2 52) * pow2 156 + (tmp2 / pow2 52 + sum4 + r * pow2 12 * (sum8 / pow2 64)) * pow2 208;
(==) { ML.lemma_distr_pow (tmp2 % pow2 52) (tmp2 / pow2 52 + sum4 + r * pow2 12 * (sum8 / pow2 64)) 52 156 }
(tmp2 % pow2 52 + (tmp2 / pow2 52 + sum4 + r * pow2 12 * (sum8 / pow2 64)) * pow2 52) * pow2 156;
(==) { ML.lemma_distr_eucl_mul_add 1 tmp2 (sum4 + r * pow2 12 * (sum8 / pow2 64)) (pow2 52) }
(tmp2 + (sum4 + r * pow2 12 * (sum8 / pow2 64)) * pow2 52) * pow2 156;
(==) { ML.lemma_swap_mul3 r (pow2 12) (sum8 / pow2 64) }
(tmp2 + (sum4 + r * (sum8 / pow2 64) * pow2 12) * pow2 52) * pow2 156;
(==) { ML.lemma_distr_pow sum4 (r * (sum8 / pow2 64)) 12 52 }
(sum3 + r * (sum8 % pow2 64) + sum4 * pow2 52 + r * (sum8 / pow2 64) * pow2 64) * pow2 156;
(==) { ML.lemma_distr_eucl_mul r sum8 (pow2 64) }
(sum3 + r * sum8 + sum4 * pow2 52) * pow2 156;
(==) { ML.lemma_distr_pow (sum3 + r * sum8) sum4 52 156 }
(sum3 + r * sum8) * pow2 156 + sum4 * pow2 208;
};
LD.as_nat_mod_prime (sum0 + r * sum5) (sum1 + r * sum6) (sum2 + r * sum7) t3 d4
val lemma_mul_ab (a0 a1 a2 a3 a4 b0 b1 b2 b3 b4:nat) :
Lemma
(let sum0 = a0 * b0 in
let sum1 = a0 * b1 + a1 * b0 in
let sum2 = a0 * b2 + a1 * b1 + a2 * b0 in
let sum3 = a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0 in
let sum4 = a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0 in
let sum5 = a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 in
let sum6 = a2 * b4 + a3 * b3 + a4 * b2 in
let sum7 = a3 * b4 + a4 * b3 in
let sum8 = a4 * b4 in
(a0 + a1 * pow52 + a2 * pow104 + a3 * pow156 + a4 * pow208) *
(b0 + b1 * pow52 + b2 * pow104 + b3 * pow156 + b4 * pow208) =
sum0 + sum1 * pow2 52 + sum2 * pow2 104 + sum3 * pow2 156 + sum4 * pow2 208 +
pow2 260 * (sum5 + sum6 * pow2 52 + sum7 * pow2 104 + sum8 * pow2 156))
let lemma_mul_ab a0 a1 a2 a3 a4 b0 b1 b2 b3 b4 =
let sum0 = a0 * b0 in
let sum1 = a0 * b1 + a1 * b0 in
let sum2 = a0 * b2 + a1 * b1 + a2 * b0 in
let sum3 = a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0 in
let sum4 = a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0 in
let sum5 = a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 in
let sum6 = a2 * b4 + a3 * b3 + a4 * b2 in
let sum7 = a3 * b4 + a4 * b3 in
let sum8 = a4 * b4 in
let b_sum = b0 + b1 * pow52 + b2 * pow104 + b3 * pow156 + b4 * pow208 in
calc (==) {
(a0 + a1 * pow52 + a2 * pow104 + a3 * pow156 + a4 * pow208) * b_sum;
(==) { ML.lemma_distr5 a0 (a1 * pow52) (a2 * pow104) (a3 * pow156) (a4 * pow208) b_sum }
a0 * b_sum + a1 * pow52 * b_sum + a2 * pow104 * b_sum + a3 * pow156 * b_sum + a4 * pow208 * b_sum;
(==) { ML.lemma_distr5_pow52 a0 b0 b1 b2 b3 b4 }
sum0 + a0 * b1 * pow2 52 + a0 * b2 * pow2 104 + a0 * b3 * pow2 156 + a0 * b4 * pow2 208
+ a1 * pow52 * b_sum + a2 * pow104 * b_sum + a3 * pow156 * b_sum + a4 * pow208 * b_sum;
(==) { ML.lemma_distr5_pow52_mul_pow a1 b0 b1 b2 b3 b4 52 }
sum0 + a0 * b1 * pow2 52 + a0 * b2 * pow2 104 + a0 * b3 * pow2 156 + a0 * b4 * pow2 208
+ a1 * b0 * pow2 52 + a1 * b1 * pow2 104 + a1 * b2 * pow2 156 + a1 * b3 * pow2 208 + a1 * b4 * pow2 260
+ a2 * pow104 * b_sum + a3 * pow156 * b_sum + a4 * pow208 * b_sum;
(==) { ML.lemma_distr5_pow52_mul_pow a2 b0 b1 b2 b3 b4 104 }
sum0 + a0 * b1 * pow2 52 + a0 * b2 * pow2 104 + a0 * b3 * pow2 156 + a0 * b4 * pow2 208
+ a1 * b0 * pow2 52 + a1 * b1 * pow2 104 + a1 * b2 * pow2 156 + a1 * b3 * pow2 208 + a1 * b4 * pow2 260
+ a2 * b0 * pow2 104 + a2 * b1 * pow2 156 + a2 * b2 * pow2 208 + a2 * b3 * pow2 260 + a2 * b4 * pow2 312
+ a3 * pow156 * b_sum + a4 * pow208 * b_sum;
(==) { ML.lemma_distr5_pow52_mul_pow a3 b0 b1 b2 b3 b4 156 }
sum0 + a0 * b1 * pow2 52 + a0 * b2 * pow2 104 + a0 * b3 * pow2 156 + a0 * b4 * pow2 208
+ a1 * b0 * pow2 52 + a1 * b1 * pow2 104 + a1 * b2 * pow2 156 + a1 * b3 * pow2 208 + a1 * b4 * pow2 260
+ a2 * b0 * pow2 104 + a2 * b1 * pow2 156 + a2 * b2 * pow2 208 + a2 * b3 * pow2 260 + a2 * b4 * pow2 312
+ a3 * b0 * pow2 156 + a3 * b1 * pow2 208 + a3 * b2 * pow2 260 + a3 * b3 * pow2 312 + a3 * b4 * pow2 364
+ a4 * pow208 * b_sum;
(==) { ML.lemma_distr5_pow52_mul_pow a4 b0 b1 b2 b3 b4 208 }
sum0 + a0 * b1 * pow2 52 + a0 * b2 * pow2 104 + a0 * b3 * pow2 156 + a0 * b4 * pow2 208
+ a1 * b0 * pow2 52 + a1 * b1 * pow2 104 + a1 * b2 * pow2 156 + a1 * b3 * pow2 208 + a1 * b4 * pow2 260
+ a2 * b0 * pow2 104 + a2 * b1 * pow2 156 + a2 * b2 * pow2 208 + a2 * b3 * pow2 260 + a2 * b4 * pow2 312
+ a3 * b0 * pow2 156 + a3 * b1 * pow2 208 + a3 * b2 * pow2 260 + a3 * b3 * pow2 312 + a3 * b4 * pow2 364
+ a4 * b0 * pow2 208 + a4 * b1 * pow2 260 + a4 * b2 * pow2 312 + a4 * b3 * pow2 364 + a4 * b4 * pow2 416;
(==) { Math.Lemmas.distributivity_add_left (a0 * b1) (a1 * b0) (pow2 52) }
sum0 + sum1 * pow2 52 + a0 * b2 * pow2 104 + a0 * b3 * pow2 156 + a0 * b4 * pow2 208
+ a1 * b1 * pow2 104 + a1 * b2 * pow2 156 + a1 * b3 * pow2 208 + a1 * b4 * pow2 260
+ a2 * b0 * pow2 104 + a2 * b1 * pow2 156 + a2 * b2 * pow2 208 + a2 * b3 * pow2 260 + a2 * b4 * pow2 312
+ a3 * b0 * pow2 156 + a3 * b1 * pow2 208 + a3 * b2 * pow2 260 + a3 * b3 * pow2 312 + a3 * b4 * pow2 364
+ a4 * b0 * pow2 208 + a4 * b1 * pow2 260 + a4 * b2 * pow2 312 + a4 * b3 * pow2 364 + a4 * b4 * pow2 416;
(==) { ML.lemma_distr5 (a0 * b2) (a1 * b1) (a2 * b0) 0 0 (pow2 104) }
sum0 + sum1 * pow2 52 + sum2 * pow2 104 + a0 * b3 * pow2 156 + a0 * b4 * pow2 208
+ a1 * b2 * pow2 156 + a1 * b3 * pow2 208 + a1 * b4 * pow2 260
+ a2 * b1 * pow2 156 + a2 * b2 * pow2 208 + a2 * b3 * pow2 260 + a2 * b4 * pow2 312
+ a3 * b0 * pow2 156 + a3 * b1 * pow2 208 + a3 * b2 * pow2 260 + a3 * b3 * pow2 312 + a3 * b4 * pow2 364
+ a4 * b0 * pow2 208 + a4 * b1 * pow2 260 + a4 * b2 * pow2 312 + a4 * b3 * pow2 364 + a4 * b4 * pow2 416;
(==) { ML.lemma_distr5 (a0 * b3) (a1 * b2) (a2 * b1) (a3 * b0) 0 (pow2 156) }
sum0 + sum1 * pow2 52 + sum2 * pow2 104 + sum3 * pow2 156 + a0 * b4 * pow2 208
+ a1 * b3 * pow2 208 + a1 * b4 * pow2 260
+ a2 * b2 * pow2 208 + a2 * b3 * pow2 260 + a2 * b4 * pow2 312
+ a3 * b1 * pow2 208 + a3 * b2 * pow2 260 + a3 * b3 * pow2 312 + a3 * b4 * pow2 364
+ a4 * b0 * pow2 208 + a4 * b1 * pow2 260 + a4 * b2 * pow2 312 + a4 * b3 * pow2 364 + a4 * b4 * pow2 416;
(==) { ML.lemma_distr5 (a0 * b4) (a1 * b3) (a2 * b2) (a3 * b1) (a4 * b0) (pow2 208) }
sum0 + sum1 * pow2 52 + sum2 * pow2 104 + sum3 * pow2 156 + sum4 * pow2 208
+ a1 * b4 * pow2 260
+ a2 * b3 * pow2 260 + a2 * b4 * pow2 312
+ a3 * b2 * pow2 260 + a3 * b3 * pow2 312 + a3 * b4 * pow2 364
+ a4 * b1 * pow2 260 + a4 * b2 * pow2 312 + a4 * b3 * pow2 364 + a4 * b4 * pow2 416;
(==) { ML.lemma_distr5 (a1 * b4) (a2 * b3) (a3 * b2) (a4 * b1) 0 (pow2 260) }
sum0 + sum1 * pow2 52 + sum2 * pow2 104 + sum3 * pow2 156 + sum4 * pow2 208
+ sum5 * pow2 260
+ a2 * b4 * pow2 312
+ a3 * b3 * pow2 312 + a3 * b4 * pow2 364
+ a4 * b2 * pow2 312 + a4 * b3 * pow2 364 + a4 * b4 * pow2 416;
(==) { ML.lemma_distr5 (a2 * b4) (a3 * b3) (a4 * b2) 0 0 (pow2 312) }
sum0 + sum1 * pow2 52 + sum2 * pow2 104 + sum3 * pow2 156 + sum4 * pow2 208
+ sum5 * pow2 260 + sum6 * pow2 312 + a3 * b4 * pow2 364 + a4 * b3 * pow2 364 + a4 * b4 * pow2 416;
(==) { Math.Lemmas.distributivity_add_left (a3 * b4) (a4 * b3) (pow2 364) }
sum0 + sum1 * pow2 52 + sum2 * pow2 104 + sum3 * pow2 156 + sum4 * pow2 208
+ sum5 * pow2 260 + sum6 * pow2 312 + sum7 * pow2 364 + sum8 * pow2 416;
(==) { ML.lemma_distr5_pow52_mul_pow 1 sum5 sum6 sum7 sum8 0 260 }
sum0 + sum1 * pow2 52 + sum2 * pow2 104 + sum3 * pow2 156 + sum4 * pow2 208
+ pow2 260 * (sum5 + sum6 * pow2 52 + sum7 * pow2 104 + sum8 * pow2 156);
}
val lemma_fmul_ab (a0 a1 a2 a3 a4 b0 b1 b2 b3 b4:nat) :
Lemma
(let sum0 = a0 * b0 in
let sum1 = a0 * b1 + a1 * b0 in
let sum2 = a0 * b2 + a1 * b1 + a2 * b0 in
let sum3 = a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0 in
let sum4 = a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0 in
let sum5 = a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 in
let sum6 = a2 * b4 + a3 * b3 + a4 * b2 in
let sum7 = a3 * b4 + a4 * b3 in
let sum8 = a4 * b4 in
let r = 0x1000003D10 in
(a0 + a1 * pow52 + a2 * pow104 + a3 * pow156 + a4 * pow208) *
(b0 + b1 * pow52 + b2 * pow104 + b3 * pow156 + b4 * pow208) % S.prime =
(sum0 + sum5 * r + (sum1 + sum6 * r) * pow2 52 + (sum2 + r * sum7) * pow2 104
+ (sum3 + r * sum8) * pow2 156 + sum4 * pow2 208) % S.prime)
let lemma_fmul_ab a0 a1 a2 a3 a4 b0 b1 b2 b3 b4 =
let r = 0x1000003D10 in
let sum0 = a0 * b0 in
let sum1 = a0 * b1 + a1 * b0 in
let sum2 = a0 * b2 + a1 * b1 + a2 * b0 in
let sum3 = a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0 in
let sum4 = a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0 in
let sum5 = a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 in
let sum6 = a2 * b4 + a3 * b3 + a4 * b2 in
let sum7 = a3 * b4 + a4 * b3 in
let sum8 = a4 * b4 in
let a_sum = a0 + a1 * pow52 + a2 * pow104 + a3 * pow156 + a4 * pow208 in
let b_sum = b0 + b1 * pow52 + b2 * pow104 + b3 * pow156 + b4 * pow208 in
let tmp0 = sum0 + sum1 * pow2 52 + sum2 * pow2 104 + sum3 * pow2 156 + sum4 * pow2 208 in
let tmp1 = sum5 + sum6 * pow2 52 + sum7 * pow2 104 + sum8 * pow2 156 in
calc (==) {
a_sum * b_sum % S.prime;
(==) { lemma_mul_ab a0 a1 a2 a3 a4 b0 b1 b2 b3 b4 }
(tmp0 + pow2 260 * tmp1) % S.prime;
(==) { Math.Lemmas.pow2_plus 256 4; Math.Lemmas.paren_mul_right (pow2 256) (pow2 4) tmp1 }
(tmp0 + pow2 256 * (pow2 4 * tmp1)) % S.prime;
(==) { LD.lemma_a_plus_b_mul_pow256 tmp0 (pow2 4 * tmp1) }
(tmp0 + 0x1000003D1 * (pow2 4 * tmp1)) % S.prime;
(==) { Math.Lemmas.paren_mul_right 0x1000003D1 (pow2 4) tmp1; assert_norm (0x1000003D1 * pow2 4 = r) }
(tmp0 + r * tmp1) % S.prime;
(==) { ML.lemma_distr5_pow52 r sum5 sum6 sum7 sum8 0 }
(sum0 + sum1 * pow2 52 + sum2 * pow2 104 + sum3 * pow2 156 + sum4 * pow2 208
+ r * sum5 + r * sum6 * pow2 52 + r * sum7 * pow2 104 + r * sum8 * pow2 156) % S.prime;
(==) { Math.Lemmas.distributivity_add_left sum1 (r * sum6) (pow2 52) }
(sum0 + r * sum5 + (sum1 + r * sum6) * pow2 52 + sum2 * pow2 104 + sum3 * pow2 156 + sum4 * pow2 208
+ r * sum7 * pow2 104 + r * sum8 * pow2 156) % S.prime;
(==) { Math.Lemmas.distributivity_add_left sum2 (r * sum7) (pow2 104) }
(sum0 + r * sum5 + (sum1 + r * sum6) * pow2 52 + (sum2 + r * sum7) * pow2 104
+ sum3 * pow2 156 + sum4 * pow2 208 + r * sum8 * pow2 156) % S.prime;
(==) { Math.Lemmas.distributivity_add_left sum3 (r * sum8) (pow2 156) }
(sum0 + r * sum5 + (sum1 + r * sum6) * pow2 52 + (sum2 + r * sum7) * pow2 104
+ (sum3 + r * sum8) * pow2 156 + sum4 * pow2 208) % S.prime;
}
val lemma_fmul_simplify
(r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3
a0 a1 a2 a3 a4 b0 b1 b2 b3 b4:nat) : Lemma
(requires (
let r = 0x1000003D10 in
let sum0 = a0 * b0 in
let sum1 = a0 * b1 + a1 * b0 in
let sum2 = a0 * b2 + a1 * b1 + a2 * b0 in
let sum3 = a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0 in
let sum4 = a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0 in
let sum5 = a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 in
let sum6 = a2 * b4 + a3 * b3 + a4 * b2 in
let sum7 = a3 * b4 + a4 * b3 in
let sum8 = a4 * b4 in
d4 = (sum3 + r * (sum8 % pow2 64)) / pow2 52 + sum4 + r * pow2 12 * (sum8 / pow2 64) /\
t3 = (sum3 + r * (sum8 % pow2 64)) % pow2 52 /\
d8 = (d4 / pow2 52 + sum5) / pow2 52 + sum6 /\
c3 = sum0 + ((d4 % pow2 52) / pow2 48 + ((d4 / pow2 52 + sum5) % pow2 52) * pow2 4) * (r / pow2 4) /\
d10 = d8 / pow2 52 + sum7 /\
r0 = c3 % pow2 52 /\ c6 = c3 / pow2 52 + sum1 + d8 % pow2 52 * r /\
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48))
(ensures
(r0 + r1 * pow52 + r2 * pow104 + r3 * pow156 + r4 * pow208) % S.prime =
(a0 + a1 * pow52 + a2 * pow104 + a3 * pow156 + a4 * pow208) *
(b0 + b1 * pow52 + b2 * pow104 + b3 * pow156 + b4 * pow208) % S.prime) | {
"checked_file": "/",
"dependencies": [
"Spec.K256.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.K256.MathLemmas.fst.checked",
"Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked",
"Hacl.Spec.K256.Field52.Definitions.fst.checked",
"Hacl.Spec.K256.Field52.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.K256.Field52.Lemmas4.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.Field52.Definitions.Lemmas",
"short_module": "LD"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.MathLemmas",
"short_module": "ML"
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.K256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
r0: Prims.nat ->
r1: Prims.nat ->
r2: Prims.nat ->
r3: Prims.nat ->
r4: Prims.nat ->
c3: Prims.nat ->
c6: Prims.nat ->
c9: Prims.nat ->
c11: Prims.nat ->
d4: Prims.nat ->
d8: Prims.nat ->
d10: Prims.nat ->
d11: Prims.nat ->
t3: Prims.nat ->
a0: Prims.nat ->
a1: Prims.nat ->
a2: Prims.nat ->
a3: Prims.nat ->
a4: Prims.nat ->
b0: Prims.nat ->
b1: Prims.nat ->
b2: Prims.nat ->
b3: Prims.nat ->
b4: Prims.nat
-> FStar.Pervasives.Lemma
(requires
(let r = 0x1000003D10 in
let sum0 = a0 * b0 in
let sum1 = a0 * b1 + a1 * b0 in
let sum2 = a0 * b2 + a1 * b1 + a2 * b0 in
let sum3 = a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0 in
let sum4 = a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0 in
let sum5 = a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 in
let sum6 = a2 * b4 + a3 * b3 + a4 * b2 in
let sum7 = a3 * b4 + a4 * b3 in
let sum8 = a4 * b4 in
d4 =
(sum3 + r * (sum8 % Prims.pow2 64)) / Prims.pow2 52 + sum4 +
(r * Prims.pow2 12) * (sum8 / Prims.pow2 64) /\
t3 = (sum3 + r * (sum8 % Prims.pow2 64)) % Prims.pow2 52 /\
d8 = (d4 / Prims.pow2 52 + sum5) / Prims.pow2 52 + sum6 /\
c3 =
sum0 +
(d4 % Prims.pow2 52 / Prims.pow2 48 +
((d4 / Prims.pow2 52 + sum5) % Prims.pow2 52) * Prims.pow2 4) *
(r / Prims.pow2 4) /\ d10 = d8 / Prims.pow2 52 + sum7 /\ r0 = c3 % Prims.pow2 52 /\
c6 = c3 / Prims.pow2 52 + sum1 + (d8 % Prims.pow2 52) * r /\ d11 = d10 / Prims.pow2 64 /\
r1 = c6 % Prims.pow2 52 /\ c9 = c6 / Prims.pow2 52 + sum2 + r * (d10 % Prims.pow2 64) /\
r2 = c9 % Prims.pow2 52 /\ c11 = c9 / Prims.pow2 52 + (r * Prims.pow2 12) * d11 + t3 /\
r3 = c11 % Prims.pow2 52 /\ r4 = c11 / Prims.pow2 52 + d4 % Prims.pow2 52 % Prims.pow2 48)
)
(ensures
(r0 + r1 * Hacl.Spec.K256.Field52.Definitions.pow52 +
r2 * Hacl.Spec.K256.Field52.Definitions.pow104 +
r3 * Hacl.Spec.K256.Field52.Definitions.pow156 +
r4 * Hacl.Spec.K256.Field52.Definitions.pow208) %
Spec.K256.PointOps.prime =
(a0 + a1 * Hacl.Spec.K256.Field52.Definitions.pow52 +
a2 * Hacl.Spec.K256.Field52.Definitions.pow104 +
a3 * Hacl.Spec.K256.Field52.Definitions.pow156 +
a4 * Hacl.Spec.K256.Field52.Definitions.pow208) *
(b0 + b1 * Hacl.Spec.K256.Field52.Definitions.pow52 +
b2 * Hacl.Spec.K256.Field52.Definitions.pow104 +
b3 * Hacl.Spec.K256.Field52.Definitions.pow156 +
b4 * Hacl.Spec.K256.Field52.Definitions.pow208) %
Spec.K256.PointOps.prime) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.nat",
"Hacl.Spec.K256.Field52.Lemmas4.lemma_fmul_ab",
"Prims.unit",
"Hacl.Spec.K256.Field52.Lemmas4.lemma_nat_r43210_mod_prime",
"Hacl.Spec.K256.Field52.Lemmas4.lemma_nat_r43210",
"Prims.int",
"FStar.Mul.op_Star",
"Prims.op_Addition"
] | [] | true | false | true | false | false | let lemma_fmul_simplify r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 a0 a1 a2 a3 a4 b0 b1 b2 b3 b4 =
| let r = 0x1000003D10 in
let sum0 = a0 * b0 in
let sum1 = a0 * b1 + a1 * b0 in
let sum2 = a0 * b2 + a1 * b1 + a2 * b0 in
let sum3 = a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0 in
let sum4 = a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0 in
let sum5 = a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 in
let sum6 = a2 * b4 + a3 * b3 + a4 * b2 in
let sum7 = a3 * b4 + a4 * b3 in
let sum8 = a4 * b4 in
lemma_nat_r43210 r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 r sum1 sum2 sum7;
lemma_nat_r43210_mod_prime c3 d4 d8 t3 r sum0 sum1 sum2 sum3 sum4 sum5 sum6 sum7 sum8;
lemma_fmul_ab a0 a1 a2 a3 a4 b0 b1 b2 b3 b4 | false |
While.fst | While.interpret_binop | val interpret_binop : o:binop -> a:int -> b:int -> Tot int | val interpret_binop : o:binop -> a:int -> b:int -> Tot int | let interpret_binop o a b =
match o with
| Plus -> a + b
| Minus -> a - b
| Times -> op_Multiply a b
| Max -> if a <= b then b else a | {
"file_name": "examples/rel/While.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 36,
"end_line": 34,
"start_col": 0,
"start_line": 29
} | (*
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 While
open FStar.Heap
open FStar.ST
type id = ref int
type binop =
| Plus
| Minus
| Times
| Max | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Heap.fst.checked"
],
"interface_file": false,
"source_file": "While.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | o: While.binop -> a: Prims.int -> b: Prims.int -> Prims.int | Prims.Tot | [
"total"
] | [] | [
"While.binop",
"Prims.int",
"Prims.op_Addition",
"Prims.op_Subtraction",
"Prims.op_Multiply",
"Prims.op_LessThanOrEqual",
"Prims.bool"
] | [] | false | false | false | true | false | let interpret_binop o a b =
| match o with
| Plus -> a + b
| Minus -> a - b
| Times -> op_Multiply a b
| Max -> if a <= b then b else a | false |
While.fst | While.interpret_exp | val interpret_exp : h:heap -> e:exp -> GTot int | val interpret_exp : h:heap -> e:exp -> GTot int | let rec interpret_exp h e =
match e with
| AInt i -> i
| AVar x -> sel h x
| AOp o e1 e2 ->
let a = interpret_exp h e1 in
let b = interpret_exp h e2 in
interpret_binop o a b | {
"file_name": "examples/rel/While.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 25,
"end_line": 49,
"start_col": 0,
"start_line": 42
} | (*
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 While
open FStar.Heap
open FStar.ST
type id = ref int
type binop =
| Plus
| Minus
| Times
| Max
val interpret_binop : o:binop -> a:int -> b:int -> Tot int
let interpret_binop o a b =
match o with
| Plus -> a + b
| Minus -> a - b
| Times -> op_Multiply a b
| Max -> if a <= b then b else a
noeq type exp =
| AInt : int -> exp
| AVar : id -> exp
| AOp : binop -> exp -> exp -> exp | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Heap.fst.checked"
],
"interface_file": false,
"source_file": "While.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | h: FStar.Monotonic.Heap.heap -> e: While.exp -> Prims.GTot Prims.int | Prims.GTot | [
"sometrivial"
] | [] | [
"FStar.Monotonic.Heap.heap",
"While.exp",
"Prims.int",
"While.id",
"FStar.Monotonic.Heap.sel",
"FStar.Heap.trivial_preorder",
"While.binop",
"While.interpret_binop",
"While.interpret_exp"
] | [
"recursion"
] | false | false | false | false | false | let rec interpret_exp h e =
| match e with
| AInt i -> i
| AVar x -> sel h x
| AOp o e1 e2 ->
let a = interpret_exp h e1 in
let b = interpret_exp h e2 in
interpret_binop o a b | false |
While.fst | While.decr_while | val decr_while : heap -> com -> GTot int | val decr_while : heap -> com -> GTot int | let decr_while h c =
match c with
| While c b v ->
let tmp = interpret_exp h v in
if tmp < 0 then 0 else tmp
| _ -> 0 | {
"file_name": "examples/rel/While.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 10,
"end_line": 73,
"start_col": 0,
"start_line": 68
} | (*
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 While
open FStar.Heap
open FStar.ST
type id = ref int
type binop =
| Plus
| Minus
| Times
| Max
val interpret_binop : o:binop -> a:int -> b:int -> Tot int
let interpret_binop o a b =
match o with
| Plus -> a + b
| Minus -> a - b
| Times -> op_Multiply a b
| Max -> if a <= b then b else a
noeq type exp =
| AInt : int -> exp
| AVar : id -> exp
| AOp : binop -> exp -> exp -> exp
val interpret_exp : h:heap -> e:exp -> GTot int
let rec interpret_exp h e =
match e with
| AInt i -> i
| AVar x -> sel h x
| AOp o e1 e2 ->
let a = interpret_exp h e1 in
let b = interpret_exp h e2 in
interpret_binop o a b
(* CH: This is a termination metric (natural number expression) for
showing termination of while. (Why not call it that?)
Decreasingness and positivity of this termination metric
_dynamically_ checked. *)
type variant = exp
(* type variant = e:exp{forall h. 0 <= interpret_exp h e} *)
(* Commands -- loops are annotated with variants *)
noeq type com =
| Skip : com
| Assign : var:id -> term:exp -> com
| Seq : first:com -> second:com -> com
| If : cond:exp -> then_branch:com -> else_branch:com -> com
| While : cond:exp -> body:com -> variant:variant -> com
(* function used for the decreases clause *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Heap.fst.checked"
],
"interface_file": false,
"source_file": "While.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | h: FStar.Monotonic.Heap.heap -> c: While.com -> Prims.GTot Prims.int | Prims.GTot | [
"sometrivial"
] | [] | [
"FStar.Monotonic.Heap.heap",
"While.com",
"While.exp",
"While.variant",
"Prims.op_LessThan",
"Prims.bool",
"Prims.int",
"While.interpret_exp"
] | [] | false | false | false | false | false | let decr_while h c =
| match c with
| While c b v ->
let tmp = interpret_exp h v in
if tmp < 0 then 0 else tmp
| _ -> 0 | false |
Hacl.Spec.K256.Field52.Lemmas4.fst | Hacl.Spec.K256.Field52.Lemmas4.lemma_nat_r4321 | val lemma_nat_r4321 (r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2:nat) : Lemma
(requires
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1 =
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + t3 * pow2 104 + (d4 % pow2 48) * pow2 156) | val lemma_nat_r4321 (r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2:nat) : Lemma
(requires
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1 =
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + t3 * pow2 104 + (d4 % pow2 48) * pow2 156) | let lemma_nat_r4321 r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2 =
let k = d4 % pow2 48 in
let tmp1 = t3 * pow2 52 + k * pow2 104 in
calc (==) {
((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1;
(==) { lemma_nat_r432 r2 r3 r4 c9 c11 d4 d11 t3 r }
(c9 + r * d11 * pow2 64 + tmp1) * pow2 52 + r1;
(==) { }
(c6 / pow2 52 + sum2 + r * (d10 % pow2 64) + r * d11 * pow2 64 + tmp1) * pow2 52 + c6 % pow2 52;
(==) { ML.lemma_distr_eucl_mul r d10 (pow2 64) }
(c6 / pow2 52 + sum2 + r * d10 + tmp1) * pow2 52 + c6 % pow2 52;
(==) { ML.lemma_distr_eucl c6 (sum2 + r * d10 + tmp1) }
c6 + (sum2 + r * d10 + tmp1) * pow2 52;
(==) { Math.Lemmas.distributivity_add_left (sum2 + r * d10) tmp1 (pow2 52) }
c6 + (sum2 + r * d10) * pow2 52 + tmp1 * pow2 52;
(==) { Math.Lemmas.distributivity_add_left sum2 (r * d10) (pow2 52) }
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + tmp1 * pow2 52;
(==) { ML.lemma_distr_pow_pow t3 52 k 104 52 }
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + t3 * pow2 104 + k * pow2 156;
} | {
"file_name": "code/k256/Hacl.Spec.K256.Field52.Lemmas4.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 5,
"end_line": 73,
"start_col": 0,
"start_line": 53
} | module Hacl.Spec.K256.Field52.Lemmas4
open FStar.Mul
open Lib.IntTypes
module S = Spec.K256
include Hacl.Spec.K256.Field52.Definitions
include Hacl.Spec.K256.Field52
module ML = Hacl.Spec.K256.MathLemmas
module LD = Hacl.Spec.K256.Field52.Definitions.Lemmas
#set-options "--z3rlimit 100 --fuel 0 --ifuel 0"
val lemma_nat_r432 (r2 r3 r4 c9 c11 d4 d11 t3 r:nat) : Lemma
(requires
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
(r4 * pow2 52 + r3) * pow2 52 + r2 =
c9 + r * d11 * pow2 64 + t3 * pow2 52 + (d4 % pow2 48) * pow2 104)
let lemma_nat_r432 r2 r3 r4 c9 c11 d4 d11 t3 r =
let k = d4 % pow2 48 in
calc (==) {
(r4 * pow2 52 + r3) * pow2 52 + r2;
(==) { Math.Lemmas.pow2_modulo_modulo_lemma_1 d4 48 52 }
((c11 / pow2 52 + k) * pow2 52 + c11 % pow2 52) * pow2 52 + r2;
(==) { ML.lemma_distr_eucl c11 k }
(c9 / pow2 52 + r * pow2 12 * d11 + t3 + k * pow2 52) * pow2 52 + c9 % pow2 52;
(==) { ML.lemma_distr_eucl c9 (r * pow2 12 * d11 + t3 + k * pow2 52) }
c9 + (r * pow2 12 * d11 + t3 + k * pow2 52) * pow2 52;
(==) { ML.lemma_distr_pow (r * pow2 12 * d11 + t3) k 52 52 }
c9 + (r * pow2 12 * d11 + t3) * pow2 52 + k * pow2 104;
(==) { ML.lemma_swap_mul3 r (pow2 12) d11 }
c9 + (r * d11 * pow2 12 + t3) * pow2 52 + k * pow2 104;
(==) { ML.lemma_distr_pow t3 (r * d11) 12 52 }
c9 + r * d11 * pow2 64 + t3 * pow2 52 + k * pow2 104;
}
val lemma_nat_r4321 (r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2:nat) : Lemma
(requires
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1 =
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + t3 * pow2 104 + (d4 % pow2 48) * pow2 156) | {
"checked_file": "/",
"dependencies": [
"Spec.K256.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.K256.MathLemmas.fst.checked",
"Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked",
"Hacl.Spec.K256.Field52.Definitions.fst.checked",
"Hacl.Spec.K256.Field52.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.K256.Field52.Lemmas4.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.Field52.Definitions.Lemmas",
"short_module": "LD"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.MathLemmas",
"short_module": "ML"
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.K256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
r1: Prims.nat ->
r2: Prims.nat ->
r3: Prims.nat ->
r4: Prims.nat ->
c6: Prims.nat ->
c9: Prims.nat ->
c11: Prims.nat ->
d4: Prims.nat ->
d10: Prims.nat ->
d11: Prims.nat ->
t3: Prims.nat ->
r: Prims.nat ->
sum2: Prims.nat
-> FStar.Pervasives.Lemma
(requires
d11 = d10 / Prims.pow2 64 /\ r1 = c6 % Prims.pow2 52 /\
c9 = c6 / Prims.pow2 52 + sum2 + r * (d10 % Prims.pow2 64) /\ r2 = c9 % Prims.pow2 52 /\
c11 = c9 / Prims.pow2 52 + (r * Prims.pow2 12) * d11 + t3 /\ r3 = c11 % Prims.pow2 52 /\
r4 = c11 / Prims.pow2 52 + d4 % Prims.pow2 52 % Prims.pow2 48)
(ensures
((r4 * Prims.pow2 52 + r3) * Prims.pow2 52 + r2) * Prims.pow2 52 + r1 =
c6 + sum2 * Prims.pow2 52 + (r * d10) * Prims.pow2 52 + t3 * Prims.pow2 104 +
(d4 % Prims.pow2 48) * Prims.pow2 156) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.nat",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Prims.op_Addition",
"FStar.Mul.op_Star",
"Prims.pow2",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"Prims.op_Division",
"Prims.op_Modulus",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"Hacl.Spec.K256.Field52.Lemmas4.lemma_nat_r432",
"Prims.squash",
"Hacl.Spec.K256.MathLemmas.lemma_distr_eucl_mul",
"Hacl.Spec.K256.MathLemmas.lemma_distr_eucl",
"FStar.Math.Lemmas.distributivity_add_left",
"Hacl.Spec.K256.MathLemmas.lemma_distr_pow_pow"
] | [] | false | false | true | false | false | let lemma_nat_r4321 r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2 =
| let k = d4 % pow2 48 in
let tmp1 = t3 * pow2 52 + k * pow2 104 in
calc ( == ) {
((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1;
( == ) { lemma_nat_r432 r2 r3 r4 c9 c11 d4 d11 t3 r }
(c9 + (r * d11) * pow2 64 + tmp1) * pow2 52 + r1;
( == ) { () }
(c6 / pow2 52 + sum2 + r * (d10 % pow2 64) + (r * d11) * pow2 64 + tmp1) * pow2 52 + c6 % pow2 52;
( == ) { ML.lemma_distr_eucl_mul r d10 (pow2 64) }
(c6 / pow2 52 + sum2 + r * d10 + tmp1) * pow2 52 + c6 % pow2 52;
( == ) { ML.lemma_distr_eucl c6 (sum2 + r * d10 + tmp1) }
c6 + (sum2 + r * d10 + tmp1) * pow2 52;
( == ) { Math.Lemmas.distributivity_add_left (sum2 + r * d10) tmp1 (pow2 52) }
c6 + (sum2 + r * d10) * pow2 52 + tmp1 * pow2 52;
( == ) { Math.Lemmas.distributivity_add_left sum2 (r * d10) (pow2 52) }
c6 + sum2 * pow2 52 + (r * d10) * pow2 52 + tmp1 * pow2 52;
( == ) { ML.lemma_distr_pow_pow t3 52 k 104 52 }
c6 + sum2 * pow2 52 + (r * d10) * pow2 52 + t3 * pow2 104 + k * pow2 156;
} | false |
While.fst | While.interpret_exp_st | val interpret_exp_st : e:exp -> ST int
(requires (fun _ -> True))
(ensures (fun h r h' -> equal h h' /\ r = interpret_exp h e)) | val interpret_exp_st : e:exp -> ST int
(requires (fun _ -> True))
(ensures (fun h r h' -> equal h h' /\ r = interpret_exp h e)) | let rec interpret_exp_st e =
match e with
| AInt i -> i
| AVar x -> !x
| AOp o e1 e2 ->
let a = interpret_exp_st e1 in
let b = interpret_exp_st e2 in
interpret_binop o a b | {
"file_name": "examples/rel/While.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 25,
"end_line": 124,
"start_col": 0,
"start_line": 117
} | (*
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 While
open FStar.Heap
open FStar.ST
type id = ref int
type binop =
| Plus
| Minus
| Times
| Max
val interpret_binop : o:binop -> a:int -> b:int -> Tot int
let interpret_binop o a b =
match o with
| Plus -> a + b
| Minus -> a - b
| Times -> op_Multiply a b
| Max -> if a <= b then b else a
noeq type exp =
| AInt : int -> exp
| AVar : id -> exp
| AOp : binop -> exp -> exp -> exp
val interpret_exp : h:heap -> e:exp -> GTot int
let rec interpret_exp h e =
match e with
| AInt i -> i
| AVar x -> sel h x
| AOp o e1 e2 ->
let a = interpret_exp h e1 in
let b = interpret_exp h e2 in
interpret_binop o a b
(* CH: This is a termination metric (natural number expression) for
showing termination of while. (Why not call it that?)
Decreasingness and positivity of this termination metric
_dynamically_ checked. *)
type variant = exp
(* type variant = e:exp{forall h. 0 <= interpret_exp h e} *)
(* Commands -- loops are annotated with variants *)
noeq type com =
| Skip : com
| Assign : var:id -> term:exp -> com
| Seq : first:com -> second:com -> com
| If : cond:exp -> then_branch:com -> else_branch:com -> com
| While : cond:exp -> body:com -> variant:variant -> com
(* function used for the decreases clause *)
val decr_while : heap -> com -> GTot int
let decr_while h c =
match c with
| While c b v ->
let tmp = interpret_exp h v in
if tmp < 0 then 0 else tmp
| _ -> 0
(* Returns Some heap if the variant is correct *)
(* CH: This is ghost because it uses functions like upd to work on heaps *)
val interpret_while : h:heap -> c:com{While? c}
-> GTot (option heap) (decreases %[c; decr_while h c; 0])
val interpret_com : h:heap -> c:com -> GTot (option heap) (decreases %[c; decr_while h c; 1])
let rec interpret_while h (While e body v) =
if interpret_exp h e = 0 then
Some h
else
match interpret_com h body with
| Some h' ->
if interpret_exp h' v < interpret_exp h v && interpret_exp h' v >= 0 then
interpret_while h' (While e body v)
else
None
| None -> None
and interpret_com h c =
match c with
| Skip -> Some h
| Assign x e ->
let v = interpret_exp h e in
Some (upd h x v)
| Seq c1 c2 -> (
match interpret_com h c1 with
| Some h' -> interpret_com h' c2
| None -> None)
| If e ct cf ->
if interpret_exp h e = 0 then
interpret_com h cf
else
interpret_com h ct
| While e body v ->
interpret_while h c
val interpret_exp_st : e:exp -> ST int
(requires (fun _ -> True)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Heap.fst.checked"
],
"interface_file": false,
"source_file": "While.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | e: While.exp -> FStar.ST.ST Prims.int | FStar.ST.ST | [] | [] | [
"While.exp",
"Prims.int",
"While.id",
"FStar.ST.op_Bang",
"FStar.Heap.trivial_preorder",
"While.binop",
"While.interpret_binop",
"While.interpret_exp_st"
] | [
"recursion"
] | false | true | false | false | false | let rec interpret_exp_st e =
| match e with
| AInt i -> i
| AVar x -> !x
| AOp o e1 e2 ->
let a = interpret_exp_st e1 in
let b = interpret_exp_st e2 in
interpret_binop o a b | false |
Hacl.Spec.K256.Field52.Lemmas4.fst | Hacl.Spec.K256.Field52.Lemmas4.simplify_c3 | val simplify_c3 (d4 r sum5:nat) : Lemma
(requires r % pow2 4 = 0)
(ensures (let k = (d4 / pow2 52 + sum5) % pow2 52 in
((d4 % pow2 52) / pow2 48 + k * pow2 4) * (r / pow2 4) ==
(d4 / pow2 48) * (r / pow2 4) + (k - (d4 / pow2 52)) * r)) | val simplify_c3 (d4 r sum5:nat) : Lemma
(requires r % pow2 4 = 0)
(ensures (let k = (d4 / pow2 52 + sum5) % pow2 52 in
((d4 % pow2 52) / pow2 48 + k * pow2 4) * (r / pow2 4) ==
(d4 / pow2 48) * (r / pow2 4) + (k - (d4 / pow2 52)) * r)) | let simplify_c3 d4 r sum5 =
let k = (d4 / pow2 52 + sum5) % pow2 52 in
calc (==) { //simplify c3
((d4 % pow2 52) / pow2 48 + k * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.pow2_modulo_division_lemma_1 d4 48 52 }
((d4 / pow2 48) % pow2 4 + k * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.euclidean_division_definition (d4 / pow2 48) (pow2 4) }
(d4 / pow2 48 - (d4 / pow2 48 / pow2 4) * pow2 4 + k * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.division_multiplication_lemma d4 (pow2 48) (pow2 4); Math.Lemmas.pow2_plus 48 4 }
(d4 / pow2 48 - (d4 / pow2 52) * pow2 4 + k * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.distributivity_sub_left k (d4 / pow2 52) (pow2 4) }
(d4 / pow2 48 + (k - d4 / pow2 52) * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.distributivity_add_left (d4 / pow2 48) ((k - d4 / pow2 52) * pow2 4) (r / pow2 4) }
(d4 / pow2 48) * (r / pow2 4) + (k - d4 / pow2 52) * pow2 4 * (r / pow2 4);
(==) { Math.Lemmas.paren_mul_right (k - d4 / pow2 52) (pow2 4) (r / pow2 4); Math.Lemmas.div_exact_r r (pow2 4) }
(d4 / pow2 48) * (r / pow2 4) + (k - d4 / pow2 52) * r;
} | {
"file_name": "code/k256/Hacl.Spec.K256.Field52.Lemmas4.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 142,
"start_col": 0,
"start_line": 125
} | module Hacl.Spec.K256.Field52.Lemmas4
open FStar.Mul
open Lib.IntTypes
module S = Spec.K256
include Hacl.Spec.K256.Field52.Definitions
include Hacl.Spec.K256.Field52
module ML = Hacl.Spec.K256.MathLemmas
module LD = Hacl.Spec.K256.Field52.Definitions.Lemmas
#set-options "--z3rlimit 100 --fuel 0 --ifuel 0"
val lemma_nat_r432 (r2 r3 r4 c9 c11 d4 d11 t3 r:nat) : Lemma
(requires
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
(r4 * pow2 52 + r3) * pow2 52 + r2 =
c9 + r * d11 * pow2 64 + t3 * pow2 52 + (d4 % pow2 48) * pow2 104)
let lemma_nat_r432 r2 r3 r4 c9 c11 d4 d11 t3 r =
let k = d4 % pow2 48 in
calc (==) {
(r4 * pow2 52 + r3) * pow2 52 + r2;
(==) { Math.Lemmas.pow2_modulo_modulo_lemma_1 d4 48 52 }
((c11 / pow2 52 + k) * pow2 52 + c11 % pow2 52) * pow2 52 + r2;
(==) { ML.lemma_distr_eucl c11 k }
(c9 / pow2 52 + r * pow2 12 * d11 + t3 + k * pow2 52) * pow2 52 + c9 % pow2 52;
(==) { ML.lemma_distr_eucl c9 (r * pow2 12 * d11 + t3 + k * pow2 52) }
c9 + (r * pow2 12 * d11 + t3 + k * pow2 52) * pow2 52;
(==) { ML.lemma_distr_pow (r * pow2 12 * d11 + t3) k 52 52 }
c9 + (r * pow2 12 * d11 + t3) * pow2 52 + k * pow2 104;
(==) { ML.lemma_swap_mul3 r (pow2 12) d11 }
c9 + (r * d11 * pow2 12 + t3) * pow2 52 + k * pow2 104;
(==) { ML.lemma_distr_pow t3 (r * d11) 12 52 }
c9 + r * d11 * pow2 64 + t3 * pow2 52 + k * pow2 104;
}
val lemma_nat_r4321 (r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2:nat) : Lemma
(requires
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1 =
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + t3 * pow2 104 + (d4 % pow2 48) * pow2 156)
let lemma_nat_r4321 r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2 =
let k = d4 % pow2 48 in
let tmp1 = t3 * pow2 52 + k * pow2 104 in
calc (==) {
((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1;
(==) { lemma_nat_r432 r2 r3 r4 c9 c11 d4 d11 t3 r }
(c9 + r * d11 * pow2 64 + tmp1) * pow2 52 + r1;
(==) { }
(c6 / pow2 52 + sum2 + r * (d10 % pow2 64) + r * d11 * pow2 64 + tmp1) * pow2 52 + c6 % pow2 52;
(==) { ML.lemma_distr_eucl_mul r d10 (pow2 64) }
(c6 / pow2 52 + sum2 + r * d10 + tmp1) * pow2 52 + c6 % pow2 52;
(==) { ML.lemma_distr_eucl c6 (sum2 + r * d10 + tmp1) }
c6 + (sum2 + r * d10 + tmp1) * pow2 52;
(==) { Math.Lemmas.distributivity_add_left (sum2 + r * d10) tmp1 (pow2 52) }
c6 + (sum2 + r * d10) * pow2 52 + tmp1 * pow2 52;
(==) { Math.Lemmas.distributivity_add_left sum2 (r * d10) (pow2 52) }
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + tmp1 * pow2 52;
(==) { ML.lemma_distr_pow_pow t3 52 k 104 52 }
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + t3 * pow2 104 + k * pow2 156;
}
val lemma_nat_r43210 (r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 r sum1 sum2 sum7:nat) : Lemma
(requires
d10 == d8 / pow2 52 + sum7 /\
r0 = c3 % pow2 52 /\ c6 = c3 / pow2 52 + sum1 + d8 % pow2 52 * r /\
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
r0 + r1 * pow52 + r2 * pow104 + r3 * pow156 + r4 * pow208 =
c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 + t3 * pow2 156 + (d4 % pow2 48) * pow2 208)
let lemma_nat_r43210 r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 r sum1 sum2 sum7 =
let k = d4 % pow2 48 in
let tmp1 = sum2 * pow2 52 + t3 * pow2 104 + k * pow2 156 in
calc (==) { // tmp1 * pow2 52
(sum2 * pow2 52 + t3 * pow2 104 + k * pow2 156) * pow2 52;
(==) { ML.lemma_distr_pow (sum2 * pow2 52 + t3 * pow2 104) k 156 52 }
(sum2 * pow2 52 + t3 * pow2 104) * pow2 52 + k * pow2 208;
(==) { ML.lemma_distr_pow_pow sum2 52 t3 104 52 }
sum2 * pow2 104 + t3 * pow2 156 + k * pow2 208;
};
calc (==) {
r0 + r1 * pow52 + r2 * pow104 + r3 * pow156 + r4 * pow208;
(==) { ML.lemma_as_nat_horner r0 r1 r2 r3 r4 }
(((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1) * pow2 52 + r0;
(==) { lemma_nat_r4321 r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2 }
(c3 / pow2 52 + sum1 + d8 % pow2 52 * r + r * (d8 / pow2 52 + sum7) * pow2 52 + tmp1) * pow2 52 + c3 % pow2 52;
(==) { ML.lemma_distr_eucl_mul_add r d8 sum7 (pow2 52) }
(c3 / pow2 52 + sum1 + r * d8 + r * sum7 * pow2 52 + tmp1) * pow2 52 + c3 % pow2 52;
(==) { ML.lemma_distr_eucl c3 (sum1 + r * d8 + r * sum7 * pow2 52 + tmp1) }
c3 + (sum1 + r * d8 + r * sum7 * pow2 52 + tmp1) * pow2 52;
(==) { ML.lemma_distr_pow (sum1 + r * d8 + tmp1) (r * sum7) 52 52 }
c3 + (sum1 + r * d8 + tmp1) * pow2 52 + r * sum7 * pow2 104;
(==) { Math.Lemmas.distributivity_add_left (sum1 + r * d8) tmp1 (pow2 52) }
c3 + (sum1 + r * d8) * pow2 52 + sum2 * pow2 104 + t3 * pow2 156 + k * pow2 208 + r * sum7 * pow2 104;
(==) { Math.Lemmas.distributivity_add_left sum2 (r * sum7) (pow2 104) }
c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 + t3 * pow2 156 + k * pow2 208;
}
val simplify_c3 (d4 r sum5:nat) : Lemma
(requires r % pow2 4 = 0)
(ensures (let k = (d4 / pow2 52 + sum5) % pow2 52 in
((d4 % pow2 52) / pow2 48 + k * pow2 4) * (r / pow2 4) ==
(d4 / pow2 48) * (r / pow2 4) + (k - (d4 / pow2 52)) * r)) | {
"checked_file": "/",
"dependencies": [
"Spec.K256.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.K256.MathLemmas.fst.checked",
"Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked",
"Hacl.Spec.K256.Field52.Definitions.fst.checked",
"Hacl.Spec.K256.Field52.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.K256.Field52.Lemmas4.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.Field52.Definitions.Lemmas",
"short_module": "LD"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.MathLemmas",
"short_module": "ML"
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.K256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | d4: Prims.nat -> r: Prims.nat -> sum5: Prims.nat
-> FStar.Pervasives.Lemma (requires r % Prims.pow2 4 = 0)
(ensures
(let k = (d4 / Prims.pow2 52 + sum5) % Prims.pow2 52 in
(d4 % Prims.pow2 52 / Prims.pow2 48 + k * Prims.pow2 4) * (r / Prims.pow2 4) ==
(d4 / Prims.pow2 48) * (r / Prims.pow2 4) + (k - d4 / Prims.pow2 52) * r)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.nat",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"FStar.Mul.op_Star",
"Prims.op_Addition",
"Prims.op_Division",
"Prims.op_Modulus",
"Prims.pow2",
"Prims.op_Subtraction",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"FStar.Math.Lemmas.pow2_modulo_division_lemma_1",
"Prims.squash",
"FStar.Math.Lemmas.euclidean_division_definition",
"FStar.Math.Lemmas.pow2_plus",
"FStar.Math.Lemmas.division_multiplication_lemma",
"FStar.Math.Lemmas.distributivity_sub_left",
"FStar.Math.Lemmas.distributivity_add_left",
"FStar.Math.Lemmas.div_exact_r",
"FStar.Math.Lemmas.paren_mul_right"
] | [] | false | false | true | false | false | let simplify_c3 d4 r sum5 =
| let k = (d4 / pow2 52 + sum5) % pow2 52 in
calc ( == ) {
((d4 % pow2 52) / pow2 48 + k * pow2 4) * (r / pow2 4);
( == ) { Math.Lemmas.pow2_modulo_division_lemma_1 d4 48 52 }
((d4 / pow2 48) % pow2 4 + k * pow2 4) * (r / pow2 4);
( == ) { Math.Lemmas.euclidean_division_definition (d4 / pow2 48) (pow2 4) }
(d4 / pow2 48 - (d4 / pow2 48 / pow2 4) * pow2 4 + k * pow2 4) * (r / pow2 4);
( == ) { (Math.Lemmas.division_multiplication_lemma d4 (pow2 48) (pow2 4);
Math.Lemmas.pow2_plus 48 4) }
(d4 / pow2 48 - (d4 / pow2 52) * pow2 4 + k * pow2 4) * (r / pow2 4);
( == ) { Math.Lemmas.distributivity_sub_left k (d4 / pow2 52) (pow2 4) }
(d4 / pow2 48 + (k - d4 / pow2 52) * pow2 4) * (r / pow2 4);
( == ) { Math.Lemmas.distributivity_add_left (d4 / pow2 48)
((k - d4 / pow2 52) * pow2 4)
(r / pow2 4) }
(d4 / pow2 48) * (r / pow2 4) + ((k - d4 / pow2 52) * pow2 4) * (r / pow2 4);
( == ) { (Math.Lemmas.paren_mul_right (k - d4 / pow2 52) (pow2 4) (r / pow2 4);
Math.Lemmas.div_exact_r r (pow2 4)) }
(d4 / pow2 48) * (r / pow2 4) + (k - d4 / pow2 52) * r;
} | false |
While.fst | While.interpret_com | val interpret_com : h:heap -> c:com -> GTot (option heap) (decreases %[c; decr_while h c; 1]) | val interpret_com : h:heap -> c:com -> GTot (option heap) (decreases %[c; decr_while h c; 1]) | let rec interpret_while h (While e body v) =
if interpret_exp h e = 0 then
Some h
else
match interpret_com h body with
| Some h' ->
if interpret_exp h' v < interpret_exp h v && interpret_exp h' v >= 0 then
interpret_while h' (While e body v)
else
None
| None -> None
and interpret_com h c =
match c with
| Skip -> Some h
| Assign x e ->
let v = interpret_exp h e in
Some (upd h x v)
| Seq c1 c2 -> (
match interpret_com h c1 with
| Some h' -> interpret_com h' c2
| None -> None)
| If e ct cf ->
if interpret_exp h e = 0 then
interpret_com h cf
else
interpret_com h ct
| While e body v ->
interpret_while h c | {
"file_name": "examples/rel/While.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 23,
"end_line": 112,
"start_col": 0,
"start_line": 84
} | (*
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 While
open FStar.Heap
open FStar.ST
type id = ref int
type binop =
| Plus
| Minus
| Times
| Max
val interpret_binop : o:binop -> a:int -> b:int -> Tot int
let interpret_binop o a b =
match o with
| Plus -> a + b
| Minus -> a - b
| Times -> op_Multiply a b
| Max -> if a <= b then b else a
noeq type exp =
| AInt : int -> exp
| AVar : id -> exp
| AOp : binop -> exp -> exp -> exp
val interpret_exp : h:heap -> e:exp -> GTot int
let rec interpret_exp h e =
match e with
| AInt i -> i
| AVar x -> sel h x
| AOp o e1 e2 ->
let a = interpret_exp h e1 in
let b = interpret_exp h e2 in
interpret_binop o a b
(* CH: This is a termination metric (natural number expression) for
showing termination of while. (Why not call it that?)
Decreasingness and positivity of this termination metric
_dynamically_ checked. *)
type variant = exp
(* type variant = e:exp{forall h. 0 <= interpret_exp h e} *)
(* Commands -- loops are annotated with variants *)
noeq type com =
| Skip : com
| Assign : var:id -> term:exp -> com
| Seq : first:com -> second:com -> com
| If : cond:exp -> then_branch:com -> else_branch:com -> com
| While : cond:exp -> body:com -> variant:variant -> com
(* function used for the decreases clause *)
val decr_while : heap -> com -> GTot int
let decr_while h c =
match c with
| While c b v ->
let tmp = interpret_exp h v in
if tmp < 0 then 0 else tmp
| _ -> 0
(* Returns Some heap if the variant is correct *)
(* CH: This is ghost because it uses functions like upd to work on heaps *)
val interpret_while : h:heap -> c:com{While? c}
-> GTot (option heap) (decreases %[c; decr_while h c; 0])
val interpret_com : h:heap -> c:com -> GTot (option heap) (decreases %[c; decr_while h c; 1]) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Heap.fst.checked"
],
"interface_file": false,
"source_file": "While.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | h: FStar.Monotonic.Heap.heap -> c: While.com
-> Prims.GTot (FStar.Pervasives.Native.option FStar.Monotonic.Heap.heap) | Prims.GTot | [
"sometrivial",
""
] | [
"interpret_while",
"interpret_com"
] | [
"FStar.Monotonic.Heap.heap",
"While.com",
"FStar.Pervasives.Native.Some",
"While.id",
"While.exp",
"FStar.Monotonic.Heap.upd",
"Prims.int",
"FStar.Heap.trivial_preorder",
"While.interpret_exp",
"While.interpret_com",
"FStar.Pervasives.Native.None",
"FStar.Pervasives.Native.option",
"Prims.op_Equality",
"Prims.bool",
"While.variant",
"While.interpret_while"
] | [
"mutual recursion"
] | false | false | false | false | false | let rec interpret_com h c =
| match c with
| Skip -> Some h
| Assign x e ->
let v = interpret_exp h e in
Some (upd h x v)
| Seq c1 c2 ->
(match interpret_com h c1 with
| Some h' -> interpret_com h' c2
| None -> None)
| If e ct cf -> if interpret_exp h e = 0 then interpret_com h cf else interpret_com h ct
| While e body v -> interpret_while h c | false |
Hacl.Spec.K256.Field52.Lemmas4.fst | Hacl.Spec.K256.Field52.Lemmas4.lemma_nat_r432 | val lemma_nat_r432 (r2 r3 r4 c9 c11 d4 d11 t3 r:nat) : Lemma
(requires
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
(r4 * pow2 52 + r3) * pow2 52 + r2 =
c9 + r * d11 * pow2 64 + t3 * pow2 52 + (d4 % pow2 48) * pow2 104) | val lemma_nat_r432 (r2 r3 r4 c9 c11 d4 d11 t3 r:nat) : Lemma
(requires
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
(r4 * pow2 52 + r3) * pow2 52 + r2 =
c9 + r * d11 * pow2 64 + t3 * pow2 52 + (d4 % pow2 48) * pow2 104) | let lemma_nat_r432 r2 r3 r4 c9 c11 d4 d11 t3 r =
let k = d4 % pow2 48 in
calc (==) {
(r4 * pow2 52 + r3) * pow2 52 + r2;
(==) { Math.Lemmas.pow2_modulo_modulo_lemma_1 d4 48 52 }
((c11 / pow2 52 + k) * pow2 52 + c11 % pow2 52) * pow2 52 + r2;
(==) { ML.lemma_distr_eucl c11 k }
(c9 / pow2 52 + r * pow2 12 * d11 + t3 + k * pow2 52) * pow2 52 + c9 % pow2 52;
(==) { ML.lemma_distr_eucl c9 (r * pow2 12 * d11 + t3 + k * pow2 52) }
c9 + (r * pow2 12 * d11 + t3 + k * pow2 52) * pow2 52;
(==) { ML.lemma_distr_pow (r * pow2 12 * d11 + t3) k 52 52 }
c9 + (r * pow2 12 * d11 + t3) * pow2 52 + k * pow2 104;
(==) { ML.lemma_swap_mul3 r (pow2 12) d11 }
c9 + (r * d11 * pow2 12 + t3) * pow2 52 + k * pow2 104;
(==) { ML.lemma_distr_pow t3 (r * d11) 12 52 }
c9 + r * d11 * pow2 64 + t3 * pow2 52 + k * pow2 104;
} | {
"file_name": "code/k256/Hacl.Spec.K256.Field52.Lemmas4.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 5,
"end_line": 40,
"start_col": 0,
"start_line": 24
} | module Hacl.Spec.K256.Field52.Lemmas4
open FStar.Mul
open Lib.IntTypes
module S = Spec.K256
include Hacl.Spec.K256.Field52.Definitions
include Hacl.Spec.K256.Field52
module ML = Hacl.Spec.K256.MathLemmas
module LD = Hacl.Spec.K256.Field52.Definitions.Lemmas
#set-options "--z3rlimit 100 --fuel 0 --ifuel 0"
val lemma_nat_r432 (r2 r3 r4 c9 c11 d4 d11 t3 r:nat) : Lemma
(requires
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
(r4 * pow2 52 + r3) * pow2 52 + r2 =
c9 + r * d11 * pow2 64 + t3 * pow2 52 + (d4 % pow2 48) * pow2 104) | {
"checked_file": "/",
"dependencies": [
"Spec.K256.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.K256.MathLemmas.fst.checked",
"Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked",
"Hacl.Spec.K256.Field52.Definitions.fst.checked",
"Hacl.Spec.K256.Field52.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.K256.Field52.Lemmas4.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.Field52.Definitions.Lemmas",
"short_module": "LD"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.MathLemmas",
"short_module": "ML"
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.K256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
r2: Prims.nat ->
r3: Prims.nat ->
r4: Prims.nat ->
c9: Prims.nat ->
c11: Prims.nat ->
d4: Prims.nat ->
d11: Prims.nat ->
t3: Prims.nat ->
r: Prims.nat
-> FStar.Pervasives.Lemma
(requires
r2 = c9 % Prims.pow2 52 /\ c11 = c9 / Prims.pow2 52 + (r * Prims.pow2 12) * d11 + t3 /\
r3 = c11 % Prims.pow2 52 /\ r4 = c11 / Prims.pow2 52 + d4 % Prims.pow2 52 % Prims.pow2 48)
(ensures
(r4 * Prims.pow2 52 + r3) * Prims.pow2 52 + r2 =
c9 + (r * d11) * Prims.pow2 64 + t3 * Prims.pow2 52 + (d4 % Prims.pow2 48) * Prims.pow2 104) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.nat",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Prims.op_Addition",
"FStar.Mul.op_Star",
"Prims.pow2",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"Prims.op_Division",
"Prims.op_Modulus",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"FStar.Math.Lemmas.pow2_modulo_modulo_lemma_1",
"Prims.squash",
"Hacl.Spec.K256.MathLemmas.lemma_distr_eucl",
"Hacl.Spec.K256.MathLemmas.lemma_distr_pow",
"Hacl.Spec.K256.MathLemmas.lemma_swap_mul3"
] | [] | false | false | true | false | false | let lemma_nat_r432 r2 r3 r4 c9 c11 d4 d11 t3 r =
| let k = d4 % pow2 48 in
calc ( == ) {
(r4 * pow2 52 + r3) * pow2 52 + r2;
( == ) { Math.Lemmas.pow2_modulo_modulo_lemma_1 d4 48 52 }
((c11 / pow2 52 + k) * pow2 52 + c11 % pow2 52) * pow2 52 + r2;
( == ) { ML.lemma_distr_eucl c11 k }
(c9 / pow2 52 + (r * pow2 12) * d11 + t3 + k * pow2 52) * pow2 52 + c9 % pow2 52;
( == ) { ML.lemma_distr_eucl c9 ((r * pow2 12) * d11 + t3 + k * pow2 52) }
c9 + ((r * pow2 12) * d11 + t3 + k * pow2 52) * pow2 52;
( == ) { ML.lemma_distr_pow ((r * pow2 12) * d11 + t3) k 52 52 }
c9 + ((r * pow2 12) * d11 + t3) * pow2 52 + k * pow2 104;
( == ) { ML.lemma_swap_mul3 r (pow2 12) d11 }
c9 + ((r * d11) * pow2 12 + t3) * pow2 52 + k * pow2 104;
( == ) { ML.lemma_distr_pow t3 (r * d11) 12 52 }
c9 + (r * d11) * pow2 64 + t3 * pow2 52 + k * pow2 104;
} | false |
FStar.BV.fsti | FStar.BV.bv_zero | val bv_zero : FStar.BV.bv_t n | let bv_zero #n = int2bv #n 0 | {
"file_name": "ulib/FStar.BV.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 28,
"end_line": 198,
"start_col": 0,
"start_line": 198
} | (*
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.BV
/// This module defines an abstract type of length-indexed bit
/// vectors. The type and its operations are handled primitively in
/// F*'s SMT encoding, which maps them to the SMT sort of bit vectors
/// and operations on that sort. Note that this encoding only applies
/// when the length [n] is a syntactic literal: bit vectors with a
/// length referring to some variable, bound or otherwise, are encoded
/// as abstract sequences of bits.
///
/// Because of this syntactic encoding, it is also often helpful to
/// explicitly specify the bit length on all operations -- for example
/// constructing a 64-bit vector with [int2bv #64 1]. These explicit
/// annotations ensure that the encoding uses the literal length 64,
/// rather than inferring some variable as the length.
///
/// One way to use this module is in conjunction with
/// FStar.Tactics.BV. Its main tactic, [bv_tac], converts bitwise
/// operations on unsigned integers to operations on bit vectors and
/// back using the [int2bv / bv2int] isomorphism. This can be an
/// effective way of discharging such proof obligations for bitwise
/// operations on integers using the SMT solver's theory of
/// bitvectors.
open FStar.UInt
// for now just opening this for logand, logxor, etc. but we need a better solution.
(** The main type of this module, bit vectors of length [n], with
decidable equality *)
val bv_t (n: nat) : eqtype
(* Experimental:
Redefining basic type from UInt to avoid importing UInt
Reduces verification time by 50% in small examples
// let max_int (n:nat) : Tot int = pow2 n - 1
// let min_int (n:nat) : Tot int = 0
// let fits (x:int) (n:nat) : Tot bool = min_int n <= x && x <= max_int n
// let size (x:int) (n:nat) : Tot Type0 = b2t(fits x n)
// type uint_t' (n:nat) = x:int{size x n}
*)
(** Extending a bit vector of length [n] to a larger vector of size
[m+n], filling the extra bits with 0 *)
val bv_uext (#n #m: pos) (a: bv_t n) : Tot (normalize (bv_t (m + n)))
(**** Relating unsigned integers to bitvectors *)
(** Mapping a bounded unsigned integer of size [< 2^n], to a n-length
bit vector *)
val int2bv (#n: pos) (num: uint_t n) : Tot (bv_t n)
(** Mapping a bit vector back to a bounded unsigned integer of size [<
2^n] *)
val bv2int (#n: pos) (vec: bv_t n) : Tot (uint_t n)
val int2bv_lemma_1 (#n: pos) (a b: uint_t n)
: Lemma (requires a = b) (ensures (int2bv #n a = int2bv #n b))
val int2bv_lemma_2 (#n: pos) (a b: uint_t n)
: Lemma (requires (int2bv a = int2bv b)) (ensures a = b)
val inverse_vec_lemma (#n: pos) (vec: bv_t n)
: Lemma (requires True) (ensures vec = (int2bv (bv2int vec))) [SMTPat (int2bv (bv2int vec))]
val inverse_num_lemma (#n: pos) (num: uint_t n)
: Lemma (requires True)
(ensures num = bv2int #n (int2bv #n num))
[SMTPat (bv2int #n (int2bv #n num))]
(**** Relating lists to bitvectors *)
(** Mapping a list of booleans to a bitvector *)
val list2bv (#n: pos) (l: list bool {List.length l = n}) : Tot (bv_t n)
(** Mapping a bitvector to a list of booleans *)
val bv2list: #n: pos -> bv_t n -> Tot (l: list bool {List.length l = n})
val list2bv_bij (#n: pos) (a: list bool {List.length a = n})
: Lemma (requires (True)) (ensures (bv2list (list2bv #n a) = a))
val bv2list_bij (#n: pos) (a: bv_t n)
: Lemma (requires (True)) (ensures (list2bv (bv2list #n a) = a))
(**** Bitwise logical operators *)
(** Bitwise conjunction *)
val bvand (#n: pos) (a b: bv_t n) : Tot (bv_t n)
val int2bv_logand:
#n: pos ->
#x: uint_t n ->
#y: uint_t n ->
#z: bv_t n ->
squash (bvand #n (int2bv #n x) (int2bv #n y) == z)
-> Lemma (int2bv #n (logand #n x y) == z)
(** Bitwise exclusive or *)
val bvxor (#n: pos) (a b: bv_t n) : Tot (bv_t n)
val int2bv_logxor:
#n: pos ->
#x: uint_t n ->
#y: uint_t n ->
#z: bv_t n ->
squash (bvxor #n (int2bv #n x) (int2bv #n y) == z)
-> Lemma (int2bv #n (logxor #n x y) == z)
(** Bitwise disjunction *)
val bvor (#n: pos) (a b: bv_t n) : Tot (bv_t n)
val int2bv_logor:
#n: pos ->
#x: uint_t n ->
#y: uint_t n ->
#z: bv_t n ->
squash (bvor #n (int2bv #n x) (int2bv #n y) == z)
-> Lemma (int2bv #n (logor #n x y) == z)
(** Bitwise negation *)
val bvnot (#n: pos) (a: bv_t n) : Tot (bv_t n)
val int2bv_lognot: #n: pos -> #x: uint_t n -> #z: bv_t n -> squash (bvnot #n (int2bv #n x) == z)
-> Lemma (int2bv #n (lognot #n x) == z)
(** Bitwise shift left: shift by bit-vector.
This variant directly corresponds to the SMT-LIB bvshl function. In some
cases, it may be more efficient to use this variant rather than the below
natural number [bvshl] variant, as the below requires a conversion from
unbounded integers. *)
val bvshl' (#n: pos) (a: bv_t n) (s: bv_t n) : Tot (bv_t n)
(** Bitwise shift left: shift by integer.
This variant uses an unbounded natural and exists for compatibility. *)
val bvshl (#n: pos) (a: bv_t n) (s: nat) : Tot (bv_t n)
val int2bv_shl':
#n: pos ->
#x: uint_t n ->
#y: uint_t n ->
#z: bv_t n ->
squash (bvshl' #n (int2bv #n x) (int2bv #n y) == z)
-> Lemma (int2bv #n (shift_left #n x y) == z)
val int2bv_shl:
#n: pos ->
#x: uint_t n ->
#y: uint_t n ->
#z: bv_t n ->
squash (bvshl #n (int2bv #n x) y == z)
-> Lemma (int2bv #n (shift_left #n x y) == z)
(** Bitwise shift right: shift by bit-vector.
This variant directly corresponds to the SMT-LIB bvshr function. In some
cases, it may be more efficient to use this variant rather than the below
natural number [bvshr] variant, as the below requires a conversion from
unbounded integers.
*)
val bvshr' (#n: pos) (a: bv_t n) (s: bv_t n) : Tot (bv_t n)
(** Bitwise shift right: shift by integer.
This variant uses an unbounded natural and exists for compatibility. *)
val bvshr (#n: pos) (a: bv_t n) (s: nat) : Tot (bv_t n)
val int2bv_shr':
#n: pos ->
#x: uint_t n ->
#y: uint_t n ->
#z: bv_t n ->
squash (bvshr' #n (int2bv #n x) (int2bv #n y) == z)
-> Lemma (int2bv #n (shift_right #n x y) == z)
val int2bv_shr:
#n: pos ->
#x: uint_t n ->
#y: uint_t n ->
#z: bv_t n ->
squash (bvshr #n (int2bv #n x) y == z)
-> Lemma (int2bv #n (shift_right #n x y) == z)
(**** Arithmetic operations *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.fst.checked"
],
"interface_file": false,
"source_file": "FStar.BV.fsti"
} | [
{
"abbrev": false,
"full_module": "FStar.UInt",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.BV.bv_t n | Prims.Tot | [
"total"
] | [] | [
"Prims.pos",
"FStar.BV.int2bv",
"FStar.BV.bv_t"
] | [] | false | false | false | false | false | let bv_zero #n =
| int2bv #n 0 | false |
|
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.xer_ca | val xer_ca (xer:xer_t) : bool | val xer_ca (xer:xer_t) : bool | let xer_ca = Lemmas.xer_ca | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 26,
"end_line": 12,
"start_col": 0,
"start_line": 12
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = () | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | xer: Vale.PPC64LE.Machine_s.xer_t -> Prims.bool | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Lemmas.xer_ca"
] | [] | false | false | false | true | false | let xer_ca =
| Lemmas.xer_ca | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.ins | val ins : Type0 | val ins : Type0 | let ins = S.ins | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 15,
"end_line": 15,
"start_col": 0,
"start_line": 15
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Semantics_s.ins"
] | [] | false | false | false | true | true | let ins =
| S.ins | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.update_xer_ov | val update_xer_ov (xer:xer_t) (new_xer_ov:bool) : xer_t | val update_xer_ov (xer:xer_t) (new_xer_ov:bool) : xer_t | let update_xer_ov = Lemmas.update_xer_ov | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 13,
"start_col": 0,
"start_line": 13
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | xer: Vale.PPC64LE.Machine_s.xer_t -> new_xer_ov: Prims.bool -> Vale.PPC64LE.Machine_s.xer_t | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Lemmas.update_xer_ov"
] | [] | false | false | false | true | false | let update_xer_ov =
| Lemmas.update_xer_ov | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.update_xer_ca | val update_xer_ca (xer:xer_t) (new_xer_ca:bool) : xer_t | val update_xer_ca (xer:xer_t) (new_xer_ca:bool) : xer_t | let update_xer_ca = Lemmas.update_xer_ca | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 14,
"start_col": 0,
"start_line": 14
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | xer: Vale.PPC64LE.Machine_s.xer_t -> new_xer_ca: Prims.bool -> Vale.PPC64LE.Machine_s.xer_t | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Lemmas.update_xer_ca"
] | [] | false | false | false | true | false | let update_xer_ca =
| Lemmas.update_xer_ca | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.xer_ov | val xer_ov (xer:xer_t) : bool | val xer_ov (xer:xer_t) : bool | let xer_ov = Lemmas.xer_ov | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 26,
"end_line": 11,
"start_col": 0,
"start_line": 11
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = () | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | xer: Vale.PPC64LE.Machine_s.xer_t -> Prims.bool | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Lemmas.xer_ov"
] | [] | false | false | false | true | false | let xer_ov =
| Lemmas.xer_ov | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_ffalse | val va_ffalse (reason:string) : va_pbool | val va_ffalse (reason:string) : va_pbool | let va_ffalse = Vale.Def.PossiblyMonad.ffalse | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 45,
"end_line": 21,
"start_col": 0,
"start_line": 21
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | reason: Prims.string -> Vale.PPC64LE.Decls.va_pbool | Prims.Tot | [
"total"
] | [] | [
"Vale.Def.PossiblyMonad.ffalse"
] | [] | false | false | false | true | false | let va_ffalse =
| Vale.Def.PossiblyMonad.ffalse | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_ttrue | val va_ttrue (_:unit) : va_pbool | val va_ttrue (_:unit) : va_pbool | let va_ttrue () = Vale.Def.PossiblyMonad.ttrue | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 46,
"end_line": 20,
"start_col": 0,
"start_line": 20
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | _: Prims.unit -> Vale.PPC64LE.Decls.va_pbool | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Vale.Def.PossiblyMonad.ttrue",
"Vale.PPC64LE.Decls.va_pbool"
] | [] | false | false | false | true | false | let va_ttrue () =
| Vale.Def.PossiblyMonad.ttrue | false |
MerkleTree.New.High.Correct.Path.fst | MerkleTree.New.High.Correct.Path.mt_get_path_step_acc | val mt_get_path_step_acc:
#hsz:pos ->
j:nat{j > 0} ->
chs:hashes #hsz {S.length chs = j} ->
crh:hash #hsz ->
k:nat{k <= j} ->
actd:bool ->
GTot (option (hash #hsz)) | val mt_get_path_step_acc:
#hsz:pos ->
j:nat{j > 0} ->
chs:hashes #hsz {S.length chs = j} ->
crh:hash #hsz ->
k:nat{k <= j} ->
actd:bool ->
GTot (option (hash #hsz)) | let mt_get_path_step_acc #hsz j chs crh k actd =
if k % 2 = 1
then Some (S.index chs (k - 1))
else (if k = j then None
else if k + 1 = j
then (if actd then Some crh else None)
else Some (S.index chs (k + 1))) | {
"file_name": "src/MerkleTree.New.High.Correct.Path.fst",
"git_rev": "7d7bdc20f2033171e279c176b26e84f9069d23c6",
"git_url": "https://github.com/hacl-star/merkle-tree.git",
"project_name": "merkle-tree"
} | {
"end_col": 37,
"end_line": 62,
"start_col": 0,
"start_line": 56
} | module MerkleTree.New.High.Correct.Path
open EverCrypt
open EverCrypt.Helpers
open MerkleTree.New.High.Correct.Base
// Need to use some facts of `mt_get_root`
open MerkleTree.New.High.Correct.Rhs
open FStar.Classical
open FStar.Ghost
open FStar.Seq
module List = FStar.List.Tot
module S = FStar.Seq
module U32 = FStar.UInt32
module U8 = FStar.UInt8
type uint32_t = U32.t
type uint8_t = U8.t
module EHS = EverCrypt.Hash
module MTS = MerkleTree.Spec
open MerkleTree.New.High
#reset-options "--z3rlimit 20"
/// Correctness of path generation
val path_spec:
#hsz:pos ->
k:nat ->
j:nat{k <= j} ->
actd:bool ->
p:path #hsz {S.length p = mt_path_length k j actd} ->
GTot (sp:S.seq (MTS.padded_hash #hsz){S.length sp = log2c j})
(decreases j)
let rec path_spec #hsz k j actd p =
if j = 0 then S.empty
else (if k % 2 = 0
then (if j = k || (j = k + 1 && not actd)
then S.cons MTS.HPad (path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) p)
else S.cons (MTS.HRaw #hsz (S.head p))
(path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) (S.tail p)))
else S.cons (MTS.HRaw #hsz (S.head p))
(path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) (S.tail p)))
val mt_get_path_step_acc:
#hsz:pos ->
j:nat{j > 0} ->
chs:hashes #hsz {S.length chs = j} ->
crh:hash #hsz ->
k:nat{k <= j} ->
actd:bool -> | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"MerkleTree.Spec.fst.checked",
"MerkleTree.New.High.Correct.Rhs.fst.checked",
"MerkleTree.New.High.Correct.Base.fst.checked",
"MerkleTree.New.High.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"EverCrypt.Helpers.fsti.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": false,
"source_file": "MerkleTree.New.High.Correct.Path.fst"
} | [
{
"abbrev": false,
"full_module": "MerkleTree.New.High",
"short_module": null
},
{
"abbrev": true,
"full_module": "MerkleTree.Spec",
"short_module": "MTS"
},
{
"abbrev": true,
"full_module": "EverCrypt.Hash",
"short_module": "EHS"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "List"
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Classical",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct.Rhs",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt.Helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
j: Prims.nat{j > 0} ->
chs: MerkleTree.New.High.hashes{FStar.Seq.Base.length chs = j} ->
crh: MerkleTree.New.High.hash ->
k: Prims.nat{k <= j} ->
actd: Prims.bool
-> Prims.GTot (FStar.Pervasives.Native.option MerkleTree.New.High.hash) | Prims.GTot | [
"sometrivial"
] | [] | [
"Prims.pos",
"Prims.nat",
"Prims.b2t",
"Prims.op_GreaterThan",
"MerkleTree.New.High.hashes",
"Prims.op_Equality",
"FStar.Seq.Base.length",
"MerkleTree.New.High.hash",
"Prims.op_LessThanOrEqual",
"Prims.bool",
"Prims.int",
"Prims.op_Modulus",
"FStar.Pervasives.Native.Some",
"FStar.Seq.Base.index",
"Prims.op_Subtraction",
"Prims.l_or",
"FStar.Pervasives.Native.None",
"Prims.op_Addition",
"FStar.Pervasives.Native.option"
] | [] | false | false | false | false | false | let mt_get_path_step_acc #hsz j chs crh k actd =
| if k % 2 = 1
then Some (S.index chs (k - 1))
else
(if k = j
then None
else if k + 1 = j then (if actd then Some crh else None) else Some (S.index chs (k + 1))) | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_pbool_and | val va_pbool_and (x y:va_pbool) : va_pbool | val va_pbool_and (x y:va_pbool) : va_pbool | let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 57,
"end_line": 22,
"start_col": 0,
"start_line": 22
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | x: Vale.PPC64LE.Decls.va_pbool -> y: Vale.PPC64LE.Decls.va_pbool -> Vale.PPC64LE.Decls.va_pbool | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Decls.va_pbool",
"Vale.Def.PossiblyMonad.op_Amp_Amp_Dot"
] | [] | false | false | false | true | false | let va_pbool_and x y =
| Vale.Def.PossiblyMonad.(( &&. )) x y | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.mul_nat_helper | val mul_nat_helper (x y:nat) : Lemma (x * y >= 0) | val mul_nat_helper (x y:nat) : Lemma (x * y >= 0) | let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 44,
"end_line": 25,
"start_col": 0,
"start_line": 24
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | x: Prims.nat -> y: Prims.nat -> FStar.Pervasives.Lemma (ensures x * y >= 0) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.nat",
"FStar.Math.Lemmas.nat_times_nat_is_nat",
"Prims.unit"
] | [] | true | false | true | false | false | let mul_nat_helper x y =
| FStar.Math.Lemmas.nat_times_nat_is_nat x y | false |
MerkleTree.New.High.Correct.Path.fst | MerkleTree.New.High.Correct.Path.mt_verify_ok | val mt_verify_ok:
#hsz:pos -> #f:MTS.hash_fun_t ->
k:nat ->
j:nat{k < j} ->
p:path #hsz {S.length p = 1 + mt_path_length k j false} ->
rt:hash #hsz ->
Lemma (mt_verify #_ #f k j p rt <==>
MTS.mt_verify #_ #f #(log2c j)
(path_spec k j false (S.tail p)) k (MTS.HRaw (S.head p)) (MTS.HRaw rt)) | val mt_verify_ok:
#hsz:pos -> #f:MTS.hash_fun_t ->
k:nat ->
j:nat{k < j} ->
p:path #hsz {S.length p = 1 + mt_path_length k j false} ->
rt:hash #hsz ->
Lemma (mt_verify #_ #f k j p rt <==>
MTS.mt_verify #_ #f #(log2c j)
(path_spec k j false (S.tail p)) k (MTS.HRaw (S.head p)) (MTS.HRaw rt)) | let mt_verify_ok #_ #f k j p rt =
mt_verify_ok_ #_ #f k j p 1 (S.head p) false | {
"file_name": "src/MerkleTree.New.High.Correct.Path.fst",
"git_rev": "7d7bdc20f2033171e279c176b26e84f9069d23c6",
"git_url": "https://github.com/hacl-star/merkle-tree.git",
"project_name": "merkle-tree"
} | {
"end_col": 46,
"end_line": 405,
"start_col": 0,
"start_line": 404
} | module MerkleTree.New.High.Correct.Path
open EverCrypt
open EverCrypt.Helpers
open MerkleTree.New.High.Correct.Base
// Need to use some facts of `mt_get_root`
open MerkleTree.New.High.Correct.Rhs
open FStar.Classical
open FStar.Ghost
open FStar.Seq
module List = FStar.List.Tot
module S = FStar.Seq
module U32 = FStar.UInt32
module U8 = FStar.UInt8
type uint32_t = U32.t
type uint8_t = U8.t
module EHS = EverCrypt.Hash
module MTS = MerkleTree.Spec
open MerkleTree.New.High
#reset-options "--z3rlimit 20"
/// Correctness of path generation
val path_spec:
#hsz:pos ->
k:nat ->
j:nat{k <= j} ->
actd:bool ->
p:path #hsz {S.length p = mt_path_length k j actd} ->
GTot (sp:S.seq (MTS.padded_hash #hsz){S.length sp = log2c j})
(decreases j)
let rec path_spec #hsz k j actd p =
if j = 0 then S.empty
else (if k % 2 = 0
then (if j = k || (j = k + 1 && not actd)
then S.cons MTS.HPad (path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) p)
else S.cons (MTS.HRaw #hsz (S.head p))
(path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) (S.tail p)))
else S.cons (MTS.HRaw #hsz (S.head p))
(path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) (S.tail p)))
val mt_get_path_step_acc:
#hsz:pos ->
j:nat{j > 0} ->
chs:hashes #hsz {S.length chs = j} ->
crh:hash #hsz ->
k:nat{k <= j} ->
actd:bool ->
GTot (option (hash #hsz))
let mt_get_path_step_acc #hsz j chs crh k actd =
if k % 2 = 1
then Some (S.index chs (k - 1))
else (if k = j then None
else if k + 1 = j
then (if actd then Some crh else None)
else Some (S.index chs (k + 1)))
val mt_get_path_acc:
#hsz:pos -> #f:MTS.hash_fun_t #hsz ->
j:nat ->
fhs:hashess #hsz {S.length fhs = log2c j /\ mt_hashes_lth_inv_log #hsz j fhs} ->
rhs:hashes #hsz {S.length rhs = log2c j} ->
k:nat{k <= j} ->
actd:bool ->
GTot (np:path #hsz {S.length np = mt_path_length k j actd})
(decreases j)
let rec mt_get_path_acc #_ #f j fhs rhs k actd =
if j = 0 then S.empty
else
(let sp = mt_get_path_step_acc #_ j (S.head fhs) (S.head rhs) k actd in
let rp = mt_get_path_acc #_ #f (j / 2) (S.tail fhs) (S.tail rhs) (k / 2)
(actd || j % 2 = 1) in
if Some? sp
then (S.cons (Some?.v sp) rp)
else rp)
val mt_get_path_step_acc_consistent:
#hsz:pos -> #f:MTS.hash_fun_t ->
lv:nat{lv <= 32} ->
i:nat ->
j:nat{i <= j /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv i olds} ->
hs:hashess #hsz {S.length hs = 32 /\ hs_wf_elts lv hs i j} ->
rhs:hashes #hsz {S.length rhs = 32} ->
k:nat{i <= k && k <= j} ->
actd:bool ->
Lemma (requires (j <> 0))
(ensures
(log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
mt_hashes_lth_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
(match mt_get_path_step_acc j
(S.index (merge_hs #_ #f olds hs) lv) (S.index rhs lv)
k actd with
| Some v ->
S.equal (mt_make_path_step lv hs rhs i j k S.empty actd)
(S.cons v S.empty)
| None ->
S.equal (mt_make_path_step lv hs rhs i j k S.empty actd)
S.empty)))
let mt_get_path_step_acc_consistent #_ #_ lv i j olds hs rhs k actd = ()
private val seq_cons_append:
#a:Type -> hd:a -> tl:S.seq a ->
Lemma (S.equal (S.append (S.cons hd S.empty) tl)
(S.cons hd tl))
private let seq_cons_append #a hd tl = ()
val mt_get_path_acc_consistent:
#hsz:pos -> #f:MTS.hash_fun_t ->
lv:nat{lv <= 32} ->
i:nat ->
j:nat{i <= j /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv i olds} ->
hs:hashess #hsz {S.length hs = 32 /\ hs_wf_elts lv hs i j} ->
rhs:hashes #hsz {S.length rhs = 32} ->
k:nat{i <= k && k <= j} ->
actd:bool ->
Lemma (requires True)
(ensures
(log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
mt_hashes_lth_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
S.equal (mt_get_path_acc #_ #f j
(S.slice (merge_hs #_ #f olds hs) lv (lv + log2c j))
(S.slice rhs lv (lv + log2c j)) k actd)
(mt_get_path_ #_ lv hs rhs i j k S.empty actd)))
(decreases j)
#push-options "--z3rlimit 1000 --max_fuel 1 --max_ifuel 0"
let rec mt_get_path_acc_consistent #hsz #f lv i j olds hs rhs k actd =
log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
mt_hashes_lth_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
if j = 0 then ()
else begin
let nactd = if j % 2 = 0 then actd else true in
let nactd_ = actd || j % 2 = 1 in
assert (nactd == nactd_);
let pa = mt_get_path_acc #_ #f j
(S.slice (merge_hs #_ #f olds hs) lv (lv + log2c j))
(S.slice rhs lv (lv + log2c j)) k actd in
let p = mt_get_path_ lv hs rhs i j k S.empty actd in
log2c_div j; log2c_bound (j / 2) (32 - (lv + 1));
assert (mt_hashes_lth_inv (lv + 1) (j / 2) (merge_hs #_ #f olds hs));
assert (mt_hashes_lth_inv_log #hsz (j / 2)
(S.slice (merge_hs #_ #f olds hs) (lv + 1) (lv + 1 + log2c (j / 2))));
let npsa = mt_get_path_step_acc j
(S.index (merge_hs #_ #f olds hs) lv) (S.index rhs lv) k actd in
let npa = mt_get_path_acc #_ #f (j / 2)
(S.slice (merge_hs #_ #f olds hs) (lv + 1) (lv + 1 + log2c (j / 2)))
(S.slice rhs (lv + 1) (lv + 1 + log2c (j / 2))) (k / 2) nactd_ in
let nps = mt_make_path_step lv hs rhs i j k S.empty actd in
let np = mt_get_path_ (lv + 1) hs rhs (i / 2) (j / 2) (k / 2) nps nactd in
let npe = mt_get_path_ (lv + 1) hs rhs (i / 2) (j / 2) (k / 2) S.empty nactd in
mt_get_path_pull (lv + 1) hs rhs (i / 2) (j / 2) (k / 2) nps nactd;
assert (S.equal p np);
assert (S.equal np (S.append nps npe));
assert (S.equal p (S.append nps npe));
assert (S.equal pa (if Some? npsa
then S.cons (Some?.v npsa) npa
else npa));
mt_get_path_acc_consistent #_ #f (lv + 1) (i / 2) (j / 2)
olds hs rhs (k / 2) nactd;
assert (S.equal npa npe);
mt_get_path_step_acc_consistent #_ #f lv i j olds hs rhs k actd;
if Some? npsa
then begin
assert (S.equal nps (S.cons (Some?.v npsa) S.empty));
assert (S.equal p (S.append (S.cons (Some?.v npsa) S.empty) npa));
assert (S.equal pa (S.cons (Some?.v npsa) npa));
seq_cons_append (Some?.v npsa) npa;
assert (S.equal pa p)
end
else begin
assert (S.equal nps S.empty);
S.append_empty_l npe;
assert (S.equal p npe);
assert (S.equal pa npa);
assert (S.equal pa p)
end
end
#pop-options
val mt_get_path_acc_inv_ok:
#hsz:pos -> #f:MTS.hash_fun_t ->
j:nat ->
fhs:hashess #hsz {S.length fhs = log2c j} ->
rhs:hashes #hsz {S.length rhs = log2c j} ->
k:nat{k <= j} ->
acc:hash -> actd:bool ->
Lemma (requires (j > 0 /\
mt_hashes_lth_inv_log #hsz j fhs /\
mt_hashes_inv_log #_ #f j fhs /\
mt_rhs_inv #_ #f j (hash_seq_spec_full #_ #f (S.head fhs) acc actd) rhs actd))
(ensures (S.equal (path_spec k j actd (mt_get_path_acc #_ #f j fhs rhs k actd))
(MTS.mt_get_path #_ #f #(log2c j)
(hash_seq_spec_full #_ #f (S.head fhs) acc actd) k)))
(decreases j)
#push-options "--z3rlimit 120 --max_fuel 1"
let rec mt_get_path_acc_inv_ok #_ #f j fhs rhs k acc actd =
// Below dummy `let` is necessary to provide guidance to the SMT solver.
let _ = mt_get_path_step_acc j (S.head fhs) (S.head rhs) k actd in
let smt = hash_seq_spec_full #_ #f (S.head fhs) acc actd in
let nacc = (if j % 2 = 0 then acc
else if actd
then f (S.last (S.head fhs)) acc
else S.last (S.head fhs)) in
let nactd = actd || j % 2 = 1 in
if j = 1 then (if k = 0 then () else ())
else begin
mt_hashes_lth_inv_log_next #_ #f j fhs;
hash_seq_spec_full_next #_ #f j (S.head fhs) (S.head (S.tail fhs)) acc actd nacc nactd;
mt_get_path_acc_inv_ok #_ #f (j / 2) (S.tail fhs) (S.tail rhs) (k / 2) nacc nactd;
if k % 2 = 0
then begin
if k = j || (k + 1 = j && not actd)
then assert (S.index smt (k + 1) == MTS.HPad)
else if k + 1 = j
then assert (S.index smt (k + 1) == MTS.HRaw (S.head rhs))
else hash_seq_spec_full_index_raw #_ #f (S.head fhs) acc actd (k + 1)
end
else begin
hash_seq_spec_full_index_raw #_ #f (S.head fhs) acc actd (k - 1)
end
end
#pop-options
#push-options "--max_fuel 1 --initial_fuel 1 --max_ifuel 0 --z3rlimit 60"
val mt_get_path_inv_ok_:
#hsz:pos -> #f:MTS.hash_fun_t ->
lv:nat{lv < 32} ->
i:nat ->
j:nat{j > 0 /\ i <= j /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv i olds} ->
hs:hashess #hsz {S.length hs = 32 /\ hs_wf_elts lv hs i j} ->
rhs:hashes #hsz {S.length rhs = 32} ->
k:nat{i <= k && k <= j} ->
p:path #hsz ->
acc:hash -> actd:bool ->
Lemma (requires (log2c_div j; log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
(mt_hashes_inv #_ #f lv j (merge_hs #_ #f olds hs) /\
(let t1 = hash_seq_spec_full #_ #f (S.index (merge_hs #_ #f olds hs) lv) acc actd in
let t2 = S.slice rhs lv (lv + log2c j) in
mt_rhs_inv #_ #f j t1 t2 actd))))
(ensures (S.equal (path_spec k j actd
(S.slice (mt_get_path_ lv hs rhs i j k p actd)
(S.length p) (S.length p + mt_path_length k j actd)))
(MTS.mt_get_path #_ #f #(log2c j)
(hash_seq_spec_full #_ #f
(S.index (merge_hs #_ #f olds hs) lv) acc actd) k)))
let mt_get_path_inv_ok_ #_ #f lv i j olds hs rhs k p acc actd =
log2c_div j; log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
mt_hashes_lth_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
mt_hashes_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
mt_get_path_acc_consistent #_ #f lv i j olds hs rhs k actd;
mt_get_path_slice lv hs rhs i j k p actd;
mt_get_path_acc_inv_ok #_ #f j
(S.slice (merge_hs #_ #f olds hs) lv (lv + log2c j))
(S.slice rhs lv (lv + log2c j))
k acc actd
#pop-options
val mt_get_path_inv_ok:
#hsz:pos ->
mt:merkle_tree #hsz {mt_wf_elts mt} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz 0 (MT?.i mt) olds} ->
idx:nat{MT?.i mt <= idx && idx < MT?.j mt} ->
drt:hash ->
Lemma (requires (MT?.j mt > 0 /\ mt_inv mt olds))
(ensures (let j, p, rt = mt_get_path mt idx drt in
j == MT?.j mt /\
mt_root_inv #_ #(MT?.hash_fun mt) (mt_base mt olds) hash_init false rt /\
S.head p == S.index (mt_base mt olds) idx /\
(assert (S.length (S.tail p) == mt_path_length idx (MT?.j mt) false);
S.equal (path_spec idx (MT?.j mt) false (S.tail p))
(MTS.mt_get_path #_ #(MT?.hash_fun mt) #(log2c j) (mt_spec mt olds) idx))))
#push-options "--z3rlimit 40"
let mt_get_path_inv_ok #hsz mt olds idx drt =
let j, p, rt = mt_get_path mt idx drt in
mt_get_root_inv_ok mt drt olds;
assert (j == MT?.j mt);
assert (mt_root_inv #_ #(MT?.hash_fun mt) (mt_base mt olds) hash_init false rt);
let ofs = offset_of (MT?.i mt) in
let umt, _ = mt_get_root mt drt in
let ip = path_insert S.empty (S.index (mt_base mt olds) idx) in
mt_get_path_unchanged 0 (MT?.hs umt) (MT?.rhs umt)
(MT?.i umt) (MT?.j umt) idx ip false;
assert (S.head ip == S.head (S.slice p 0 (S.length ip)));
assert (S.head ip == S.head p);
assert (S.head p == S.index (mt_base mt olds) idx);
assert (S.length (S.tail p) == mt_path_length idx (MT?.j mt) false);
mt_get_path_inv_ok_ #_ #(MT?.hash_fun mt) 0 (MT?.i umt) (MT?.j umt)
olds (MT?.hs umt) (MT?.rhs umt) idx ip hash_init false
#pop-options
val mt_verify_ok_:
#hsz:pos -> #f:MTS.hash_fun_t ->
k:nat ->
j:nat{k <= j} ->
p:path ->
ppos:nat ->
acc:hash #hsz ->
actd:bool ->
Lemma (requires (ppos + mt_path_length k j actd <= S.length p))
(ensures (MTS.HRaw (mt_verify_ #_ #f k j p ppos acc actd) ==
MTS.mt_verify_ #_ #f #(log2c j)
(path_spec k j actd
(S.slice p ppos (ppos + mt_path_length k j actd)))
k (MTS.HRaw acc)))
(decreases j)
#push-options "--z3rlimit 40 --max_fuel 1"
let rec mt_verify_ok_ #hsz #f k j p ppos acc actd =
if j = 0 then ()
else begin
log2c_div j;
let vi = mt_verify_ #_ #f k j p ppos acc actd in
let plen = mt_path_length k j actd in
let vs = MTS.mt_verify_ #_ #f #(log2c j)
(path_spec k j actd (S.slice p ppos (ppos + plen)))
k (MTS.HRaw acc) in
let nactd = actd || (j % 2 = 1) in
let nplen = mt_path_length (k / 2) (j / 2) nactd in
if k % 2 = 0
then begin
if j = k || (j = k + 1 && not actd)
then begin
assert (vi == mt_verify_ #_ #f (k / 2) (j / 2) p ppos acc nactd);
assert (plen == nplen);
assert (S.equal (path_spec k j actd (S.slice p ppos (ppos + plen)))
(S.cons MTS.HPad
(path_spec (k / 2) (j / 2) nactd
(S.slice p ppos (ppos + plen)))));
assert (vs ==
MTS.mt_verify_ #_ #f #(log2c (j / 2))
(path_spec (k / 2) (j / 2) nactd (S.slice p ppos (ppos + plen)))
(k / 2) (MTS.HRaw acc));
mt_verify_ok_ #_ #f (k / 2) (j / 2) p ppos acc nactd
end
else begin
let nacc = f acc (S.index p ppos) in
assert (vi == mt_verify_ #_ #f (k / 2) (j / 2) p (ppos + 1) nacc nactd);
assert (plen == nplen + 1);
assert (S.equal (S.tail (S.slice p ppos (ppos + plen)))
(S.slice p (ppos + 1) (ppos + 1 + nplen)));
assert (S.equal (path_spec k j actd (S.slice p ppos (ppos + plen)))
(S.cons (MTS.HRaw (S.index p ppos))
(path_spec (k / 2) (j / 2) nactd
(S.slice p (ppos + 1) (ppos + 1 + nplen)))));
assert (vs ==
MTS.mt_verify_ #_ #f #(log2c (j / 2))
(path_spec (k / 2) (j / 2) nactd
(S.slice p (ppos + 1) (ppos + 1 + nplen)))
(k / 2) (MTS.HRaw nacc));
mt_verify_ok_ #_ #f (k / 2) (j / 2) p (ppos + 1) nacc nactd
end
end
else begin
let nacc = f (S.index p ppos) acc in
assert (vi == mt_verify_ #_ #f (k / 2) (j / 2) p (ppos + 1) nacc nactd);
assert (plen == 1 + nplen);
assert (S.equal (S.tail (S.slice p ppos (ppos + plen)))
(S.slice p (ppos + 1) (ppos + 1 + nplen)));
assert (S.equal (path_spec k j actd (S.slice p ppos (ppos + plen)))
(S.cons (MTS.HRaw (S.index p ppos))
(path_spec (k / 2) (j / 2) nactd
(S.slice p (ppos + 1) (ppos + 1 + nplen)))));
assert (vs ==
MTS.mt_verify_ #_ #f #(log2c (j / 2))
(path_spec (k / 2) (j / 2) nactd
(S.slice p (ppos + 1) (ppos + 1 + nplen)))
(k / 2) (MTS.HRaw nacc));
mt_verify_ok_ #_ #f (k / 2) (j / 2) p (ppos + 1) nacc nactd
end
end
#pop-options
val mt_verify_ok:
#hsz:pos -> #f:MTS.hash_fun_t ->
k:nat ->
j:nat{k < j} ->
p:path #hsz {S.length p = 1 + mt_path_length k j false} ->
rt:hash #hsz ->
Lemma (mt_verify #_ #f k j p rt <==>
MTS.mt_verify #_ #f #(log2c j) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"MerkleTree.Spec.fst.checked",
"MerkleTree.New.High.Correct.Rhs.fst.checked",
"MerkleTree.New.High.Correct.Base.fst.checked",
"MerkleTree.New.High.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"EverCrypt.Helpers.fsti.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": false,
"source_file": "MerkleTree.New.High.Correct.Path.fst"
} | [
{
"abbrev": false,
"full_module": "MerkleTree.New.High",
"short_module": null
},
{
"abbrev": true,
"full_module": "MerkleTree.Spec",
"short_module": "MTS"
},
{
"abbrev": true,
"full_module": "EverCrypt.Hash",
"short_module": "EHS"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "List"
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Classical",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct.Rhs",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt.Helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
k: Prims.nat ->
j: Prims.nat{k < j} ->
p:
MerkleTree.New.High.path
{FStar.Seq.Base.length p = 1 + MerkleTree.New.High.mt_path_length k j false} ->
rt: MerkleTree.New.High.hash
-> FStar.Pervasives.Lemma
(ensures
MerkleTree.New.High.mt_verify k j p rt <==>
MerkleTree.Spec.mt_verify (MerkleTree.New.High.Correct.Path.path_spec k
j
false
(FStar.Seq.Properties.tail p))
k
(MerkleTree.Spec.HRaw (FStar.Seq.Properties.head p))
(MerkleTree.Spec.HRaw rt)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.pos",
"MerkleTree.Spec.hash_fun_t",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"MerkleTree.New.High.path",
"Prims.op_Equality",
"Prims.int",
"FStar.Seq.Base.length",
"MerkleTree.New.High.hash",
"Prims.op_Addition",
"MerkleTree.New.High.mt_path_length",
"MerkleTree.New.High.Correct.Path.mt_verify_ok_",
"FStar.Seq.Properties.head",
"Prims.unit"
] | [] | true | false | true | false | false | let mt_verify_ok #_ #f k j p rt =
| mt_verify_ok_ #_ #f k j p 1 (S.head p) false | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_fuel_default | val va_fuel_default : unit -> va_fuel | val va_fuel_default : unit -> va_fuel | let va_fuel_default () = 0 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 26,
"end_line": 27,
"start_col": 0,
"start_line": 27
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | _: Prims.unit -> Vale.PPC64LE.Decls.va_fuel | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Vale.PPC64LE.Decls.va_fuel"
] | [] | false | false | false | true | false | let va_fuel_default () =
| 0 | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_cmp_eq | val va_cmp_eq (o1:cmp_opr) (o2:cmp_opr) : ocmp | val va_cmp_eq (o1:cmp_opr) (o2:cmp_opr) : ocmp | let va_cmp_eq o1 o2 = S.OEq o1 o2 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 33,
"end_line": 52,
"start_col": 0,
"start_line": 52
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | o1: Vale.PPC64LE.Machine_s.cmp_opr -> o2: Vale.PPC64LE.Machine_s.cmp_opr -> Vale.PPC64LE.Decls.ocmp | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Machine_s.cmp_opr",
"Vale.PPC64LE.Semantics_s.OEq",
"Vale.PPC64LE.Decls.ocmp"
] | [] | false | false | false | true | false | let va_cmp_eq o1 o2 =
| S.OEq o1 o2 | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_cmp_ne | val va_cmp_ne (o1:cmp_opr) (o2:cmp_opr) : ocmp | val va_cmp_ne (o1:cmp_opr) (o2:cmp_opr) : ocmp | let va_cmp_ne o1 o2 = S.ONe o1 o2 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 33,
"end_line": 53,
"start_col": 0,
"start_line": 53
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | o1: Vale.PPC64LE.Machine_s.cmp_opr -> o2: Vale.PPC64LE.Machine_s.cmp_opr -> Vale.PPC64LE.Decls.ocmp | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Machine_s.cmp_opr",
"Vale.PPC64LE.Semantics_s.ONe",
"Vale.PPC64LE.Decls.ocmp"
] | [] | false | false | false | true | false | let va_cmp_ne o1 o2 =
| S.ONe o1 o2 | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_cmp_ge | val va_cmp_ge (o1:cmp_opr) (o2:cmp_opr) : ocmp | val va_cmp_ge (o1:cmp_opr) (o2:cmp_opr) : ocmp | let va_cmp_ge o1 o2 = S.OGe o1 o2 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 33,
"end_line": 55,
"start_col": 0,
"start_line": 55
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | o1: Vale.PPC64LE.Machine_s.cmp_opr -> o2: Vale.PPC64LE.Machine_s.cmp_opr -> Vale.PPC64LE.Decls.ocmp | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Machine_s.cmp_opr",
"Vale.PPC64LE.Semantics_s.OGe",
"Vale.PPC64LE.Decls.ocmp"
] | [] | false | false | false | true | false | let va_cmp_ge o1 o2 =
| S.OGe o1 o2 | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_cmp_le | val va_cmp_le (o1:cmp_opr) (o2:cmp_opr) : ocmp | val va_cmp_le (o1:cmp_opr) (o2:cmp_opr) : ocmp | let va_cmp_le o1 o2 = S.OLe o1 o2 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 33,
"end_line": 54,
"start_col": 0,
"start_line": 54
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | o1: Vale.PPC64LE.Machine_s.cmp_opr -> o2: Vale.PPC64LE.Machine_s.cmp_opr -> Vale.PPC64LE.Decls.ocmp | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Machine_s.cmp_opr",
"Vale.PPC64LE.Semantics_s.OLe",
"Vale.PPC64LE.Decls.ocmp"
] | [] | false | false | false | true | false | let va_cmp_le o1 o2 =
| S.OLe o1 o2 | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_cmp_gt | val va_cmp_gt (o1:cmp_opr) (o2:cmp_opr) : ocmp | val va_cmp_gt (o1:cmp_opr) (o2:cmp_opr) : ocmp | let va_cmp_gt o1 o2 = S.OGt o1 o2 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 33,
"end_line": 57,
"start_col": 0,
"start_line": 57
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | o1: Vale.PPC64LE.Machine_s.cmp_opr -> o2: Vale.PPC64LE.Machine_s.cmp_opr -> Vale.PPC64LE.Decls.ocmp | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Machine_s.cmp_opr",
"Vale.PPC64LE.Semantics_s.OGt",
"Vale.PPC64LE.Decls.ocmp"
] | [] | false | false | false | true | false | let va_cmp_gt o1 o2 =
| S.OGt o1 o2 | false |
Hacl.Impl.Chacha20Poly1305.fst | Hacl.Impl.Chacha20Poly1305.poly1305_do | val poly1305_do: #w:field_spec -> poly1305_do_core_st w | val poly1305_do: #w:field_spec -> poly1305_do_core_st w | let poly1305_do #w k aadlen aad mlen m out =
push_frame();
let ctx = create (nlimb w +! precomplen w) (limb_zero w) in
let block = create 16ul (u8 0) in
poly1305_do_ #w k aadlen aad mlen m ctx block;
Poly.poly1305_finish out k ctx;
pop_frame() | {
"file_name": "code/chacha20poly1305/Hacl.Impl.Chacha20Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 13,
"end_line": 103,
"start_col": 0,
"start_line": 97
} | module Hacl.Impl.Chacha20Poly1305
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Hacl.Impl.Chacha20Poly1305.PolyCore
open Hacl.Impl.Poly1305.Fields
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module Spec = Spec.Chacha20Poly1305
module SpecPoly = Spec.Poly1305
module Poly = Hacl.Impl.Poly1305
#reset-options "--z3rlimit 150 --max_fuel 0 --max_ifuel 1 --record_options"
val poly1305_do_:
#w:field_spec
-> k:lbuffer uint8 32ul // key
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen // authenticated additional data
-> mlen:size_t
-> m:lbuffer uint8 mlen // plaintext
-> ctx:Poly.poly1305_ctx w
-> block:lbuffer uint8 16ul ->
Stack unit
(requires fun h ->
live h k /\ live h aad /\ live h m /\ live h ctx /\ live h block /\
disjoint ctx k /\ disjoint ctx aad /\ disjoint ctx m /\ disjoint ctx block /\
disjoint block k /\ disjoint block aad /\ disjoint block m)
(ensures fun h0 _ h1 ->
modifies (loc ctx |+| loc block) h0 h1 /\
(let acc, r = SpecPoly.poly1305_init (as_seq h0 k) in
let acc = if (length aad <> 0) then Spec.poly1305_padded r (as_seq h0 aad) acc else acc in
let acc = if (length m <> 0) then Spec.poly1305_padded r (as_seq h0 m) acc else acc in
let block_s = LSeq.concat (BSeq.uint_to_bytes_le #U64 (u64 (length aad)))
(BSeq.uint_to_bytes_le #U64 (u64 (length m))) in
let acc = SpecPoly.poly1305_update1 r 16 block_s acc in
Poly.as_get_acc h1 ctx == acc /\ as_seq h1 block == block_s /\
Poly.state_inv_t h1 ctx))
[@Meta.Attribute.inline_]
let poly1305_do_ #w k aadlen aad mlen m ctx block =
Poly.poly1305_init ctx k;
if (aadlen <> 0ul) then (
poly1305_padded ctx aadlen aad)
else ();
if (mlen <> 0ul) then (
poly1305_padded ctx mlen m)
else ();
let h0 = ST.get () in
update_sub_f h0 block 0ul 8ul
(fun h -> BSeq.uint_to_bytes_le #U64 (to_u64 aadlen))
(fun _ -> uint_to_bytes_le (sub block 0ul 8ul) (to_u64 aadlen));
let h1 = ST.get () in
//assert (LSeq.sub (as_seq h1 block) 0 8 == BSeq.uint_to_bytes_le #U64 (to_u64 aadlen));
Poly.reveal_ctx_inv ctx h0 h1;
update_sub_f h1 block 8ul 8ul
(fun h -> BSeq.uint_to_bytes_le #U64 (to_u64 mlen))
(fun _ -> uint_to_bytes_le (sub block 8ul 8ul) (to_u64 mlen));
let h2 = ST.get () in
//assert (LSeq.sub (as_seq h2 block) 8 8 == BSeq.uint_to_bytes_le #U64 (to_u64 mlen));
LSeq.eq_intro (LSeq.sub (as_seq h2 block) 0 8) (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen));
LSeq.lemma_concat2 8 (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen)) 8 (BSeq.uint_to_bytes_le #U64 (to_u64 mlen)) (as_seq h2 block);
//assert (as_seq h2 block == LSeq.concat (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen)) (BSeq.uint_to_bytes_le #U64 (to_u64 mlen)));
Poly.reveal_ctx_inv ctx h1 h2;
Poly.poly1305_update1 ctx block
// Implements the actual poly1305_do operation
inline_for_extraction noextract
let poly1305_do_core_st (w:field_spec) =
k:lbuffer uint8 32ul // key
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen // authenticated additional data
-> mlen:size_t
-> m:lbuffer uint8 mlen // plaintext
-> out:lbuffer uint8 16ul -> // output: tag
Stack unit
(requires fun h ->
live h k /\ live h aad /\ live h m /\ live h out /\
disjoint k out)
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
as_seq h1 out == Spec.poly1305_do (as_seq h0 k) (as_seq h0 m) (as_seq h0 aad))
noextract
val poly1305_do: #w:field_spec -> poly1305_do_core_st w | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"Spec.Chacha20Poly1305.fst.checked",
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"Hacl.Impl.Chacha20Poly1305.PolyCore.fst.checked",
"Hacl.Impl.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20Poly1305.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "Poly"
},
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "SpecPoly"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20Poly1305",
"short_module": "Spec"
},
{
"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": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20Poly1305.PolyCore",
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 150,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Hacl.Impl.Chacha20Poly1305.poly1305_do_core_st w | Prims.Tot | [
"total"
] | [] | [
"Hacl.Impl.Poly1305.Fields.field_spec",
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint8",
"FStar.UInt32.__uint_to_t",
"Lib.IntTypes.size_t",
"FStar.HyperStack.ST.pop_frame",
"Prims.unit",
"Hacl.Impl.Poly1305.poly1305_finish",
"Hacl.Impl.Chacha20Poly1305.poly1305_do_",
"Lib.Buffer.lbuffer_t",
"Lib.Buffer.MUT",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"FStar.UInt32.uint_to_t",
"FStar.UInt32.t",
"Lib.Buffer.create",
"Lib.IntTypes.u8",
"Hacl.Spec.Poly1305.Field32xN.uint64xN",
"Lib.IntTypes.add",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Hacl.Impl.Poly1305.Fields.limb",
"Lib.IntTypes.op_Plus_Bang",
"Hacl.Impl.Poly1305.Fields.nlimb",
"Hacl.Impl.Poly1305.Fields.precomplen",
"Hacl.Impl.Poly1305.Fields.limb_zero",
"FStar.HyperStack.ST.push_frame"
] | [] | false | false | false | false | false | let poly1305_do #w k aadlen aad mlen m out =
| push_frame ();
let ctx = create (nlimb w +! precomplen w) (limb_zero w) in
let block = create 16ul (u8 0) in
poly1305_do_ #w k aadlen aad mlen m ctx block;
Poly.poly1305_finish out k ctx;
pop_frame () | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.eval_code | val eval_code (c:va_code) (s0:va_state) (f0:va_fuel) (sN:va_state) : prop0 | val eval_code (c:va_code) (s0:va_state) (f0:va_fuel) (sN:va_state) : prop0 | let eval_code = Lemmas.eval_code | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 32,
"end_line": 59,
"start_col": 0,
"start_line": 59
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false |
c: Vale.PPC64LE.Decls.va_code ->
s0: Vale.PPC64LE.Decls.va_state ->
f0: Vale.PPC64LE.Decls.va_fuel ->
sN: Vale.PPC64LE.Decls.va_state
-> Vale.Def.Prop_s.prop0 | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Lemmas.eval_code"
] | [] | false | false | false | true | false | let eval_code =
| Lemmas.eval_code | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.eval_while_inv | val eval_while_inv (c:va_code) (s0:va_state) (fW:va_fuel) (sW:va_state) : prop0 | val eval_while_inv (c:va_code) (s0:va_state) (fW:va_fuel) (sW:va_state) : prop0 | let eval_while_inv = Lemmas.eval_while_inv | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 42,
"end_line": 60,
"start_col": 0,
"start_line": 60
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false |
c: Vale.PPC64LE.Decls.va_code ->
s0: Vale.PPC64LE.Decls.va_state ->
fW: Vale.PPC64LE.Decls.va_fuel ->
sW: Vale.PPC64LE.Decls.va_state
-> Vale.Def.Prop_s.prop0 | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Lemmas.eval_while_inv"
] | [] | false | false | false | true | false | let eval_while_inv =
| Lemmas.eval_while_inv | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.eval_cmp_cr0 | val eval_cmp_cr0 : s:va_state -> c:ocmp -> cr0_t | val eval_cmp_cr0 : s:va_state -> c:ocmp -> cr0_t | let eval_cmp_cr0 = S.eval_cmp_cr0 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 33,
"end_line": 66,
"start_col": 0,
"start_line": 66
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | s: Vale.PPC64LE.Decls.va_state -> c: Vale.PPC64LE.Decls.ocmp -> Vale.PPC64LE.Machine_s.cr0_t | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Semantics_s.eval_cmp_cr0"
] | [] | false | false | false | true | false | let eval_cmp_cr0 =
| S.eval_cmp_cr0 | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.valid_ocmp | val valid_ocmp : c:ocmp -> s:va_state -> GTot bool | val valid_ocmp : c:ocmp -> s:va_state -> GTot bool | let valid_ocmp = Lemmas.valid_ocmp | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 34,
"end_line": 65,
"start_col": 0,
"start_line": 65
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = () | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | c: Vale.PPC64LE.Decls.ocmp -> s: Vale.PPC64LE.Decls.va_state -> Prims.GTot Prims.bool | Prims.GTot | [
"sometrivial"
] | [] | [
"Vale.PPC64LE.Lemmas.valid_ocmp"
] | [] | false | false | false | false | false | let valid_ocmp =
| Lemmas.valid_ocmp | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_cmp_lt | val va_cmp_lt (o1:cmp_opr) (o2:cmp_opr) : ocmp | val va_cmp_lt (o1:cmp_opr) (o2:cmp_opr) : ocmp | let va_cmp_lt o1 o2 = S.OLt o1 o2 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 33,
"end_line": 56,
"start_col": 0,
"start_line": 56
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | o1: Vale.PPC64LE.Machine_s.cmp_opr -> o2: Vale.PPC64LE.Machine_s.cmp_opr -> Vale.PPC64LE.Decls.ocmp | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Machine_s.cmp_opr",
"Vale.PPC64LE.Semantics_s.OLt",
"Vale.PPC64LE.Decls.ocmp"
] | [] | false | false | false | true | false | let va_cmp_lt o1 o2 =
| S.OLt o1 o2 | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.eval_ocmp | val eval_ocmp : s:va_state -> c:ocmp -> GTot bool | val eval_ocmp : s:va_state -> c:ocmp -> GTot bool | let eval_ocmp = Lemmas.eval_ocmp | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 32,
"end_line": 64,
"start_col": 0,
"start_line": 64
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = () | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | s: Vale.PPC64LE.Decls.va_state -> c: Vale.PPC64LE.Decls.ocmp -> Prims.GTot Prims.bool | Prims.GTot | [
"sometrivial"
] | [] | [
"Vale.PPC64LE.Lemmas.eval_ocmp"
] | [] | false | false | false | false | false | let eval_ocmp =
| Lemmas.eval_ocmp | false |
MerkleTree.New.High.Correct.Path.fst | MerkleTree.New.High.Correct.Path.mt_get_path_acc | val mt_get_path_acc:
#hsz:pos -> #f:MTS.hash_fun_t #hsz ->
j:nat ->
fhs:hashess #hsz {S.length fhs = log2c j /\ mt_hashes_lth_inv_log #hsz j fhs} ->
rhs:hashes #hsz {S.length rhs = log2c j} ->
k:nat{k <= j} ->
actd:bool ->
GTot (np:path #hsz {S.length np = mt_path_length k j actd})
(decreases j) | val mt_get_path_acc:
#hsz:pos -> #f:MTS.hash_fun_t #hsz ->
j:nat ->
fhs:hashess #hsz {S.length fhs = log2c j /\ mt_hashes_lth_inv_log #hsz j fhs} ->
rhs:hashes #hsz {S.length rhs = log2c j} ->
k:nat{k <= j} ->
actd:bool ->
GTot (np:path #hsz {S.length np = mt_path_length k j actd})
(decreases j) | let rec mt_get_path_acc #_ #f j fhs rhs k actd =
if j = 0 then S.empty
else
(let sp = mt_get_path_step_acc #_ j (S.head fhs) (S.head rhs) k actd in
let rp = mt_get_path_acc #_ #f (j / 2) (S.tail fhs) (S.tail rhs) (k / 2)
(actd || j % 2 = 1) in
if Some? sp
then (S.cons (Some?.v sp) rp)
else rp) | {
"file_name": "src/MerkleTree.New.High.Correct.Path.fst",
"git_rev": "7d7bdc20f2033171e279c176b26e84f9069d23c6",
"git_url": "https://github.com/hacl-star/merkle-tree.git",
"project_name": "merkle-tree"
} | {
"end_col": 12,
"end_line": 81,
"start_col": 0,
"start_line": 73
} | module MerkleTree.New.High.Correct.Path
open EverCrypt
open EverCrypt.Helpers
open MerkleTree.New.High.Correct.Base
// Need to use some facts of `mt_get_root`
open MerkleTree.New.High.Correct.Rhs
open FStar.Classical
open FStar.Ghost
open FStar.Seq
module List = FStar.List.Tot
module S = FStar.Seq
module U32 = FStar.UInt32
module U8 = FStar.UInt8
type uint32_t = U32.t
type uint8_t = U8.t
module EHS = EverCrypt.Hash
module MTS = MerkleTree.Spec
open MerkleTree.New.High
#reset-options "--z3rlimit 20"
/// Correctness of path generation
val path_spec:
#hsz:pos ->
k:nat ->
j:nat{k <= j} ->
actd:bool ->
p:path #hsz {S.length p = mt_path_length k j actd} ->
GTot (sp:S.seq (MTS.padded_hash #hsz){S.length sp = log2c j})
(decreases j)
let rec path_spec #hsz k j actd p =
if j = 0 then S.empty
else (if k % 2 = 0
then (if j = k || (j = k + 1 && not actd)
then S.cons MTS.HPad (path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) p)
else S.cons (MTS.HRaw #hsz (S.head p))
(path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) (S.tail p)))
else S.cons (MTS.HRaw #hsz (S.head p))
(path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) (S.tail p)))
val mt_get_path_step_acc:
#hsz:pos ->
j:nat{j > 0} ->
chs:hashes #hsz {S.length chs = j} ->
crh:hash #hsz ->
k:nat{k <= j} ->
actd:bool ->
GTot (option (hash #hsz))
let mt_get_path_step_acc #hsz j chs crh k actd =
if k % 2 = 1
then Some (S.index chs (k - 1))
else (if k = j then None
else if k + 1 = j
then (if actd then Some crh else None)
else Some (S.index chs (k + 1)))
val mt_get_path_acc:
#hsz:pos -> #f:MTS.hash_fun_t #hsz ->
j:nat ->
fhs:hashess #hsz {S.length fhs = log2c j /\ mt_hashes_lth_inv_log #hsz j fhs} ->
rhs:hashes #hsz {S.length rhs = log2c j} ->
k:nat{k <= j} ->
actd:bool ->
GTot (np:path #hsz {S.length np = mt_path_length k j actd}) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"MerkleTree.Spec.fst.checked",
"MerkleTree.New.High.Correct.Rhs.fst.checked",
"MerkleTree.New.High.Correct.Base.fst.checked",
"MerkleTree.New.High.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"EverCrypt.Helpers.fsti.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": false,
"source_file": "MerkleTree.New.High.Correct.Path.fst"
} | [
{
"abbrev": false,
"full_module": "MerkleTree.New.High",
"short_module": null
},
{
"abbrev": true,
"full_module": "MerkleTree.Spec",
"short_module": "MTS"
},
{
"abbrev": true,
"full_module": "EverCrypt.Hash",
"short_module": "EHS"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "List"
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Classical",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct.Rhs",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt.Helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
j: Prims.nat ->
fhs:
MerkleTree.New.High.hashess
{ FStar.Seq.Base.length fhs = MerkleTree.New.High.Correct.Base.log2c j /\
MerkleTree.New.High.Correct.Base.mt_hashes_lth_inv_log j fhs } ->
rhs:
MerkleTree.New.High.hashes
{FStar.Seq.Base.length rhs = MerkleTree.New.High.Correct.Base.log2c j} ->
k: Prims.nat{k <= j} ->
actd: Prims.bool
-> Prims.GTot
(np:
MerkleTree.New.High.path
{FStar.Seq.Base.length np = MerkleTree.New.High.mt_path_length k j actd}) | Prims.GTot | [
"sometrivial",
""
] | [] | [
"Prims.pos",
"MerkleTree.Spec.hash_fun_t",
"Prims.nat",
"MerkleTree.New.High.hashess",
"Prims.l_and",
"Prims.b2t",
"Prims.op_Equality",
"FStar.Seq.Base.length",
"MerkleTree.New.High.hashes",
"MerkleTree.New.High.Correct.Base.log2c",
"MerkleTree.New.High.Correct.Base.mt_hashes_lth_inv_log",
"MerkleTree.New.High.hash",
"Prims.op_LessThanOrEqual",
"Prims.bool",
"Prims.int",
"FStar.Seq.Base.empty",
"FStar.Pervasives.Native.uu___is_Some",
"FStar.Seq.Base.cons",
"FStar.Pervasives.Native.__proj__Some__item__v",
"MerkleTree.New.High.path",
"MerkleTree.New.High.mt_path_length",
"Prims.op_Division",
"Prims.op_BarBar",
"Prims.op_Modulus",
"MerkleTree.New.High.Correct.Path.mt_get_path_acc",
"FStar.Seq.Properties.tail",
"FStar.Pervasives.Native.option",
"MerkleTree.New.High.Correct.Path.mt_get_path_step_acc",
"FStar.Seq.Properties.head"
] | [
"recursion"
] | false | false | false | false | false | let rec mt_get_path_acc #_ #f j fhs rhs k actd =
| if j = 0
then S.empty
else
(let sp = mt_get_path_step_acc #_ j (S.head fhs) (S.head rhs) k actd in
let rp = mt_get_path_acc #_ #f (j / 2) (S.tail fhs) (S.tail rhs) (k / 2) (actd || j % 2 = 1) in
if Some? sp then (S.cons (Some?.v sp) rp) else rp) | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_eval_ins | val va_eval_ins : c: Vale.PPC64LE.Lemmas.code -> s0: Vale.PPC64LE.State.state
-> Prims.Pure (Vale.PPC64LE.State.state * Vale.PPC64LE.Lemmas.fuel) | let va_eval_ins = Lemmas.eval_ins | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 68,
"start_col": 7,
"start_line": 68
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | c: Vale.PPC64LE.Lemmas.code -> s0: Vale.PPC64LE.State.state
-> Prims.Pure (Vale.PPC64LE.State.state * Vale.PPC64LE.Lemmas.fuel) | Prims.Pure | [] | [] | [
"Vale.PPC64LE.Lemmas.eval_ins"
] | [] | false | false | false | false | false | let va_eval_ins =
| Lemmas.eval_ins | false |
|
MerkleTree.New.High.Correct.Path.fst | MerkleTree.New.High.Correct.Path.path_spec | val path_spec:
#hsz:pos ->
k:nat ->
j:nat{k <= j} ->
actd:bool ->
p:path #hsz {S.length p = mt_path_length k j actd} ->
GTot (sp:S.seq (MTS.padded_hash #hsz){S.length sp = log2c j})
(decreases j) | val path_spec:
#hsz:pos ->
k:nat ->
j:nat{k <= j} ->
actd:bool ->
p:path #hsz {S.length p = mt_path_length k j actd} ->
GTot (sp:S.seq (MTS.padded_hash #hsz){S.length sp = log2c j})
(decreases j) | let rec path_spec #hsz k j actd p =
if j = 0 then S.empty
else (if k % 2 = 0
then (if j = k || (j = k + 1 && not actd)
then S.cons MTS.HPad (path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) p)
else S.cons (MTS.HRaw #hsz (S.head p))
(path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) (S.tail p)))
else S.cons (MTS.HRaw #hsz (S.head p))
(path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) (S.tail p))) | {
"file_name": "src/MerkleTree.New.High.Correct.Path.fst",
"git_rev": "7d7bdc20f2033171e279c176b26e84f9069d23c6",
"git_url": "https://github.com/hacl-star/merkle-tree.git",
"project_name": "merkle-tree"
} | {
"end_col": 75,
"end_line": 46,
"start_col": 0,
"start_line": 38
} | module MerkleTree.New.High.Correct.Path
open EverCrypt
open EverCrypt.Helpers
open MerkleTree.New.High.Correct.Base
// Need to use some facts of `mt_get_root`
open MerkleTree.New.High.Correct.Rhs
open FStar.Classical
open FStar.Ghost
open FStar.Seq
module List = FStar.List.Tot
module S = FStar.Seq
module U32 = FStar.UInt32
module U8 = FStar.UInt8
type uint32_t = U32.t
type uint8_t = U8.t
module EHS = EverCrypt.Hash
module MTS = MerkleTree.Spec
open MerkleTree.New.High
#reset-options "--z3rlimit 20"
/// Correctness of path generation
val path_spec:
#hsz:pos ->
k:nat ->
j:nat{k <= j} ->
actd:bool ->
p:path #hsz {S.length p = mt_path_length k j actd} ->
GTot (sp:S.seq (MTS.padded_hash #hsz){S.length sp = log2c j}) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"MerkleTree.Spec.fst.checked",
"MerkleTree.New.High.Correct.Rhs.fst.checked",
"MerkleTree.New.High.Correct.Base.fst.checked",
"MerkleTree.New.High.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"EverCrypt.Helpers.fsti.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": false,
"source_file": "MerkleTree.New.High.Correct.Path.fst"
} | [
{
"abbrev": false,
"full_module": "MerkleTree.New.High",
"short_module": null
},
{
"abbrev": true,
"full_module": "MerkleTree.Spec",
"short_module": "MTS"
},
{
"abbrev": true,
"full_module": "EverCrypt.Hash",
"short_module": "EHS"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "List"
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Classical",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct.Rhs",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt.Helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
k: Prims.nat ->
j: Prims.nat{k <= j} ->
actd: Prims.bool ->
p:
MerkleTree.New.High.path
{FStar.Seq.Base.length p = MerkleTree.New.High.mt_path_length k j actd}
-> Prims.GTot
(sp:
FStar.Seq.Base.seq MerkleTree.Spec.padded_hash
{FStar.Seq.Base.length sp = MerkleTree.New.High.Correct.Base.log2c j}) | Prims.GTot | [
"sometrivial",
""
] | [] | [
"Prims.pos",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.bool",
"MerkleTree.New.High.path",
"Prims.op_Equality",
"FStar.Seq.Base.length",
"MerkleTree.New.High.hash",
"MerkleTree.New.High.mt_path_length",
"Prims.int",
"FStar.Seq.Base.empty",
"MerkleTree.Spec.padded_hash",
"Prims.op_Modulus",
"Prims.op_BarBar",
"Prims.op_AmpAmp",
"Prims.op_Addition",
"Prims.op_Negation",
"FStar.Seq.Base.cons",
"MerkleTree.Spec.HPad",
"MerkleTree.New.High.Correct.Path.path_spec",
"Prims.op_Division",
"MerkleTree.Spec.HRaw",
"FStar.Seq.Properties.head",
"FStar.Seq.Properties.tail",
"FStar.Seq.Base.seq",
"MerkleTree.New.High.Correct.Base.log2c"
] | [
"recursion"
] | false | false | false | false | false | let rec path_spec #hsz k j actd p =
| if j = 0
then S.empty
else
(if k % 2 = 0
then
(if j = k || (j = k + 1 && not actd)
then S.cons MTS.HPad (path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) p)
else
S.cons (MTS.HRaw #hsz (S.head p))
(path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) (S.tail p)))
else
S.cons (MTS.HRaw #hsz (S.head p)) (path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) (S.tail p))
) | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_compute_merge_total | val va_compute_merge_total (f0:va_fuel) (fM:va_fuel) : va_fuel | val va_compute_merge_total (f0:va_fuel) (fM:va_fuel) : va_fuel | let va_compute_merge_total = Lemmas.compute_merge_total | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 55,
"end_line": 84,
"start_col": 0,
"start_line": 84
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = () | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | f0: Vale.PPC64LE.Decls.va_fuel -> fM: Vale.PPC64LE.Decls.va_fuel -> Vale.PPC64LE.Decls.va_fuel | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Lemmas.compute_merge_total"
] | [] | false | false | false | true | false | let va_compute_merge_total =
| Lemmas.compute_merge_total | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.print_proc | val print_proc : (name:string) -> (code:va_code) -> (label:int) -> (p:printer) -> FStar.All.ML int | val print_proc : (name:string) -> (code:va_code) -> (label:int) -> (p:printer) -> FStar.All.ML int | let print_proc = P.print_proc | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 29,
"end_line": 98,
"start_col": 0,
"start_line": 98
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = ()
let va_compute_merge_total = Lemmas.compute_merge_total
let va_lemma_merge_total b0 s0 f0 sM fM sN = Lemmas.lemma_merge_total b0 s0 f0 sM fM sN; Lemmas.compute_merge_total f0 fM
let va_lemma_empty_total = Lemmas.lemma_empty_total
let va_lemma_ifElse_total = Lemmas.lemma_ifElse_total
let va_lemma_ifElseTrue_total = Lemmas.lemma_ifElseTrue_total
let va_lemma_ifElseFalse_total = Lemmas.lemma_ifElseFalse_total
let va_lemma_while_total = Lemmas.lemma_while_total
let va_lemma_whileTrue_total = Lemmas.lemma_whileTrue_total
let va_lemma_whileFalse_total = Lemmas.lemma_whileFalse_total
let va_lemma_whileMerge_total = Lemmas.lemma_whileMerge_total
let printer = P.printer
let print_string = FStar.IO.print_string | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false |
name: Prims.string ->
code: Vale.PPC64LE.Decls.va_code ->
label: Prims.int ->
p: Vale.PPC64LE.Decls.printer
-> FStar.All.ML Prims.int | FStar.All.ML | [
"ml"
] | [] | [
"Vale.PPC64LE.Print_s.print_proc"
] | [] | false | true | false | false | false | let print_proc =
| P.print_proc | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.printer | val printer : Type0 | val printer : Type0 | let printer = P.printer | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 23,
"end_line": 95,
"start_col": 0,
"start_line": 95
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = ()
let va_compute_merge_total = Lemmas.compute_merge_total
let va_lemma_merge_total b0 s0 f0 sM fM sN = Lemmas.lemma_merge_total b0 s0 f0 sM fM sN; Lemmas.compute_merge_total f0 fM
let va_lemma_empty_total = Lemmas.lemma_empty_total
let va_lemma_ifElse_total = Lemmas.lemma_ifElse_total
let va_lemma_ifElseTrue_total = Lemmas.lemma_ifElseTrue_total
let va_lemma_ifElseFalse_total = Lemmas.lemma_ifElseFalse_total
let va_lemma_while_total = Lemmas.lemma_while_total
let va_lemma_whileTrue_total = Lemmas.lemma_whileTrue_total
let va_lemma_whileFalse_total = Lemmas.lemma_whileFalse_total
let va_lemma_whileMerge_total = Lemmas.lemma_whileMerge_total | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Print_s.printer"
] | [] | false | false | false | true | true | let printer =
| P.printer | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.print_string | val print_string : string -> FStar.All.ML unit | val print_string : string -> FStar.All.ML unit | let print_string = FStar.IO.print_string | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 96,
"start_col": 0,
"start_line": 96
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = ()
let va_compute_merge_total = Lemmas.compute_merge_total
let va_lemma_merge_total b0 s0 f0 sM fM sN = Lemmas.lemma_merge_total b0 s0 f0 sM fM sN; Lemmas.compute_merge_total f0 fM
let va_lemma_empty_total = Lemmas.lemma_empty_total
let va_lemma_ifElse_total = Lemmas.lemma_ifElse_total
let va_lemma_ifElseTrue_total = Lemmas.lemma_ifElseTrue_total
let va_lemma_ifElseFalse_total = Lemmas.lemma_ifElseFalse_total
let va_lemma_while_total = Lemmas.lemma_while_total
let va_lemma_whileTrue_total = Lemmas.lemma_whileTrue_total
let va_lemma_whileFalse_total = Lemmas.lemma_whileFalse_total
let va_lemma_whileMerge_total = Lemmas.lemma_whileMerge_total | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | _: Prims.string -> FStar.All.ML Prims.unit | FStar.All.ML | [
"ml"
] | [] | [
"FStar.IO.print_string"
] | [] | false | true | false | false | false | let print_string =
| FStar.IO.print_string | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.print_header | val print_header : printer -> FStar.All.ML unit | val print_header : printer -> FStar.All.ML unit | let print_header = P.print_header | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 33,
"end_line": 97,
"start_col": 0,
"start_line": 97
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = ()
let va_compute_merge_total = Lemmas.compute_merge_total
let va_lemma_merge_total b0 s0 f0 sM fM sN = Lemmas.lemma_merge_total b0 s0 f0 sM fM sN; Lemmas.compute_merge_total f0 fM
let va_lemma_empty_total = Lemmas.lemma_empty_total
let va_lemma_ifElse_total = Lemmas.lemma_ifElse_total
let va_lemma_ifElseTrue_total = Lemmas.lemma_ifElseTrue_total
let va_lemma_ifElseFalse_total = Lemmas.lemma_ifElseFalse_total
let va_lemma_while_total = Lemmas.lemma_while_total
let va_lemma_whileTrue_total = Lemmas.lemma_whileTrue_total
let va_lemma_whileFalse_total = Lemmas.lemma_whileFalse_total
let va_lemma_whileMerge_total = Lemmas.lemma_whileMerge_total
let printer = P.printer | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | _: Vale.PPC64LE.Decls.printer -> FStar.All.ML Prims.unit | FStar.All.ML | [
"ml"
] | [] | [
"Vale.PPC64LE.Print_s.print_header"
] | [] | false | true | false | false | false | let print_header =
| P.print_header | false |
Hacl.Impl.Chacha20Poly1305.fst | Hacl.Impl.Chacha20Poly1305.derive_key_poly1305_do | val derive_key_poly1305_do:
#w:field_spec
-> k:lbuffer uint8 32ul
-> n:lbuffer uint8 12ul
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen
-> mlen:size_t
-> m:lbuffer uint8 mlen
-> out:lbuffer uint8 16ul ->
Stack unit
(requires fun h ->
live h k /\ live h n /\ live h aad /\ live h m /\ live h out)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
(let key:LSeq.lseq uint8 64 = Spec.Chacha20.chacha20_encrypt_bytes (as_seq h0 k) (as_seq h0 n) 0 (LSeq.create 64 (u8 0)) in
as_seq h1 out == Spec.poly1305_do (LSeq.sub key 0 32) (as_seq h0 m) (as_seq h0 aad))) | val derive_key_poly1305_do:
#w:field_spec
-> k:lbuffer uint8 32ul
-> n:lbuffer uint8 12ul
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen
-> mlen:size_t
-> m:lbuffer uint8 mlen
-> out:lbuffer uint8 16ul ->
Stack unit
(requires fun h ->
live h k /\ live h n /\ live h aad /\ live h m /\ live h out)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
(let key:LSeq.lseq uint8 64 = Spec.Chacha20.chacha20_encrypt_bytes (as_seq h0 k) (as_seq h0 n) 0 (LSeq.create 64 (u8 0)) in
as_seq h1 out == Spec.poly1305_do (LSeq.sub key 0 32) (as_seq h0 m) (as_seq h0 aad))) | let derive_key_poly1305_do #w k n aadlen aad mlen m out =
push_frame ();
// Create a new buffer to derive the key
let tmp = create 64ul (u8 0) in
chacha20_encrypt #w 64ul tmp tmp k n 0ul;
// The derived key should only be the first 32 bytes
let key = sub tmp 0ul 32ul in
poly1305_do #w key aadlen aad mlen m out;
pop_frame() | {
"file_name": "code/chacha20poly1305/Hacl.Impl.Chacha20Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 13,
"end_line": 142,
"start_col": 0,
"start_line": 134
} | module Hacl.Impl.Chacha20Poly1305
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Hacl.Impl.Chacha20Poly1305.PolyCore
open Hacl.Impl.Poly1305.Fields
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module Spec = Spec.Chacha20Poly1305
module SpecPoly = Spec.Poly1305
module Poly = Hacl.Impl.Poly1305
#reset-options "--z3rlimit 150 --max_fuel 0 --max_ifuel 1 --record_options"
val poly1305_do_:
#w:field_spec
-> k:lbuffer uint8 32ul // key
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen // authenticated additional data
-> mlen:size_t
-> m:lbuffer uint8 mlen // plaintext
-> ctx:Poly.poly1305_ctx w
-> block:lbuffer uint8 16ul ->
Stack unit
(requires fun h ->
live h k /\ live h aad /\ live h m /\ live h ctx /\ live h block /\
disjoint ctx k /\ disjoint ctx aad /\ disjoint ctx m /\ disjoint ctx block /\
disjoint block k /\ disjoint block aad /\ disjoint block m)
(ensures fun h0 _ h1 ->
modifies (loc ctx |+| loc block) h0 h1 /\
(let acc, r = SpecPoly.poly1305_init (as_seq h0 k) in
let acc = if (length aad <> 0) then Spec.poly1305_padded r (as_seq h0 aad) acc else acc in
let acc = if (length m <> 0) then Spec.poly1305_padded r (as_seq h0 m) acc else acc in
let block_s = LSeq.concat (BSeq.uint_to_bytes_le #U64 (u64 (length aad)))
(BSeq.uint_to_bytes_le #U64 (u64 (length m))) in
let acc = SpecPoly.poly1305_update1 r 16 block_s acc in
Poly.as_get_acc h1 ctx == acc /\ as_seq h1 block == block_s /\
Poly.state_inv_t h1 ctx))
[@Meta.Attribute.inline_]
let poly1305_do_ #w k aadlen aad mlen m ctx block =
Poly.poly1305_init ctx k;
if (aadlen <> 0ul) then (
poly1305_padded ctx aadlen aad)
else ();
if (mlen <> 0ul) then (
poly1305_padded ctx mlen m)
else ();
let h0 = ST.get () in
update_sub_f h0 block 0ul 8ul
(fun h -> BSeq.uint_to_bytes_le #U64 (to_u64 aadlen))
(fun _ -> uint_to_bytes_le (sub block 0ul 8ul) (to_u64 aadlen));
let h1 = ST.get () in
//assert (LSeq.sub (as_seq h1 block) 0 8 == BSeq.uint_to_bytes_le #U64 (to_u64 aadlen));
Poly.reveal_ctx_inv ctx h0 h1;
update_sub_f h1 block 8ul 8ul
(fun h -> BSeq.uint_to_bytes_le #U64 (to_u64 mlen))
(fun _ -> uint_to_bytes_le (sub block 8ul 8ul) (to_u64 mlen));
let h2 = ST.get () in
//assert (LSeq.sub (as_seq h2 block) 8 8 == BSeq.uint_to_bytes_le #U64 (to_u64 mlen));
LSeq.eq_intro (LSeq.sub (as_seq h2 block) 0 8) (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen));
LSeq.lemma_concat2 8 (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen)) 8 (BSeq.uint_to_bytes_le #U64 (to_u64 mlen)) (as_seq h2 block);
//assert (as_seq h2 block == LSeq.concat (BSeq.uint_to_bytes_le #U64 (to_u64 aadlen)) (BSeq.uint_to_bytes_le #U64 (to_u64 mlen)));
Poly.reveal_ctx_inv ctx h1 h2;
Poly.poly1305_update1 ctx block
// Implements the actual poly1305_do operation
inline_for_extraction noextract
let poly1305_do_core_st (w:field_spec) =
k:lbuffer uint8 32ul // key
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen // authenticated additional data
-> mlen:size_t
-> m:lbuffer uint8 mlen // plaintext
-> out:lbuffer uint8 16ul -> // output: tag
Stack unit
(requires fun h ->
live h k /\ live h aad /\ live h m /\ live h out /\
disjoint k out)
(ensures fun h0 _ h1 ->
modifies (loc out) h0 h1 /\
as_seq h1 out == Spec.poly1305_do (as_seq h0 k) (as_seq h0 m) (as_seq h0 aad))
noextract
val poly1305_do: #w:field_spec -> poly1305_do_core_st w
[@Meta.Attribute.specialize]
let poly1305_do #w k aadlen aad mlen m out =
push_frame();
let ctx = create (nlimb w +! precomplen w) (limb_zero w) in
let block = create 16ul (u8 0) in
poly1305_do_ #w k aadlen aad mlen m ctx block;
Poly.poly1305_finish out k ctx;
pop_frame()
unfold noextract
let width_chacha20 (s:field_spec) : Hacl.Spec.Chacha20.Vec.lanes =
match s with
| M32 -> 1
| M128 -> 4
| M256 -> 8
[@ Meta.Attribute.specialize ]
assume val chacha20_encrypt: #w:field_spec ->
Hacl.Impl.Chacha20.Vec.chacha20_encrypt_st (width_chacha20 w)
// Derives the key, and then perform poly1305
val derive_key_poly1305_do:
#w:field_spec
-> k:lbuffer uint8 32ul
-> n:lbuffer uint8 12ul
-> aadlen:size_t
-> aad:lbuffer uint8 aadlen
-> mlen:size_t
-> m:lbuffer uint8 mlen
-> out:lbuffer uint8 16ul ->
Stack unit
(requires fun h ->
live h k /\ live h n /\ live h aad /\ live h m /\ live h out)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
(let key:LSeq.lseq uint8 64 = Spec.Chacha20.chacha20_encrypt_bytes (as_seq h0 k) (as_seq h0 n) 0 (LSeq.create 64 (u8 0)) in
as_seq h1 out == Spec.poly1305_do (LSeq.sub key 0 32) (as_seq h0 m) (as_seq h0 aad))) | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"Spec.Chacha20Poly1305.fst.checked",
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"Hacl.Impl.Chacha20Poly1305.PolyCore.fst.checked",
"Hacl.Impl.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20Poly1305.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "Poly"
},
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "SpecPoly"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20Poly1305",
"short_module": "Spec"
},
{
"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": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20Poly1305.PolyCore",
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 150,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
k: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul ->
n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 12ul ->
aadlen: Lib.IntTypes.size_t ->
aad: Lib.Buffer.lbuffer Lib.IntTypes.uint8 aadlen ->
mlen: Lib.IntTypes.size_t ->
m: Lib.Buffer.lbuffer Lib.IntTypes.uint8 mlen ->
out: Lib.Buffer.lbuffer Lib.IntTypes.uint8 16ul
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.Poly1305.Fields.field_spec",
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint8",
"FStar.UInt32.__uint_to_t",
"Lib.IntTypes.size_t",
"FStar.HyperStack.ST.pop_frame",
"Prims.unit",
"Hacl.Impl.Chacha20Poly1305.poly1305_do",
"Lib.Buffer.lbuffer_t",
"Lib.Buffer.MUT",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"FStar.UInt32.uint_to_t",
"FStar.UInt32.t",
"Lib.Buffer.sub",
"Hacl.Impl.Chacha20Poly1305.chacha20_encrypt",
"Lib.Buffer.create",
"Lib.IntTypes.u8",
"FStar.HyperStack.ST.push_frame"
] | [] | false | true | false | false | false | let derive_key_poly1305_do #w k n aadlen aad mlen m out =
| push_frame ();
let tmp = create 64ul (u8 0) in
chacha20_encrypt #w 64ul tmp tmp k n 0ul;
let key = sub tmp 0ul 32ul in
poly1305_do #w key aadlen aad mlen m out;
pop_frame () | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.print_footer | val print_footer : printer -> FStar.All.ML unit | val print_footer : printer -> FStar.All.ML unit | let print_footer = P.print_footer | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 33,
"end_line": 99,
"start_col": 0,
"start_line": 99
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = ()
let va_compute_merge_total = Lemmas.compute_merge_total
let va_lemma_merge_total b0 s0 f0 sM fM sN = Lemmas.lemma_merge_total b0 s0 f0 sM fM sN; Lemmas.compute_merge_total f0 fM
let va_lemma_empty_total = Lemmas.lemma_empty_total
let va_lemma_ifElse_total = Lemmas.lemma_ifElse_total
let va_lemma_ifElseTrue_total = Lemmas.lemma_ifElseTrue_total
let va_lemma_ifElseFalse_total = Lemmas.lemma_ifElseFalse_total
let va_lemma_while_total = Lemmas.lemma_while_total
let va_lemma_whileTrue_total = Lemmas.lemma_whileTrue_total
let va_lemma_whileFalse_total = Lemmas.lemma_whileFalse_total
let va_lemma_whileMerge_total = Lemmas.lemma_whileMerge_total
let printer = P.printer
let print_string = FStar.IO.print_string
let print_header = P.print_header | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | _: Vale.PPC64LE.Decls.printer -> FStar.All.ML Prims.unit | FStar.All.ML | [
"ml"
] | [] | [
"Vale.PPC64LE.Print_s.print_footer"
] | [] | false | true | false | false | false | let print_footer =
| P.print_footer | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.gcc | val gcc : printer | val gcc : printer | let gcc = P.gcc | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 15,
"end_line": 100,
"start_col": 0,
"start_line": 100
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = ()
let va_compute_merge_total = Lemmas.compute_merge_total
let va_lemma_merge_total b0 s0 f0 sM fM sN = Lemmas.lemma_merge_total b0 s0 f0 sM fM sN; Lemmas.compute_merge_total f0 fM
let va_lemma_empty_total = Lemmas.lemma_empty_total
let va_lemma_ifElse_total = Lemmas.lemma_ifElse_total
let va_lemma_ifElseTrue_total = Lemmas.lemma_ifElseTrue_total
let va_lemma_ifElseFalse_total = Lemmas.lemma_ifElseFalse_total
let va_lemma_while_total = Lemmas.lemma_while_total
let va_lemma_whileTrue_total = Lemmas.lemma_whileTrue_total
let va_lemma_whileFalse_total = Lemmas.lemma_whileFalse_total
let va_lemma_whileMerge_total = Lemmas.lemma_whileMerge_total
let printer = P.printer
let print_string = FStar.IO.print_string
let print_header = P.print_header
let print_proc = P.print_proc | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | Vale.PPC64LE.Decls.printer | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Print_s.gcc"
] | [] | false | false | false | true | false | let gcc =
| P.gcc | false |
MerkleTree.New.High.Correct.Path.fst | MerkleTree.New.High.Correct.Path.mt_verify_ok_ | val mt_verify_ok_:
#hsz:pos -> #f:MTS.hash_fun_t ->
k:nat ->
j:nat{k <= j} ->
p:path ->
ppos:nat ->
acc:hash #hsz ->
actd:bool ->
Lemma (requires (ppos + mt_path_length k j actd <= S.length p))
(ensures (MTS.HRaw (mt_verify_ #_ #f k j p ppos acc actd) ==
MTS.mt_verify_ #_ #f #(log2c j)
(path_spec k j actd
(S.slice p ppos (ppos + mt_path_length k j actd)))
k (MTS.HRaw acc)))
(decreases j) | val mt_verify_ok_:
#hsz:pos -> #f:MTS.hash_fun_t ->
k:nat ->
j:nat{k <= j} ->
p:path ->
ppos:nat ->
acc:hash #hsz ->
actd:bool ->
Lemma (requires (ppos + mt_path_length k j actd <= S.length p))
(ensures (MTS.HRaw (mt_verify_ #_ #f k j p ppos acc actd) ==
MTS.mt_verify_ #_ #f #(log2c j)
(path_spec k j actd
(S.slice p ppos (ppos + mt_path_length k j actd)))
k (MTS.HRaw acc)))
(decreases j) | let rec mt_verify_ok_ #hsz #f k j p ppos acc actd =
if j = 0 then ()
else begin
log2c_div j;
let vi = mt_verify_ #_ #f k j p ppos acc actd in
let plen = mt_path_length k j actd in
let vs = MTS.mt_verify_ #_ #f #(log2c j)
(path_spec k j actd (S.slice p ppos (ppos + plen)))
k (MTS.HRaw acc) in
let nactd = actd || (j % 2 = 1) in
let nplen = mt_path_length (k / 2) (j / 2) nactd in
if k % 2 = 0
then begin
if j = k || (j = k + 1 && not actd)
then begin
assert (vi == mt_verify_ #_ #f (k / 2) (j / 2) p ppos acc nactd);
assert (plen == nplen);
assert (S.equal (path_spec k j actd (S.slice p ppos (ppos + plen)))
(S.cons MTS.HPad
(path_spec (k / 2) (j / 2) nactd
(S.slice p ppos (ppos + plen)))));
assert (vs ==
MTS.mt_verify_ #_ #f #(log2c (j / 2))
(path_spec (k / 2) (j / 2) nactd (S.slice p ppos (ppos + plen)))
(k / 2) (MTS.HRaw acc));
mt_verify_ok_ #_ #f (k / 2) (j / 2) p ppos acc nactd
end
else begin
let nacc = f acc (S.index p ppos) in
assert (vi == mt_verify_ #_ #f (k / 2) (j / 2) p (ppos + 1) nacc nactd);
assert (plen == nplen + 1);
assert (S.equal (S.tail (S.slice p ppos (ppos + plen)))
(S.slice p (ppos + 1) (ppos + 1 + nplen)));
assert (S.equal (path_spec k j actd (S.slice p ppos (ppos + plen)))
(S.cons (MTS.HRaw (S.index p ppos))
(path_spec (k / 2) (j / 2) nactd
(S.slice p (ppos + 1) (ppos + 1 + nplen)))));
assert (vs ==
MTS.mt_verify_ #_ #f #(log2c (j / 2))
(path_spec (k / 2) (j / 2) nactd
(S.slice p (ppos + 1) (ppos + 1 + nplen)))
(k / 2) (MTS.HRaw nacc));
mt_verify_ok_ #_ #f (k / 2) (j / 2) p (ppos + 1) nacc nactd
end
end
else begin
let nacc = f (S.index p ppos) acc in
assert (vi == mt_verify_ #_ #f (k / 2) (j / 2) p (ppos + 1) nacc nactd);
assert (plen == 1 + nplen);
assert (S.equal (S.tail (S.slice p ppos (ppos + plen)))
(S.slice p (ppos + 1) (ppos + 1 + nplen)));
assert (S.equal (path_spec k j actd (S.slice p ppos (ppos + plen)))
(S.cons (MTS.HRaw (S.index p ppos))
(path_spec (k / 2) (j / 2) nactd
(S.slice p (ppos + 1) (ppos + 1 + nplen)))));
assert (vs ==
MTS.mt_verify_ #_ #f #(log2c (j / 2))
(path_spec (k / 2) (j / 2) nactd
(S.slice p (ppos + 1) (ppos + 1 + nplen)))
(k / 2) (MTS.HRaw nacc));
mt_verify_ok_ #_ #f (k / 2) (j / 2) p (ppos + 1) nacc nactd
end
end | {
"file_name": "src/MerkleTree.New.High.Correct.Path.fst",
"git_rev": "7d7bdc20f2033171e279c176b26e84f9069d23c6",
"git_url": "https://github.com/hacl-star/merkle-tree.git",
"project_name": "merkle-tree"
} | {
"end_col": 5,
"end_line": 392,
"start_col": 0,
"start_line": 329
} | module MerkleTree.New.High.Correct.Path
open EverCrypt
open EverCrypt.Helpers
open MerkleTree.New.High.Correct.Base
// Need to use some facts of `mt_get_root`
open MerkleTree.New.High.Correct.Rhs
open FStar.Classical
open FStar.Ghost
open FStar.Seq
module List = FStar.List.Tot
module S = FStar.Seq
module U32 = FStar.UInt32
module U8 = FStar.UInt8
type uint32_t = U32.t
type uint8_t = U8.t
module EHS = EverCrypt.Hash
module MTS = MerkleTree.Spec
open MerkleTree.New.High
#reset-options "--z3rlimit 20"
/// Correctness of path generation
val path_spec:
#hsz:pos ->
k:nat ->
j:nat{k <= j} ->
actd:bool ->
p:path #hsz {S.length p = mt_path_length k j actd} ->
GTot (sp:S.seq (MTS.padded_hash #hsz){S.length sp = log2c j})
(decreases j)
let rec path_spec #hsz k j actd p =
if j = 0 then S.empty
else (if k % 2 = 0
then (if j = k || (j = k + 1 && not actd)
then S.cons MTS.HPad (path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) p)
else S.cons (MTS.HRaw #hsz (S.head p))
(path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) (S.tail p)))
else S.cons (MTS.HRaw #hsz (S.head p))
(path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) (S.tail p)))
val mt_get_path_step_acc:
#hsz:pos ->
j:nat{j > 0} ->
chs:hashes #hsz {S.length chs = j} ->
crh:hash #hsz ->
k:nat{k <= j} ->
actd:bool ->
GTot (option (hash #hsz))
let mt_get_path_step_acc #hsz j chs crh k actd =
if k % 2 = 1
then Some (S.index chs (k - 1))
else (if k = j then None
else if k + 1 = j
then (if actd then Some crh else None)
else Some (S.index chs (k + 1)))
val mt_get_path_acc:
#hsz:pos -> #f:MTS.hash_fun_t #hsz ->
j:nat ->
fhs:hashess #hsz {S.length fhs = log2c j /\ mt_hashes_lth_inv_log #hsz j fhs} ->
rhs:hashes #hsz {S.length rhs = log2c j} ->
k:nat{k <= j} ->
actd:bool ->
GTot (np:path #hsz {S.length np = mt_path_length k j actd})
(decreases j)
let rec mt_get_path_acc #_ #f j fhs rhs k actd =
if j = 0 then S.empty
else
(let sp = mt_get_path_step_acc #_ j (S.head fhs) (S.head rhs) k actd in
let rp = mt_get_path_acc #_ #f (j / 2) (S.tail fhs) (S.tail rhs) (k / 2)
(actd || j % 2 = 1) in
if Some? sp
then (S.cons (Some?.v sp) rp)
else rp)
val mt_get_path_step_acc_consistent:
#hsz:pos -> #f:MTS.hash_fun_t ->
lv:nat{lv <= 32} ->
i:nat ->
j:nat{i <= j /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv i olds} ->
hs:hashess #hsz {S.length hs = 32 /\ hs_wf_elts lv hs i j} ->
rhs:hashes #hsz {S.length rhs = 32} ->
k:nat{i <= k && k <= j} ->
actd:bool ->
Lemma (requires (j <> 0))
(ensures
(log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
mt_hashes_lth_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
(match mt_get_path_step_acc j
(S.index (merge_hs #_ #f olds hs) lv) (S.index rhs lv)
k actd with
| Some v ->
S.equal (mt_make_path_step lv hs rhs i j k S.empty actd)
(S.cons v S.empty)
| None ->
S.equal (mt_make_path_step lv hs rhs i j k S.empty actd)
S.empty)))
let mt_get_path_step_acc_consistent #_ #_ lv i j olds hs rhs k actd = ()
private val seq_cons_append:
#a:Type -> hd:a -> tl:S.seq a ->
Lemma (S.equal (S.append (S.cons hd S.empty) tl)
(S.cons hd tl))
private let seq_cons_append #a hd tl = ()
val mt_get_path_acc_consistent:
#hsz:pos -> #f:MTS.hash_fun_t ->
lv:nat{lv <= 32} ->
i:nat ->
j:nat{i <= j /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv i olds} ->
hs:hashess #hsz {S.length hs = 32 /\ hs_wf_elts lv hs i j} ->
rhs:hashes #hsz {S.length rhs = 32} ->
k:nat{i <= k && k <= j} ->
actd:bool ->
Lemma (requires True)
(ensures
(log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
mt_hashes_lth_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
S.equal (mt_get_path_acc #_ #f j
(S.slice (merge_hs #_ #f olds hs) lv (lv + log2c j))
(S.slice rhs lv (lv + log2c j)) k actd)
(mt_get_path_ #_ lv hs rhs i j k S.empty actd)))
(decreases j)
#push-options "--z3rlimit 1000 --max_fuel 1 --max_ifuel 0"
let rec mt_get_path_acc_consistent #hsz #f lv i j olds hs rhs k actd =
log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
mt_hashes_lth_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
if j = 0 then ()
else begin
let nactd = if j % 2 = 0 then actd else true in
let nactd_ = actd || j % 2 = 1 in
assert (nactd == nactd_);
let pa = mt_get_path_acc #_ #f j
(S.slice (merge_hs #_ #f olds hs) lv (lv + log2c j))
(S.slice rhs lv (lv + log2c j)) k actd in
let p = mt_get_path_ lv hs rhs i j k S.empty actd in
log2c_div j; log2c_bound (j / 2) (32 - (lv + 1));
assert (mt_hashes_lth_inv (lv + 1) (j / 2) (merge_hs #_ #f olds hs));
assert (mt_hashes_lth_inv_log #hsz (j / 2)
(S.slice (merge_hs #_ #f olds hs) (lv + 1) (lv + 1 + log2c (j / 2))));
let npsa = mt_get_path_step_acc j
(S.index (merge_hs #_ #f olds hs) lv) (S.index rhs lv) k actd in
let npa = mt_get_path_acc #_ #f (j / 2)
(S.slice (merge_hs #_ #f olds hs) (lv + 1) (lv + 1 + log2c (j / 2)))
(S.slice rhs (lv + 1) (lv + 1 + log2c (j / 2))) (k / 2) nactd_ in
let nps = mt_make_path_step lv hs rhs i j k S.empty actd in
let np = mt_get_path_ (lv + 1) hs rhs (i / 2) (j / 2) (k / 2) nps nactd in
let npe = mt_get_path_ (lv + 1) hs rhs (i / 2) (j / 2) (k / 2) S.empty nactd in
mt_get_path_pull (lv + 1) hs rhs (i / 2) (j / 2) (k / 2) nps nactd;
assert (S.equal p np);
assert (S.equal np (S.append nps npe));
assert (S.equal p (S.append nps npe));
assert (S.equal pa (if Some? npsa
then S.cons (Some?.v npsa) npa
else npa));
mt_get_path_acc_consistent #_ #f (lv + 1) (i / 2) (j / 2)
olds hs rhs (k / 2) nactd;
assert (S.equal npa npe);
mt_get_path_step_acc_consistent #_ #f lv i j olds hs rhs k actd;
if Some? npsa
then begin
assert (S.equal nps (S.cons (Some?.v npsa) S.empty));
assert (S.equal p (S.append (S.cons (Some?.v npsa) S.empty) npa));
assert (S.equal pa (S.cons (Some?.v npsa) npa));
seq_cons_append (Some?.v npsa) npa;
assert (S.equal pa p)
end
else begin
assert (S.equal nps S.empty);
S.append_empty_l npe;
assert (S.equal p npe);
assert (S.equal pa npa);
assert (S.equal pa p)
end
end
#pop-options
val mt_get_path_acc_inv_ok:
#hsz:pos -> #f:MTS.hash_fun_t ->
j:nat ->
fhs:hashess #hsz {S.length fhs = log2c j} ->
rhs:hashes #hsz {S.length rhs = log2c j} ->
k:nat{k <= j} ->
acc:hash -> actd:bool ->
Lemma (requires (j > 0 /\
mt_hashes_lth_inv_log #hsz j fhs /\
mt_hashes_inv_log #_ #f j fhs /\
mt_rhs_inv #_ #f j (hash_seq_spec_full #_ #f (S.head fhs) acc actd) rhs actd))
(ensures (S.equal (path_spec k j actd (mt_get_path_acc #_ #f j fhs rhs k actd))
(MTS.mt_get_path #_ #f #(log2c j)
(hash_seq_spec_full #_ #f (S.head fhs) acc actd) k)))
(decreases j)
#push-options "--z3rlimit 120 --max_fuel 1"
let rec mt_get_path_acc_inv_ok #_ #f j fhs rhs k acc actd =
// Below dummy `let` is necessary to provide guidance to the SMT solver.
let _ = mt_get_path_step_acc j (S.head fhs) (S.head rhs) k actd in
let smt = hash_seq_spec_full #_ #f (S.head fhs) acc actd in
let nacc = (if j % 2 = 0 then acc
else if actd
then f (S.last (S.head fhs)) acc
else S.last (S.head fhs)) in
let nactd = actd || j % 2 = 1 in
if j = 1 then (if k = 0 then () else ())
else begin
mt_hashes_lth_inv_log_next #_ #f j fhs;
hash_seq_spec_full_next #_ #f j (S.head fhs) (S.head (S.tail fhs)) acc actd nacc nactd;
mt_get_path_acc_inv_ok #_ #f (j / 2) (S.tail fhs) (S.tail rhs) (k / 2) nacc nactd;
if k % 2 = 0
then begin
if k = j || (k + 1 = j && not actd)
then assert (S.index smt (k + 1) == MTS.HPad)
else if k + 1 = j
then assert (S.index smt (k + 1) == MTS.HRaw (S.head rhs))
else hash_seq_spec_full_index_raw #_ #f (S.head fhs) acc actd (k + 1)
end
else begin
hash_seq_spec_full_index_raw #_ #f (S.head fhs) acc actd (k - 1)
end
end
#pop-options
#push-options "--max_fuel 1 --initial_fuel 1 --max_ifuel 0 --z3rlimit 60"
val mt_get_path_inv_ok_:
#hsz:pos -> #f:MTS.hash_fun_t ->
lv:nat{lv < 32} ->
i:nat ->
j:nat{j > 0 /\ i <= j /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv i olds} ->
hs:hashess #hsz {S.length hs = 32 /\ hs_wf_elts lv hs i j} ->
rhs:hashes #hsz {S.length rhs = 32} ->
k:nat{i <= k && k <= j} ->
p:path #hsz ->
acc:hash -> actd:bool ->
Lemma (requires (log2c_div j; log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
(mt_hashes_inv #_ #f lv j (merge_hs #_ #f olds hs) /\
(let t1 = hash_seq_spec_full #_ #f (S.index (merge_hs #_ #f olds hs) lv) acc actd in
let t2 = S.slice rhs lv (lv + log2c j) in
mt_rhs_inv #_ #f j t1 t2 actd))))
(ensures (S.equal (path_spec k j actd
(S.slice (mt_get_path_ lv hs rhs i j k p actd)
(S.length p) (S.length p + mt_path_length k j actd)))
(MTS.mt_get_path #_ #f #(log2c j)
(hash_seq_spec_full #_ #f
(S.index (merge_hs #_ #f olds hs) lv) acc actd) k)))
let mt_get_path_inv_ok_ #_ #f lv i j olds hs rhs k p acc actd =
log2c_div j; log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
mt_hashes_lth_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
mt_hashes_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
mt_get_path_acc_consistent #_ #f lv i j olds hs rhs k actd;
mt_get_path_slice lv hs rhs i j k p actd;
mt_get_path_acc_inv_ok #_ #f j
(S.slice (merge_hs #_ #f olds hs) lv (lv + log2c j))
(S.slice rhs lv (lv + log2c j))
k acc actd
#pop-options
val mt_get_path_inv_ok:
#hsz:pos ->
mt:merkle_tree #hsz {mt_wf_elts mt} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz 0 (MT?.i mt) olds} ->
idx:nat{MT?.i mt <= idx && idx < MT?.j mt} ->
drt:hash ->
Lemma (requires (MT?.j mt > 0 /\ mt_inv mt olds))
(ensures (let j, p, rt = mt_get_path mt idx drt in
j == MT?.j mt /\
mt_root_inv #_ #(MT?.hash_fun mt) (mt_base mt olds) hash_init false rt /\
S.head p == S.index (mt_base mt olds) idx /\
(assert (S.length (S.tail p) == mt_path_length idx (MT?.j mt) false);
S.equal (path_spec idx (MT?.j mt) false (S.tail p))
(MTS.mt_get_path #_ #(MT?.hash_fun mt) #(log2c j) (mt_spec mt olds) idx))))
#push-options "--z3rlimit 40"
let mt_get_path_inv_ok #hsz mt olds idx drt =
let j, p, rt = mt_get_path mt idx drt in
mt_get_root_inv_ok mt drt olds;
assert (j == MT?.j mt);
assert (mt_root_inv #_ #(MT?.hash_fun mt) (mt_base mt olds) hash_init false rt);
let ofs = offset_of (MT?.i mt) in
let umt, _ = mt_get_root mt drt in
let ip = path_insert S.empty (S.index (mt_base mt olds) idx) in
mt_get_path_unchanged 0 (MT?.hs umt) (MT?.rhs umt)
(MT?.i umt) (MT?.j umt) idx ip false;
assert (S.head ip == S.head (S.slice p 0 (S.length ip)));
assert (S.head ip == S.head p);
assert (S.head p == S.index (mt_base mt olds) idx);
assert (S.length (S.tail p) == mt_path_length idx (MT?.j mt) false);
mt_get_path_inv_ok_ #_ #(MT?.hash_fun mt) 0 (MT?.i umt) (MT?.j umt)
olds (MT?.hs umt) (MT?.rhs umt) idx ip hash_init false
#pop-options
val mt_verify_ok_:
#hsz:pos -> #f:MTS.hash_fun_t ->
k:nat ->
j:nat{k <= j} ->
p:path ->
ppos:nat ->
acc:hash #hsz ->
actd:bool ->
Lemma (requires (ppos + mt_path_length k j actd <= S.length p))
(ensures (MTS.HRaw (mt_verify_ #_ #f k j p ppos acc actd) ==
MTS.mt_verify_ #_ #f #(log2c j)
(path_spec k j actd
(S.slice p ppos (ppos + mt_path_length k j actd)))
k (MTS.HRaw acc)))
(decreases j) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"MerkleTree.Spec.fst.checked",
"MerkleTree.New.High.Correct.Rhs.fst.checked",
"MerkleTree.New.High.Correct.Base.fst.checked",
"MerkleTree.New.High.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"EverCrypt.Helpers.fsti.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": false,
"source_file": "MerkleTree.New.High.Correct.Path.fst"
} | [
{
"abbrev": false,
"full_module": "MerkleTree.New.High",
"short_module": null
},
{
"abbrev": true,
"full_module": "MerkleTree.Spec",
"short_module": "MTS"
},
{
"abbrev": true,
"full_module": "EverCrypt.Hash",
"short_module": "EHS"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "List"
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Classical",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct.Rhs",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt.Helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 1,
"max_ifuel": 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": 40,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
k: Prims.nat ->
j: Prims.nat{k <= j} ->
p: MerkleTree.New.High.path ->
ppos: Prims.nat ->
acc: MerkleTree.New.High.hash ->
actd: Prims.bool
-> FStar.Pervasives.Lemma
(requires ppos + MerkleTree.New.High.mt_path_length k j actd <= FStar.Seq.Base.length p)
(ensures
MerkleTree.Spec.HRaw (MerkleTree.New.High.mt_verify_ k j p ppos acc actd) ==
MerkleTree.Spec.mt_verify_ (MerkleTree.New.High.Correct.Path.path_spec k
j
actd
(FStar.Seq.Base.slice p ppos (ppos + MerkleTree.New.High.mt_path_length k j actd)))
k
(MerkleTree.Spec.HRaw acc))
(decreases j) | FStar.Pervasives.Lemma | [
"lemma",
""
] | [] | [
"Prims.pos",
"MerkleTree.Spec.hash_fun_t",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"MerkleTree.New.High.path",
"MerkleTree.New.High.hash",
"Prims.bool",
"Prims.op_Equality",
"Prims.int",
"Prims.op_Modulus",
"Prims.op_BarBar",
"Prims.op_AmpAmp",
"Prims.op_Addition",
"Prims.op_Negation",
"MerkleTree.New.High.Correct.Path.mt_verify_ok_",
"Prims.op_Division",
"Prims.unit",
"Prims._assert",
"Prims.eq2",
"MerkleTree.Spec.padded_hash",
"MerkleTree.Spec.mt_verify_",
"MerkleTree.New.High.Correct.Base.log2c",
"MerkleTree.New.High.Correct.Path.path_spec",
"FStar.Seq.Base.slice",
"MerkleTree.Spec.HRaw",
"FStar.Seq.Base.equal",
"FStar.Seq.Base.cons",
"MerkleTree.Spec.HPad",
"MerkleTree.New.High.mt_verify_",
"FStar.Seq.Base.index",
"FStar.Seq.Properties.tail",
"MerkleTree.Spec.hash",
"MerkleTree.New.High.mt_path_length",
"MerkleTree.New.High.Correct.Base.log2c_div"
] | [
"recursion"
] | false | false | true | false | false | let rec mt_verify_ok_ #hsz #f k j p ppos acc actd =
| if j = 0
then ()
else
(log2c_div j;
let vi = mt_verify_ #_ #f k j p ppos acc actd in
let plen = mt_path_length k j actd in
let vs =
MTS.mt_verify_ #_
#f
#(log2c j)
(path_spec k j actd (S.slice p ppos (ppos + plen)))
k
(MTS.HRaw acc)
in
let nactd = actd || (j % 2 = 1) in
let nplen = mt_path_length (k / 2) (j / 2) nactd in
if k % 2 = 0
then
if j = k || (j = k + 1 && not actd)
then
(assert (vi == mt_verify_ #_ #f (k / 2) (j / 2) p ppos acc nactd);
assert (plen == nplen);
assert (S.equal (path_spec k j actd (S.slice p ppos (ppos + plen)))
(S.cons MTS.HPad (path_spec (k / 2) (j / 2) nactd (S.slice p ppos (ppos + plen)))));
assert (vs ==
MTS.mt_verify_ #_
#f
#(log2c (j / 2))
(path_spec (k / 2) (j / 2) nactd (S.slice p ppos (ppos + plen)))
(k / 2)
(MTS.HRaw acc));
mt_verify_ok_ #_ #f (k / 2) (j / 2) p ppos acc nactd)
else
let nacc = f acc (S.index p ppos) in
assert (vi == mt_verify_ #_ #f (k / 2) (j / 2) p (ppos + 1) nacc nactd);
assert (plen == nplen + 1);
assert (S.equal (S.tail (S.slice p ppos (ppos + plen)))
(S.slice p (ppos + 1) (ppos + 1 + nplen)));
assert (S.equal (path_spec k j actd (S.slice p ppos (ppos + plen)))
(S.cons (MTS.HRaw (S.index p ppos))
(path_spec (k / 2) (j / 2) nactd (S.slice p (ppos + 1) (ppos + 1 + nplen)))));
assert (vs ==
MTS.mt_verify_ #_
#f
#(log2c (j / 2))
(path_spec (k / 2) (j / 2) nactd (S.slice p (ppos + 1) (ppos + 1 + nplen)))
(k / 2)
(MTS.HRaw nacc));
mt_verify_ok_ #_ #f (k / 2) (j / 2) p (ppos + 1) nacc nactd
else
let nacc = f (S.index p ppos) acc in
assert (vi == mt_verify_ #_ #f (k / 2) (j / 2) p (ppos + 1) nacc nactd);
assert (plen == 1 + nplen);
assert (S.equal (S.tail (S.slice p ppos (ppos + plen)))
(S.slice p (ppos + 1) (ppos + 1 + nplen)));
assert (S.equal (path_spec k j actd (S.slice p ppos (ppos + plen)))
(S.cons (MTS.HRaw (S.index p ppos))
(path_spec (k / 2) (j / 2) nactd (S.slice p (ppos + 1) (ppos + 1 + nplen)))));
assert (vs ==
MTS.mt_verify_ #_
#f
#(log2c (j / 2))
(path_spec (k / 2) (j / 2) nactd (S.slice p (ppos + 1) (ppos + 1 + nplen)))
(k / 2)
(MTS.HRaw nacc));
mt_verify_ok_ #_ #f (k / 2) (j / 2) p (ppos + 1) nacc nactd) | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_lemma_merge_total | val va_lemma_merge_total (b0:va_codes) (s0:va_state) (f0:va_fuel) (sM:va_state) (fM:va_fuel) (sN:va_state) : Ghost va_fuel
(requires
Cons? b0 /\
eval_code (Cons?.hd b0) s0 f0 sM /\
eval_code (va_Block (Cons?.tl b0)) sM fM sN
)
(ensures (fun fN ->
fN == va_compute_merge_total f0 fM /\
eval_code (va_Block b0) s0 fN sN
)) | val va_lemma_merge_total (b0:va_codes) (s0:va_state) (f0:va_fuel) (sM:va_state) (fM:va_fuel) (sN:va_state) : Ghost va_fuel
(requires
Cons? b0 /\
eval_code (Cons?.hd b0) s0 f0 sM /\
eval_code (va_Block (Cons?.tl b0)) sM fM sN
)
(ensures (fun fN ->
fN == va_compute_merge_total f0 fM /\
eval_code (va_Block b0) s0 fN sN
)) | let va_lemma_merge_total b0 s0 f0 sM fM sN = Lemmas.lemma_merge_total b0 s0 f0 sM fM sN; Lemmas.compute_merge_total f0 fM | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 121,
"end_line": 85,
"start_col": 0,
"start_line": 85
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = () | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false |
b0: Vale.PPC64LE.Decls.va_codes ->
s0: Vale.PPC64LE.Decls.va_state ->
f0: Vale.PPC64LE.Decls.va_fuel ->
sM: Vale.PPC64LE.Decls.va_state ->
fM: Vale.PPC64LE.Decls.va_fuel ->
sN: Vale.PPC64LE.Decls.va_state
-> Prims.Ghost Vale.PPC64LE.Decls.va_fuel | Prims.Ghost | [] | [] | [
"Vale.PPC64LE.Decls.va_codes",
"Vale.PPC64LE.Decls.va_state",
"Vale.PPC64LE.Decls.va_fuel",
"Vale.PPC64LE.Lemmas.compute_merge_total",
"Prims.unit",
"Vale.PPC64LE.Lemmas.lemma_merge_total"
] | [] | false | false | false | false | false | let va_lemma_merge_total b0 s0 f0 sM fM sN =
| Lemmas.lemma_merge_total b0 s0 f0 sM fM sN;
Lemmas.compute_merge_total f0 fM | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_lemma_ifElse_total | val va_lemma_ifElse_total (ifb:ocmp) (ct:va_code) (cf:va_code) (s0:va_state) : Ghost (bool & va_state & va_state & va_fuel)
(requires True)
(ensures (fun (cond, sM, sN, f0) ->
cond == eval_ocmp s0 ifb /\
sM == ({s0 with cr0 = eval_cmp_cr0 s0 ifb})
)) | val va_lemma_ifElse_total (ifb:ocmp) (ct:va_code) (cf:va_code) (s0:va_state) : Ghost (bool & va_state & va_state & va_fuel)
(requires True)
(ensures (fun (cond, sM, sN, f0) ->
cond == eval_ocmp s0 ifb /\
sM == ({s0 with cr0 = eval_cmp_cr0 s0 ifb})
)) | let va_lemma_ifElse_total = Lemmas.lemma_ifElse_total | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 53,
"end_line": 87,
"start_col": 0,
"start_line": 87
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = ()
let va_compute_merge_total = Lemmas.compute_merge_total
let va_lemma_merge_total b0 s0 f0 sM fM sN = Lemmas.lemma_merge_total b0 s0 f0 sM fM sN; Lemmas.compute_merge_total f0 fM | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false |
ifb: Vale.PPC64LE.Decls.ocmp ->
ct: Vale.PPC64LE.Decls.va_code ->
cf: Vale.PPC64LE.Decls.va_code ->
s0: Vale.PPC64LE.Decls.va_state
-> Prims.Ghost
(((Prims.bool * Vale.PPC64LE.Decls.va_state) * Vale.PPC64LE.Decls.va_state) *
Vale.PPC64LE.Decls.va_fuel) | Prims.Ghost | [] | [] | [
"Vale.PPC64LE.Lemmas.lemma_ifElse_total"
] | [] | false | false | false | false | false | let va_lemma_ifElse_total =
| Lemmas.lemma_ifElse_total | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_lemma_empty_total | val va_lemma_empty_total (s0:va_state) (bN:va_codes) : Ghost (va_state & va_fuel)
(requires True)
(ensures (fun (sM, fM) ->
s0 == sM /\
eval_code (va_Block []) s0 fM sM
)) | val va_lemma_empty_total (s0:va_state) (bN:va_codes) : Ghost (va_state & va_fuel)
(requires True)
(ensures (fun (sM, fM) ->
s0 == sM /\
eval_code (va_Block []) s0 fM sM
)) | let va_lemma_empty_total = Lemmas.lemma_empty_total | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 51,
"end_line": 86,
"start_col": 0,
"start_line": 86
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = ()
let va_compute_merge_total = Lemmas.compute_merge_total | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | s0: Vale.PPC64LE.Decls.va_state -> bN: Vale.PPC64LE.Decls.va_codes
-> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel) | Prims.Ghost | [] | [] | [
"Vale.PPC64LE.Lemmas.lemma_empty_total"
] | [] | false | false | false | false | false | let va_lemma_empty_total =
| Lemmas.lemma_empty_total | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_lemma_whileTrue_total | val va_lemma_whileTrue_total (b:ocmp) (c:va_code) (s0:va_state) (sW:va_state) (fW:va_fuel) : Ghost (va_state & va_fuel)
(requires valid_ocmp b sW /\ eval_ocmp sW b)
(ensures fun (s1, f1) -> s1 == {sW with cr0 = eval_cmp_cr0 sW b} /\ f1 == fW) | val va_lemma_whileTrue_total (b:ocmp) (c:va_code) (s0:va_state) (sW:va_state) (fW:va_fuel) : Ghost (va_state & va_fuel)
(requires valid_ocmp b sW /\ eval_ocmp sW b)
(ensures fun (s1, f1) -> s1 == {sW with cr0 = eval_cmp_cr0 sW b} /\ f1 == fW) | let va_lemma_whileTrue_total = Lemmas.lemma_whileTrue_total | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 59,
"end_line": 91,
"start_col": 0,
"start_line": 91
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = ()
let va_compute_merge_total = Lemmas.compute_merge_total
let va_lemma_merge_total b0 s0 f0 sM fM sN = Lemmas.lemma_merge_total b0 s0 f0 sM fM sN; Lemmas.compute_merge_total f0 fM
let va_lemma_empty_total = Lemmas.lemma_empty_total
let va_lemma_ifElse_total = Lemmas.lemma_ifElse_total
let va_lemma_ifElseTrue_total = Lemmas.lemma_ifElseTrue_total
let va_lemma_ifElseFalse_total = Lemmas.lemma_ifElseFalse_total | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false |
b: Vale.PPC64LE.Decls.ocmp ->
c: Vale.PPC64LE.Decls.va_code ->
s0: Vale.PPC64LE.Decls.va_state ->
sW: Vale.PPC64LE.Decls.va_state ->
fW: Vale.PPC64LE.Decls.va_fuel
-> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel) | Prims.Ghost | [] | [] | [
"Vale.PPC64LE.Lemmas.lemma_whileTrue_total"
] | [] | false | false | false | false | false | let va_lemma_whileTrue_total =
| Lemmas.lemma_whileTrue_total | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_lemma_ifElseTrue_total | val va_lemma_ifElseTrue_total (ifb:ocmp) (ct:va_code) (cf:va_code) (s0:va_state) (f0:va_fuel) (sM:va_state) : Lemma
(requires
valid_ocmp ifb s0 /\
eval_ocmp s0 ifb /\
eval_code ct ({s0 with cr0 = eval_cmp_cr0 s0 ifb}) f0 sM
)
(ensures
eval_code (IfElse ifb ct cf) s0 f0 sM
) | val va_lemma_ifElseTrue_total (ifb:ocmp) (ct:va_code) (cf:va_code) (s0:va_state) (f0:va_fuel) (sM:va_state) : Lemma
(requires
valid_ocmp ifb s0 /\
eval_ocmp s0 ifb /\
eval_code ct ({s0 with cr0 = eval_cmp_cr0 s0 ifb}) f0 sM
)
(ensures
eval_code (IfElse ifb ct cf) s0 f0 sM
) | let va_lemma_ifElseTrue_total = Lemmas.lemma_ifElseTrue_total | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 61,
"end_line": 88,
"start_col": 0,
"start_line": 88
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = ()
let va_compute_merge_total = Lemmas.compute_merge_total
let va_lemma_merge_total b0 s0 f0 sM fM sN = Lemmas.lemma_merge_total b0 s0 f0 sM fM sN; Lemmas.compute_merge_total f0 fM
let va_lemma_empty_total = Lemmas.lemma_empty_total | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false |
ifb: Vale.PPC64LE.Decls.ocmp ->
ct: Vale.PPC64LE.Decls.va_code ->
cf: Vale.PPC64LE.Decls.va_code ->
s0: Vale.PPC64LE.Decls.va_state ->
f0: Vale.PPC64LE.Decls.va_fuel ->
sM: Vale.PPC64LE.Decls.va_state
-> FStar.Pervasives.Lemma
(requires
Vale.PPC64LE.Decls.valid_ocmp ifb s0 /\ Vale.PPC64LE.Decls.eval_ocmp s0 ifb /\
Vale.PPC64LE.Decls.eval_code ct
(Vale.PPC64LE.Machine_s.Mkstate (Mkstate?.ok s0)
(Mkstate?.regs s0)
(Mkstate?.vecs s0)
(Vale.PPC64LE.Decls.eval_cmp_cr0 s0 ifb)
(Mkstate?.xer s0)
(Mkstate?.ms_heap s0)
(Mkstate?.ms_stack s0)
(Mkstate?.ms_stackTaint s0))
f0
sM)
(ensures Vale.PPC64LE.Decls.eval_code (Vale.PPC64LE.Machine_s.IfElse ifb ct cf) s0 f0 sM) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Vale.PPC64LE.Lemmas.lemma_ifElseTrue_total"
] | [] | true | false | true | false | false | let va_lemma_ifElseTrue_total =
| Lemmas.lemma_ifElseTrue_total | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_lemma_while_total | val va_lemma_while_total (b:ocmp) (c:va_code) (s0:va_state) : Ghost (va_state & va_fuel)
(requires True)
(ensures fun (s1, f1) ->
s1 == s0 /\
eval_while_inv (While b c) s1 f1 s1
) | val va_lemma_while_total (b:ocmp) (c:va_code) (s0:va_state) : Ghost (va_state & va_fuel)
(requires True)
(ensures fun (s1, f1) ->
s1 == s0 /\
eval_while_inv (While b c) s1 f1 s1
) | let va_lemma_while_total = Lemmas.lemma_while_total | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 51,
"end_line": 90,
"start_col": 0,
"start_line": 90
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = ()
let va_compute_merge_total = Lemmas.compute_merge_total
let va_lemma_merge_total b0 s0 f0 sM fM sN = Lemmas.lemma_merge_total b0 s0 f0 sM fM sN; Lemmas.compute_merge_total f0 fM
let va_lemma_empty_total = Lemmas.lemma_empty_total
let va_lemma_ifElse_total = Lemmas.lemma_ifElse_total
let va_lemma_ifElseTrue_total = Lemmas.lemma_ifElseTrue_total | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false | b: Vale.PPC64LE.Decls.ocmp -> c: Vale.PPC64LE.Decls.va_code -> s0: Vale.PPC64LE.Decls.va_state
-> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel) | Prims.Ghost | [] | [] | [
"Vale.PPC64LE.Lemmas.lemma_while_total"
] | [] | false | false | false | false | false | let va_lemma_while_total =
| Lemmas.lemma_while_total | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_lemma_ifElseFalse_total | val va_lemma_ifElseFalse_total (ifb:ocmp) (ct:va_code) (cf:va_code) (s0:va_state) (f0:va_fuel) (sM:va_state) : Lemma
(requires
valid_ocmp ifb s0 /\
not (eval_ocmp s0 ifb) /\
eval_code cf ({s0 with cr0 = eval_cmp_cr0 s0 ifb}) f0 sM
)
(ensures
eval_code (IfElse ifb ct cf) s0 f0 sM
) | val va_lemma_ifElseFalse_total (ifb:ocmp) (ct:va_code) (cf:va_code) (s0:va_state) (f0:va_fuel) (sM:va_state) : Lemma
(requires
valid_ocmp ifb s0 /\
not (eval_ocmp s0 ifb) /\
eval_code cf ({s0 with cr0 = eval_cmp_cr0 s0 ifb}) f0 sM
)
(ensures
eval_code (IfElse ifb ct cf) s0 f0 sM
) | let va_lemma_ifElseFalse_total = Lemmas.lemma_ifElseFalse_total | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 63,
"end_line": 89,
"start_col": 0,
"start_line": 89
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = ()
let va_compute_merge_total = Lemmas.compute_merge_total
let va_lemma_merge_total b0 s0 f0 sM fM sN = Lemmas.lemma_merge_total b0 s0 f0 sM fM sN; Lemmas.compute_merge_total f0 fM
let va_lemma_empty_total = Lemmas.lemma_empty_total
let va_lemma_ifElse_total = Lemmas.lemma_ifElse_total | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false |
ifb: Vale.PPC64LE.Decls.ocmp ->
ct: Vale.PPC64LE.Decls.va_code ->
cf: Vale.PPC64LE.Decls.va_code ->
s0: Vale.PPC64LE.Decls.va_state ->
f0: Vale.PPC64LE.Decls.va_fuel ->
sM: Vale.PPC64LE.Decls.va_state
-> FStar.Pervasives.Lemma
(requires
Vale.PPC64LE.Decls.valid_ocmp ifb s0 /\
Prims.op_Negation (Vale.PPC64LE.Decls.eval_ocmp s0 ifb) /\
Vale.PPC64LE.Decls.eval_code cf
(Vale.PPC64LE.Machine_s.Mkstate (Mkstate?.ok s0)
(Mkstate?.regs s0)
(Mkstate?.vecs s0)
(Vale.PPC64LE.Decls.eval_cmp_cr0 s0 ifb)
(Mkstate?.xer s0)
(Mkstate?.ms_heap s0)
(Mkstate?.ms_stack s0)
(Mkstate?.ms_stackTaint s0))
f0
sM)
(ensures Vale.PPC64LE.Decls.eval_code (Vale.PPC64LE.Machine_s.IfElse ifb ct cf) s0 f0 sM) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Vale.PPC64LE.Lemmas.lemma_ifElseFalse_total"
] | [] | true | false | true | false | false | let va_lemma_ifElseFalse_total =
| Lemmas.lemma_ifElseFalse_total | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_lemma_whileFalse_total | val va_lemma_whileFalse_total (b:ocmp) (c:va_code) (s0:va_state) (sW:va_state) (fW:va_fuel) : Ghost (va_state & va_fuel)
(requires
valid_ocmp b sW /\
not (eval_ocmp sW b) /\
eval_while_inv (While b c) s0 fW sW
)
(ensures fun (s1, f1) ->
s1 == {sW with cr0 = eval_cmp_cr0 sW b} /\
eval_code (While b c) s0 f1 s1
) | val va_lemma_whileFalse_total (b:ocmp) (c:va_code) (s0:va_state) (sW:va_state) (fW:va_fuel) : Ghost (va_state & va_fuel)
(requires
valid_ocmp b sW /\
not (eval_ocmp sW b) /\
eval_while_inv (While b c) s0 fW sW
)
(ensures fun (s1, f1) ->
s1 == {sW with cr0 = eval_cmp_cr0 sW b} /\
eval_code (While b c) s0 f1 s1
) | let va_lemma_whileFalse_total = Lemmas.lemma_whileFalse_total | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 61,
"end_line": 92,
"start_col": 0,
"start_line": 92
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = ()
let va_compute_merge_total = Lemmas.compute_merge_total
let va_lemma_merge_total b0 s0 f0 sM fM sN = Lemmas.lemma_merge_total b0 s0 f0 sM fM sN; Lemmas.compute_merge_total f0 fM
let va_lemma_empty_total = Lemmas.lemma_empty_total
let va_lemma_ifElse_total = Lemmas.lemma_ifElse_total
let va_lemma_ifElseTrue_total = Lemmas.lemma_ifElseTrue_total
let va_lemma_ifElseFalse_total = Lemmas.lemma_ifElseFalse_total
let va_lemma_while_total = Lemmas.lemma_while_total | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false |
b: Vale.PPC64LE.Decls.ocmp ->
c: Vale.PPC64LE.Decls.va_code ->
s0: Vale.PPC64LE.Decls.va_state ->
sW: Vale.PPC64LE.Decls.va_state ->
fW: Vale.PPC64LE.Decls.va_fuel
-> Prims.Ghost (Vale.PPC64LE.Decls.va_state * Vale.PPC64LE.Decls.va_fuel) | Prims.Ghost | [] | [] | [
"Vale.PPC64LE.Lemmas.lemma_whileFalse_total"
] | [] | false | false | false | false | false | let va_lemma_whileFalse_total =
| Lemmas.lemma_whileFalse_total | false |
Vale.PPC64LE.Decls.fst | Vale.PPC64LE.Decls.va_lemma_whileMerge_total | val va_lemma_whileMerge_total (c:va_code) (s0:va_state) (f0:va_fuel) (sM:va_state) (fM:va_fuel) (sN:va_state) : Ghost va_fuel
(requires While? c /\ (
let cond = While?.whileCond c in
sN.ok /\
valid_ocmp cond sM /\
eval_ocmp sM cond /\
eval_while_inv c s0 f0 sM /\
eval_code (While?.whileBody c) ({sM with cr0 = eval_cmp_cr0 sM cond}) fM sN
))
(ensures (fun fN ->
eval_while_inv c s0 fN sN
)) | val va_lemma_whileMerge_total (c:va_code) (s0:va_state) (f0:va_fuel) (sM:va_state) (fM:va_fuel) (sN:va_state) : Ghost va_fuel
(requires While? c /\ (
let cond = While?.whileCond c in
sN.ok /\
valid_ocmp cond sM /\
eval_ocmp sM cond /\
eval_while_inv c s0 f0 sM /\
eval_code (While?.whileBody c) ({sM with cr0 = eval_cmp_cr0 sM cond}) fM sN
))
(ensures (fun fN ->
eval_while_inv c s0 fN sN
)) | let va_lemma_whileMerge_total = Lemmas.lemma_whileMerge_total | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Decls.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 61,
"end_line": 93,
"start_col": 0,
"start_line": 93
} | module Vale.PPC64LE.Decls
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.StateLemmas
module S = Vale.PPC64LE.Semantics_s
module P = Vale.PPC64LE.Print_s
friend Vale.PPC64LE.Memory
let same_heap_types = ()
let xer_ov = Lemmas.xer_ov
let xer_ca = Lemmas.xer_ca
let update_xer_ov = Lemmas.update_xer_ov
let update_xer_ca = Lemmas.update_xer_ca
let ins = S.ins
type ocmp = S.ocmp
type va_fuel = nat
type va_pbool = Vale.Def.PossiblyMonad.pbool
let va_ttrue () = Vale.Def.PossiblyMonad.ttrue
let va_ffalse = Vale.Def.PossiblyMonad.ffalse
let va_pbool_and x y = Vale.Def.PossiblyMonad.((&&.)) x y
let mul_nat_helper x y =
FStar.Math.Lemmas.nat_times_nat_is_nat x y
let va_fuel_default () = 0
let lemma_opr_Mem64 (id:heaplet_id) (s:va_state) (address:reg_opr) (offset:int) (b:M.buffer64) (index:int) (t:taint) : Lemma
(requires (
let h = Map16.sel s.ms_heap.vf_heaplets id in
M.mem_inv (coerce s.ms_heap) /\
valid_src_addr h b index /\
M.valid_layout_buffer b (s.ms_heap.vf_layout) h false /\
M.valid_taint_buf64 b h (full_heap_taint s.ms_heap) t /\
eval_reg address s + offset == M.buffer_addr b h + 8 * index
))
(ensures (
let h = Map16.sel s.ms_heap.vf_heaplets id in
valid_mem_addr (va_opr_code_Mem64 id address offset t) s /\
M.load_mem64 (M.buffer_addr b h + 8 * index) (s.ms_heap.vf_heap) == M.buffer_read b index h
))
=
Vale.PPC64LE.Memory_Sems.low_lemma_load_mem64_full b index s.ms_heap t id;
let h = M.get_vale_heap s.ms_heap in
let t = va_opr_code_Mem64 id address offset t in
M.lemma_valid_mem64 b index h;
let (m, t) = t in
assert (valid_buf_maddr64 (eval_maddr m s) h s.ms_heap.vf_layout b index t);
M.lemma_load_mem64 b index h
let va_cmp_eq o1 o2 = S.OEq o1 o2
let va_cmp_ne o1 o2 = S.ONe o1 o2
let va_cmp_le o1 o2 = S.OLe o1 o2
let va_cmp_ge o1 o2 = S.OGe o1 o2
let va_cmp_lt o1 o2 = S.OLt o1 o2
let va_cmp_gt o1 o2 = S.OGt o1 o2
let eval_code = Lemmas.eval_code
let eval_while_inv = Lemmas.eval_while_inv
let va_ins_lemma c0 s0 = ()
let eval_ocmp = Lemmas.eval_ocmp
let valid_ocmp = Lemmas.valid_ocmp
let eval_cmp_cr0 = S.eval_cmp_cr0
unfold let va_eval_ins = Lemmas.eval_ins
let lemma_cmp_eq s o1 o2 = ()
let lemma_cmp_ne s o1 o2 = ()
let lemma_cmp_le s o1 o2 = ()
let lemma_cmp_ge s o1 o2 = ()
let lemma_cmp_lt s o1 o2 = ()
let lemma_cmp_gt s o1 o2 = ()
let lemma_valid_cmp_eq s o1 o2 = ()
let lemma_valid_cmp_ne s o1 o2 = ()
let lemma_valid_cmp_le s o1 o2 = ()
let lemma_valid_cmp_ge s o1 o2 = ()
let lemma_valid_cmp_lt s o1 o2 = ()
let lemma_valid_cmp_gt s o1 o2 = ()
let va_compute_merge_total = Lemmas.compute_merge_total
let va_lemma_merge_total b0 s0 f0 sM fM sN = Lemmas.lemma_merge_total b0 s0 f0 sM fM sN; Lemmas.compute_merge_total f0 fM
let va_lemma_empty_total = Lemmas.lemma_empty_total
let va_lemma_ifElse_total = Lemmas.lemma_ifElse_total
let va_lemma_ifElseTrue_total = Lemmas.lemma_ifElseTrue_total
let va_lemma_ifElseFalse_total = Lemmas.lemma_ifElseFalse_total
let va_lemma_while_total = Lemmas.lemma_while_total
let va_lemma_whileTrue_total = Lemmas.lemma_whileTrue_total | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.StateLemmas.fsti.checked",
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.Semantics_s.fst.checked",
"Vale.PPC64LE.Print_s.fst.checked",
"Vale.PPC64LE.Memory_Sems.fsti.checked",
"Vale.PPC64LE.Memory.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.Lemmas.fsti.checked",
"Vale.Def.PossiblyMonad.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": true,
"source_file": "Vale.PPC64LE.Decls.fst"
} | [
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Print_s",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Semantics_s",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_Sems",
"short_module": "VSS"
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Stack_i",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Vale.PPC64LE.Memory",
"short_module": "M"
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 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"
} | false |
c: Vale.PPC64LE.Decls.va_code ->
s0: Vale.PPC64LE.Decls.va_state ->
f0: Vale.PPC64LE.Decls.va_fuel ->
sM: Vale.PPC64LE.Decls.va_state ->
fM: Vale.PPC64LE.Decls.va_fuel ->
sN: Vale.PPC64LE.Decls.va_state
-> Prims.Ghost Vale.PPC64LE.Decls.va_fuel | Prims.Ghost | [] | [] | [
"Vale.PPC64LE.Lemmas.lemma_whileMerge_total"
] | [] | false | false | false | false | false | let va_lemma_whileMerge_total =
| Lemmas.lemma_whileMerge_total | false |
Hacl.Spec.K256.Field52.Lemmas4.fst | Hacl.Spec.K256.Field52.Lemmas4.lemma_nat_r43210 | val lemma_nat_r43210 (r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 r sum1 sum2 sum7:nat) : Lemma
(requires
d10 == d8 / pow2 52 + sum7 /\
r0 = c3 % pow2 52 /\ c6 = c3 / pow2 52 + sum1 + d8 % pow2 52 * r /\
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
r0 + r1 * pow52 + r2 * pow104 + r3 * pow156 + r4 * pow208 =
c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 + t3 * pow2 156 + (d4 % pow2 48) * pow2 208) | val lemma_nat_r43210 (r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 r sum1 sum2 sum7:nat) : Lemma
(requires
d10 == d8 / pow2 52 + sum7 /\
r0 = c3 % pow2 52 /\ c6 = c3 / pow2 52 + sum1 + d8 % pow2 52 * r /\
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
r0 + r1 * pow52 + r2 * pow104 + r3 * pow156 + r4 * pow208 =
c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 + t3 * pow2 156 + (d4 % pow2 48) * pow2 208) | let lemma_nat_r43210 r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 r sum1 sum2 sum7 =
let k = d4 % pow2 48 in
let tmp1 = sum2 * pow2 52 + t3 * pow2 104 + k * pow2 156 in
calc (==) { // tmp1 * pow2 52
(sum2 * pow2 52 + t3 * pow2 104 + k * pow2 156) * pow2 52;
(==) { ML.lemma_distr_pow (sum2 * pow2 52 + t3 * pow2 104) k 156 52 }
(sum2 * pow2 52 + t3 * pow2 104) * pow2 52 + k * pow2 208;
(==) { ML.lemma_distr_pow_pow sum2 52 t3 104 52 }
sum2 * pow2 104 + t3 * pow2 156 + k * pow2 208;
};
calc (==) {
r0 + r1 * pow52 + r2 * pow104 + r3 * pow156 + r4 * pow208;
(==) { ML.lemma_as_nat_horner r0 r1 r2 r3 r4 }
(((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1) * pow2 52 + r0;
(==) { lemma_nat_r4321 r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2 }
(c3 / pow2 52 + sum1 + d8 % pow2 52 * r + r * (d8 / pow2 52 + sum7) * pow2 52 + tmp1) * pow2 52 + c3 % pow2 52;
(==) { ML.lemma_distr_eucl_mul_add r d8 sum7 (pow2 52) }
(c3 / pow2 52 + sum1 + r * d8 + r * sum7 * pow2 52 + tmp1) * pow2 52 + c3 % pow2 52;
(==) { ML.lemma_distr_eucl c3 (sum1 + r * d8 + r * sum7 * pow2 52 + tmp1) }
c3 + (sum1 + r * d8 + r * sum7 * pow2 52 + tmp1) * pow2 52;
(==) { ML.lemma_distr_pow (sum1 + r * d8 + tmp1) (r * sum7) 52 52 }
c3 + (sum1 + r * d8 + tmp1) * pow2 52 + r * sum7 * pow2 104;
(==) { Math.Lemmas.distributivity_add_left (sum1 + r * d8) tmp1 (pow2 52) }
c3 + (sum1 + r * d8) * pow2 52 + sum2 * pow2 104 + t3 * pow2 156 + k * pow2 208 + r * sum7 * pow2 104;
(==) { Math.Lemmas.distributivity_add_left sum2 (r * sum7) (pow2 104) }
c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 + t3 * pow2 156 + k * pow2 208;
} | {
"file_name": "code/k256/Hacl.Spec.K256.Field52.Lemmas4.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 5,
"end_line": 116,
"start_col": 0,
"start_line": 88
} | module Hacl.Spec.K256.Field52.Lemmas4
open FStar.Mul
open Lib.IntTypes
module S = Spec.K256
include Hacl.Spec.K256.Field52.Definitions
include Hacl.Spec.K256.Field52
module ML = Hacl.Spec.K256.MathLemmas
module LD = Hacl.Spec.K256.Field52.Definitions.Lemmas
#set-options "--z3rlimit 100 --fuel 0 --ifuel 0"
val lemma_nat_r432 (r2 r3 r4 c9 c11 d4 d11 t3 r:nat) : Lemma
(requires
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
(r4 * pow2 52 + r3) * pow2 52 + r2 =
c9 + r * d11 * pow2 64 + t3 * pow2 52 + (d4 % pow2 48) * pow2 104)
let lemma_nat_r432 r2 r3 r4 c9 c11 d4 d11 t3 r =
let k = d4 % pow2 48 in
calc (==) {
(r4 * pow2 52 + r3) * pow2 52 + r2;
(==) { Math.Lemmas.pow2_modulo_modulo_lemma_1 d4 48 52 }
((c11 / pow2 52 + k) * pow2 52 + c11 % pow2 52) * pow2 52 + r2;
(==) { ML.lemma_distr_eucl c11 k }
(c9 / pow2 52 + r * pow2 12 * d11 + t3 + k * pow2 52) * pow2 52 + c9 % pow2 52;
(==) { ML.lemma_distr_eucl c9 (r * pow2 12 * d11 + t3 + k * pow2 52) }
c9 + (r * pow2 12 * d11 + t3 + k * pow2 52) * pow2 52;
(==) { ML.lemma_distr_pow (r * pow2 12 * d11 + t3) k 52 52 }
c9 + (r * pow2 12 * d11 + t3) * pow2 52 + k * pow2 104;
(==) { ML.lemma_swap_mul3 r (pow2 12) d11 }
c9 + (r * d11 * pow2 12 + t3) * pow2 52 + k * pow2 104;
(==) { ML.lemma_distr_pow t3 (r * d11) 12 52 }
c9 + r * d11 * pow2 64 + t3 * pow2 52 + k * pow2 104;
}
val lemma_nat_r4321 (r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2:nat) : Lemma
(requires
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1 =
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + t3 * pow2 104 + (d4 % pow2 48) * pow2 156)
let lemma_nat_r4321 r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2 =
let k = d4 % pow2 48 in
let tmp1 = t3 * pow2 52 + k * pow2 104 in
calc (==) {
((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1;
(==) { lemma_nat_r432 r2 r3 r4 c9 c11 d4 d11 t3 r }
(c9 + r * d11 * pow2 64 + tmp1) * pow2 52 + r1;
(==) { }
(c6 / pow2 52 + sum2 + r * (d10 % pow2 64) + r * d11 * pow2 64 + tmp1) * pow2 52 + c6 % pow2 52;
(==) { ML.lemma_distr_eucl_mul r d10 (pow2 64) }
(c6 / pow2 52 + sum2 + r * d10 + tmp1) * pow2 52 + c6 % pow2 52;
(==) { ML.lemma_distr_eucl c6 (sum2 + r * d10 + tmp1) }
c6 + (sum2 + r * d10 + tmp1) * pow2 52;
(==) { Math.Lemmas.distributivity_add_left (sum2 + r * d10) tmp1 (pow2 52) }
c6 + (sum2 + r * d10) * pow2 52 + tmp1 * pow2 52;
(==) { Math.Lemmas.distributivity_add_left sum2 (r * d10) (pow2 52) }
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + tmp1 * pow2 52;
(==) { ML.lemma_distr_pow_pow t3 52 k 104 52 }
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + t3 * pow2 104 + k * pow2 156;
}
val lemma_nat_r43210 (r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 r sum1 sum2 sum7:nat) : Lemma
(requires
d10 == d8 / pow2 52 + sum7 /\
r0 = c3 % pow2 52 /\ c6 = c3 / pow2 52 + sum1 + d8 % pow2 52 * r /\
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
r0 + r1 * pow52 + r2 * pow104 + r3 * pow156 + r4 * pow208 =
c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 + t3 * pow2 156 + (d4 % pow2 48) * pow2 208) | {
"checked_file": "/",
"dependencies": [
"Spec.K256.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.K256.MathLemmas.fst.checked",
"Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked",
"Hacl.Spec.K256.Field52.Definitions.fst.checked",
"Hacl.Spec.K256.Field52.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.K256.Field52.Lemmas4.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.Field52.Definitions.Lemmas",
"short_module": "LD"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.MathLemmas",
"short_module": "ML"
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.K256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
r0: Prims.nat ->
r1: Prims.nat ->
r2: Prims.nat ->
r3: Prims.nat ->
r4: Prims.nat ->
c3: Prims.nat ->
c6: Prims.nat ->
c9: Prims.nat ->
c11: Prims.nat ->
d4: Prims.nat ->
d8: Prims.nat ->
d10: Prims.nat ->
d11: Prims.nat ->
t3: Prims.nat ->
r: Prims.nat ->
sum1: Prims.nat ->
sum2: Prims.nat ->
sum7: Prims.nat
-> FStar.Pervasives.Lemma
(requires
d10 == d8 / Prims.pow2 52 + sum7 /\ r0 = c3 % Prims.pow2 52 /\
c6 = c3 / Prims.pow2 52 + sum1 + (d8 % Prims.pow2 52) * r /\ d11 = d10 / Prims.pow2 64 /\
r1 = c6 % Prims.pow2 52 /\ c9 = c6 / Prims.pow2 52 + sum2 + r * (d10 % Prims.pow2 64) /\
r2 = c9 % Prims.pow2 52 /\ c11 = c9 / Prims.pow2 52 + (r * Prims.pow2 12) * d11 + t3 /\
r3 = c11 % Prims.pow2 52 /\ r4 = c11 / Prims.pow2 52 + d4 % Prims.pow2 52 % Prims.pow2 48)
(ensures
r0 + r1 * Hacl.Spec.K256.Field52.Definitions.pow52 +
r2 * Hacl.Spec.K256.Field52.Definitions.pow104 +
r3 * Hacl.Spec.K256.Field52.Definitions.pow156 +
r4 * Hacl.Spec.K256.Field52.Definitions.pow208 =
c3 + (sum1 + r * d8) * Prims.pow2 52 + (sum2 + r * sum7) * Prims.pow2 104 +
t3 * Prims.pow2 156 +
(d4 % Prims.pow2 48) * Prims.pow2 208) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.nat",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Prims.op_Addition",
"FStar.Mul.op_Star",
"Hacl.Spec.K256.Field52.Definitions.pow52",
"Hacl.Spec.K256.Field52.Definitions.pow104",
"Hacl.Spec.K256.Field52.Definitions.pow156",
"Hacl.Spec.K256.Field52.Definitions.pow208",
"Prims.pow2",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"Prims.op_Division",
"Prims.op_Modulus",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"Hacl.Spec.K256.MathLemmas.lemma_as_nat_horner",
"Prims.squash",
"Hacl.Spec.K256.Field52.Lemmas4.lemma_nat_r4321",
"Hacl.Spec.K256.MathLemmas.lemma_distr_eucl_mul_add",
"Hacl.Spec.K256.MathLemmas.lemma_distr_eucl",
"Hacl.Spec.K256.MathLemmas.lemma_distr_pow",
"FStar.Math.Lemmas.distributivity_add_left",
"Hacl.Spec.K256.MathLemmas.lemma_distr_pow_pow"
] | [] | false | false | true | false | false | let lemma_nat_r43210 r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 r sum1 sum2 sum7 =
| let k = d4 % pow2 48 in
let tmp1 = sum2 * pow2 52 + t3 * pow2 104 + k * pow2 156 in
calc ( == ) {
(sum2 * pow2 52 + t3 * pow2 104 + k * pow2 156) * pow2 52;
( == ) { ML.lemma_distr_pow (sum2 * pow2 52 + t3 * pow2 104) k 156 52 }
(sum2 * pow2 52 + t3 * pow2 104) * pow2 52 + k * pow2 208;
( == ) { ML.lemma_distr_pow_pow sum2 52 t3 104 52 }
sum2 * pow2 104 + t3 * pow2 156 + k * pow2 208;
};
calc ( == ) {
r0 + r1 * pow52 + r2 * pow104 + r3 * pow156 + r4 * pow208;
( == ) { ML.lemma_as_nat_horner r0 r1 r2 r3 r4 }
(((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1) * pow2 52 + r0;
( == ) { lemma_nat_r4321 r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2 }
(c3 / pow2 52 + sum1 + (d8 % pow2 52) * r + (r * (d8 / pow2 52 + sum7)) * pow2 52 + tmp1) *
pow2 52 +
c3 % pow2 52;
( == ) { ML.lemma_distr_eucl_mul_add r d8 sum7 (pow2 52) }
(c3 / pow2 52 + sum1 + r * d8 + (r * sum7) * pow2 52 + tmp1) * pow2 52 + c3 % pow2 52;
( == ) { ML.lemma_distr_eucl c3 (sum1 + r * d8 + (r * sum7) * pow2 52 + tmp1) }
c3 + (sum1 + r * d8 + (r * sum7) * pow2 52 + tmp1) * pow2 52;
( == ) { ML.lemma_distr_pow (sum1 + r * d8 + tmp1) (r * sum7) 52 52 }
c3 + (sum1 + r * d8 + tmp1) * pow2 52 + (r * sum7) * pow2 104;
( == ) { Math.Lemmas.distributivity_add_left (sum1 + r * d8) tmp1 (pow2 52) }
c3 + (sum1 + r * d8) * pow2 52 + sum2 * pow2 104 + t3 * pow2 156 + k * pow2 208 +
(r * sum7) * pow2 104;
( == ) { Math.Lemmas.distributivity_add_left sum2 (r * sum7) (pow2 104) }
c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 + t3 * pow2 156 + k * pow2 208;
} | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.linv_ctx | val linv_ctx (a: LSeq.lseq uint64 0) : Type0 | val linv_ctx (a: LSeq.lseq uint64 0) : Type0 | let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 50,
"end_line": 26,
"start_col": 0,
"start_line": 26
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Lib.Sequence.lseq Lib.IntTypes.uint64 0 -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Lib.Sequence.lseq",
"Lib.IntTypes.uint64",
"Prims.l_True"
] | [] | false | false | false | false | true | let linv_ctx (a: LSeq.lseq uint64 0) : Type0 =
| True | false |
Hacl.Spec.K256.Field52.Lemmas4.fst | Hacl.Spec.K256.Field52.Lemmas4.lemma_nat_r43210_mod_prime | val lemma_nat_r43210_mod_prime (c3 d4 d8 t3 r sum0 sum1 sum2 sum3 sum4 sum5 sum6 sum7 sum8: nat) : Lemma
(requires
r = 0x1000003D10 /\
d4 = (sum3 + r * (sum8 % pow2 64)) / pow2 52 + sum4 + r * pow2 12 * (sum8 / pow2 64) /\
t3 = (sum3 + r * (sum8 % pow2 64)) % pow2 52 /\
d8 = (d4 / pow2 52 + sum5) / pow2 52 + sum6 /\
c3 = sum0 + ((d4 % pow2 52) / pow2 48 + ((d4 / pow2 52 + sum5) % pow2 52) * pow2 4) * (r / pow2 4))
(ensures
(c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 +
t3 * pow2 156 + (d4 % pow2 48) * pow2 208) % S.prime ==
(sum0 + sum5 * r + (sum1 + sum6 * r) * pow2 52 + (sum2 + r * sum7) * pow2 104 +
(sum3 + r * sum8) * pow2 156 + sum4 * pow2 208) % S.prime) | val lemma_nat_r43210_mod_prime (c3 d4 d8 t3 r sum0 sum1 sum2 sum3 sum4 sum5 sum6 sum7 sum8: nat) : Lemma
(requires
r = 0x1000003D10 /\
d4 = (sum3 + r * (sum8 % pow2 64)) / pow2 52 + sum4 + r * pow2 12 * (sum8 / pow2 64) /\
t3 = (sum3 + r * (sum8 % pow2 64)) % pow2 52 /\
d8 = (d4 / pow2 52 + sum5) / pow2 52 + sum6 /\
c3 = sum0 + ((d4 % pow2 52) / pow2 48 + ((d4 / pow2 52 + sum5) % pow2 52) * pow2 4) * (r / pow2 4))
(ensures
(c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 +
t3 * pow2 156 + (d4 % pow2 48) * pow2 208) % S.prime ==
(sum0 + sum5 * r + (sum1 + sum6 * r) * pow2 52 + (sum2 + r * sum7) * pow2 104 +
(sum3 + r * sum8) * pow2 156 + sum4 * pow2 208) % S.prime) | let lemma_nat_r43210_mod_prime c3 d4 d8 t3 r sum0 sum1 sum2 sum3 sum4 sum5 sum6 sum7 sum8 =
let tmp2 = sum3 + r * (sum8 % pow2 64) in
let tmp1 = d4 / pow2 52 + sum5 in
let tmp0 = sum0 + (tmp1 % pow2 52 - d4 / pow2 52) * r in
let d4mod = (d4 % pow2 48) * pow2 208 + (d4 / pow2 48) * 0x1000003D1 in
calc (==) {
c3 + (d4 % pow2 48) * pow2 208 + (sum1 + r * d8) * pow2 52;
(==) { simplify_c3 d4 r sum5; assert_norm (0x1000003D10 / pow2 4 = 0x1000003D1) }
d4mod + tmp0 + (sum1 + r * d8) * pow2 52;
(==) { Math.Lemmas.distributivity_add_left sum1 (r * d8) (pow2 52) }
d4mod + sum0 + (tmp1 % pow2 52 - d4 / pow2 52) * r + sum1 * pow2 52 + r * (tmp1 / pow2 52 + sum6) * pow2 52;
(==) { Math.Lemmas.distributivity_sub_left (tmp1 % pow2 52) (d4 / pow2 52) r }
d4mod + sum0 + (tmp1 % pow2 52) * r - d4 / pow2 52 * r + sum1 * pow2 52 + r * (tmp1 / pow2 52 + sum6) * pow2 52;
(==) { ML.lemma_distr_eucl_mul_add r tmp1 sum6 (pow2 52) }
d4mod + sum0 + r * (d4 / pow2 52 + sum5) - d4 / pow2 52 * r + sum1 * pow2 52 + r * sum6 * pow2 52;
(==) { Math.Lemmas.distributivity_add_right r (d4 / pow2 52) sum5 }
d4mod + sum0 + r * sum5 + sum1 * pow2 52 + r * sum6 * pow2 52;
(==) { Math.Lemmas.distributivity_add_left sum1 (r * sum6) (pow2 52) }
d4mod + sum0 + r * sum5 + (sum1 + r * sum6) * pow2 52;
};
calc (==) { //t3 * pow2 156 + d4 * pow2 208;
(tmp2 % pow2 52) * pow2 156 + (tmp2 / pow2 52 + sum4 + r * pow2 12 * (sum8 / pow2 64)) * pow2 208;
(==) { ML.lemma_distr_pow (tmp2 % pow2 52) (tmp2 / pow2 52 + sum4 + r * pow2 12 * (sum8 / pow2 64)) 52 156 }
(tmp2 % pow2 52 + (tmp2 / pow2 52 + sum4 + r * pow2 12 * (sum8 / pow2 64)) * pow2 52) * pow2 156;
(==) { ML.lemma_distr_eucl_mul_add 1 tmp2 (sum4 + r * pow2 12 * (sum8 / pow2 64)) (pow2 52) }
(tmp2 + (sum4 + r * pow2 12 * (sum8 / pow2 64)) * pow2 52) * pow2 156;
(==) { ML.lemma_swap_mul3 r (pow2 12) (sum8 / pow2 64) }
(tmp2 + (sum4 + r * (sum8 / pow2 64) * pow2 12) * pow2 52) * pow2 156;
(==) { ML.lemma_distr_pow sum4 (r * (sum8 / pow2 64)) 12 52 }
(sum3 + r * (sum8 % pow2 64) + sum4 * pow2 52 + r * (sum8 / pow2 64) * pow2 64) * pow2 156;
(==) { ML.lemma_distr_eucl_mul r sum8 (pow2 64) }
(sum3 + r * sum8 + sum4 * pow2 52) * pow2 156;
(==) { ML.lemma_distr_pow (sum3 + r * sum8) sum4 52 156 }
(sum3 + r * sum8) * pow2 156 + sum4 * pow2 208;
};
LD.as_nat_mod_prime (sum0 + r * sum5) (sum1 + r * sum6) (sum2 + r * sum7) t3 d4 | {
"file_name": "code/k256/Hacl.Spec.K256.Field52.Lemmas4.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 81,
"end_line": 196,
"start_col": 0,
"start_line": 158
} | module Hacl.Spec.K256.Field52.Lemmas4
open FStar.Mul
open Lib.IntTypes
module S = Spec.K256
include Hacl.Spec.K256.Field52.Definitions
include Hacl.Spec.K256.Field52
module ML = Hacl.Spec.K256.MathLemmas
module LD = Hacl.Spec.K256.Field52.Definitions.Lemmas
#set-options "--z3rlimit 100 --fuel 0 --ifuel 0"
val lemma_nat_r432 (r2 r3 r4 c9 c11 d4 d11 t3 r:nat) : Lemma
(requires
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
(r4 * pow2 52 + r3) * pow2 52 + r2 =
c9 + r * d11 * pow2 64 + t3 * pow2 52 + (d4 % pow2 48) * pow2 104)
let lemma_nat_r432 r2 r3 r4 c9 c11 d4 d11 t3 r =
let k = d4 % pow2 48 in
calc (==) {
(r4 * pow2 52 + r3) * pow2 52 + r2;
(==) { Math.Lemmas.pow2_modulo_modulo_lemma_1 d4 48 52 }
((c11 / pow2 52 + k) * pow2 52 + c11 % pow2 52) * pow2 52 + r2;
(==) { ML.lemma_distr_eucl c11 k }
(c9 / pow2 52 + r * pow2 12 * d11 + t3 + k * pow2 52) * pow2 52 + c9 % pow2 52;
(==) { ML.lemma_distr_eucl c9 (r * pow2 12 * d11 + t3 + k * pow2 52) }
c9 + (r * pow2 12 * d11 + t3 + k * pow2 52) * pow2 52;
(==) { ML.lemma_distr_pow (r * pow2 12 * d11 + t3) k 52 52 }
c9 + (r * pow2 12 * d11 + t3) * pow2 52 + k * pow2 104;
(==) { ML.lemma_swap_mul3 r (pow2 12) d11 }
c9 + (r * d11 * pow2 12 + t3) * pow2 52 + k * pow2 104;
(==) { ML.lemma_distr_pow t3 (r * d11) 12 52 }
c9 + r * d11 * pow2 64 + t3 * pow2 52 + k * pow2 104;
}
val lemma_nat_r4321 (r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2:nat) : Lemma
(requires
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1 =
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + t3 * pow2 104 + (d4 % pow2 48) * pow2 156)
let lemma_nat_r4321 r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2 =
let k = d4 % pow2 48 in
let tmp1 = t3 * pow2 52 + k * pow2 104 in
calc (==) {
((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1;
(==) { lemma_nat_r432 r2 r3 r4 c9 c11 d4 d11 t3 r }
(c9 + r * d11 * pow2 64 + tmp1) * pow2 52 + r1;
(==) { }
(c6 / pow2 52 + sum2 + r * (d10 % pow2 64) + r * d11 * pow2 64 + tmp1) * pow2 52 + c6 % pow2 52;
(==) { ML.lemma_distr_eucl_mul r d10 (pow2 64) }
(c6 / pow2 52 + sum2 + r * d10 + tmp1) * pow2 52 + c6 % pow2 52;
(==) { ML.lemma_distr_eucl c6 (sum2 + r * d10 + tmp1) }
c6 + (sum2 + r * d10 + tmp1) * pow2 52;
(==) { Math.Lemmas.distributivity_add_left (sum2 + r * d10) tmp1 (pow2 52) }
c6 + (sum2 + r * d10) * pow2 52 + tmp1 * pow2 52;
(==) { Math.Lemmas.distributivity_add_left sum2 (r * d10) (pow2 52) }
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + tmp1 * pow2 52;
(==) { ML.lemma_distr_pow_pow t3 52 k 104 52 }
c6 + sum2 * pow2 52 + r * d10 * pow2 52 + t3 * pow2 104 + k * pow2 156;
}
val lemma_nat_r43210 (r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 r sum1 sum2 sum7:nat) : Lemma
(requires
d10 == d8 / pow2 52 + sum7 /\
r0 = c3 % pow2 52 /\ c6 = c3 / pow2 52 + sum1 + d8 % pow2 52 * r /\
d11 = d10 / pow2 64 /\
r1 = c6 % pow2 52 /\ c9 = c6 / pow2 52 + sum2 + r * (d10 % pow2 64) /\
r2 = c9 % pow2 52 /\ c11 = c9 / pow2 52 + r * pow2 12 * d11 + t3 /\
r3 = c11 % pow2 52 /\ r4 = c11 / pow2 52 + (d4 % pow2 52) % pow2 48)
(ensures
r0 + r1 * pow52 + r2 * pow104 + r3 * pow156 + r4 * pow208 =
c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 + t3 * pow2 156 + (d4 % pow2 48) * pow2 208)
let lemma_nat_r43210 r0 r1 r2 r3 r4 c3 c6 c9 c11 d4 d8 d10 d11 t3 r sum1 sum2 sum7 =
let k = d4 % pow2 48 in
let tmp1 = sum2 * pow2 52 + t3 * pow2 104 + k * pow2 156 in
calc (==) { // tmp1 * pow2 52
(sum2 * pow2 52 + t3 * pow2 104 + k * pow2 156) * pow2 52;
(==) { ML.lemma_distr_pow (sum2 * pow2 52 + t3 * pow2 104) k 156 52 }
(sum2 * pow2 52 + t3 * pow2 104) * pow2 52 + k * pow2 208;
(==) { ML.lemma_distr_pow_pow sum2 52 t3 104 52 }
sum2 * pow2 104 + t3 * pow2 156 + k * pow2 208;
};
calc (==) {
r0 + r1 * pow52 + r2 * pow104 + r3 * pow156 + r4 * pow208;
(==) { ML.lemma_as_nat_horner r0 r1 r2 r3 r4 }
(((r4 * pow2 52 + r3) * pow2 52 + r2) * pow2 52 + r1) * pow2 52 + r0;
(==) { lemma_nat_r4321 r1 r2 r3 r4 c6 c9 c11 d4 d10 d11 t3 r sum2 }
(c3 / pow2 52 + sum1 + d8 % pow2 52 * r + r * (d8 / pow2 52 + sum7) * pow2 52 + tmp1) * pow2 52 + c3 % pow2 52;
(==) { ML.lemma_distr_eucl_mul_add r d8 sum7 (pow2 52) }
(c3 / pow2 52 + sum1 + r * d8 + r * sum7 * pow2 52 + tmp1) * pow2 52 + c3 % pow2 52;
(==) { ML.lemma_distr_eucl c3 (sum1 + r * d8 + r * sum7 * pow2 52 + tmp1) }
c3 + (sum1 + r * d8 + r * sum7 * pow2 52 + tmp1) * pow2 52;
(==) { ML.lemma_distr_pow (sum1 + r * d8 + tmp1) (r * sum7) 52 52 }
c3 + (sum1 + r * d8 + tmp1) * pow2 52 + r * sum7 * pow2 104;
(==) { Math.Lemmas.distributivity_add_left (sum1 + r * d8) tmp1 (pow2 52) }
c3 + (sum1 + r * d8) * pow2 52 + sum2 * pow2 104 + t3 * pow2 156 + k * pow2 208 + r * sum7 * pow2 104;
(==) { Math.Lemmas.distributivity_add_left sum2 (r * sum7) (pow2 104) }
c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 + t3 * pow2 156 + k * pow2 208;
}
val simplify_c3 (d4 r sum5:nat) : Lemma
(requires r % pow2 4 = 0)
(ensures (let k = (d4 / pow2 52 + sum5) % pow2 52 in
((d4 % pow2 52) / pow2 48 + k * pow2 4) * (r / pow2 4) ==
(d4 / pow2 48) * (r / pow2 4) + (k - (d4 / pow2 52)) * r))
let simplify_c3 d4 r sum5 =
let k = (d4 / pow2 52 + sum5) % pow2 52 in
calc (==) { //simplify c3
((d4 % pow2 52) / pow2 48 + k * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.pow2_modulo_division_lemma_1 d4 48 52 }
((d4 / pow2 48) % pow2 4 + k * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.euclidean_division_definition (d4 / pow2 48) (pow2 4) }
(d4 / pow2 48 - (d4 / pow2 48 / pow2 4) * pow2 4 + k * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.division_multiplication_lemma d4 (pow2 48) (pow2 4); Math.Lemmas.pow2_plus 48 4 }
(d4 / pow2 48 - (d4 / pow2 52) * pow2 4 + k * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.distributivity_sub_left k (d4 / pow2 52) (pow2 4) }
(d4 / pow2 48 + (k - d4 / pow2 52) * pow2 4) * (r / pow2 4);
(==) { Math.Lemmas.distributivity_add_left (d4 / pow2 48) ((k - d4 / pow2 52) * pow2 4) (r / pow2 4) }
(d4 / pow2 48) * (r / pow2 4) + (k - d4 / pow2 52) * pow2 4 * (r / pow2 4);
(==) { Math.Lemmas.paren_mul_right (k - d4 / pow2 52) (pow2 4) (r / pow2 4); Math.Lemmas.div_exact_r r (pow2 4) }
(d4 / pow2 48) * (r / pow2 4) + (k - d4 / pow2 52) * r;
}
val lemma_nat_r43210_mod_prime (c3 d4 d8 t3 r sum0 sum1 sum2 sum3 sum4 sum5 sum6 sum7 sum8: nat) : Lemma
(requires
r = 0x1000003D10 /\
d4 = (sum3 + r * (sum8 % pow2 64)) / pow2 52 + sum4 + r * pow2 12 * (sum8 / pow2 64) /\
t3 = (sum3 + r * (sum8 % pow2 64)) % pow2 52 /\
d8 = (d4 / pow2 52 + sum5) / pow2 52 + sum6 /\
c3 = sum0 + ((d4 % pow2 52) / pow2 48 + ((d4 / pow2 52 + sum5) % pow2 52) * pow2 4) * (r / pow2 4))
(ensures
(c3 + (sum1 + r * d8) * pow2 52 + (sum2 + r * sum7) * pow2 104 +
t3 * pow2 156 + (d4 % pow2 48) * pow2 208) % S.prime ==
(sum0 + sum5 * r + (sum1 + sum6 * r) * pow2 52 + (sum2 + r * sum7) * pow2 104 +
(sum3 + r * sum8) * pow2 156 + sum4 * pow2 208) % S.prime) | {
"checked_file": "/",
"dependencies": [
"Spec.K256.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.K256.MathLemmas.fst.checked",
"Hacl.Spec.K256.Field52.Definitions.Lemmas.fst.checked",
"Hacl.Spec.K256.Field52.Definitions.fst.checked",
"Hacl.Spec.K256.Field52.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.K256.Field52.Lemmas4.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.Field52.Definitions.Lemmas",
"short_module": "LD"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.MathLemmas",
"short_module": "ML"
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.K256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.K256.Field52",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
c3: Prims.nat ->
d4: Prims.nat ->
d8: Prims.nat ->
t3: Prims.nat ->
r: Prims.nat ->
sum0: Prims.nat ->
sum1: Prims.nat ->
sum2: Prims.nat ->
sum3: Prims.nat ->
sum4: Prims.nat ->
sum5: Prims.nat ->
sum6: Prims.nat ->
sum7: Prims.nat ->
sum8: Prims.nat
-> FStar.Pervasives.Lemma
(requires
r = 0x1000003D10 /\
d4 =
(sum3 + r * (sum8 % Prims.pow2 64)) / Prims.pow2 52 + sum4 +
(r * Prims.pow2 12) * (sum8 / Prims.pow2 64) /\
t3 = (sum3 + r * (sum8 % Prims.pow2 64)) % Prims.pow2 52 /\
d8 = (d4 / Prims.pow2 52 + sum5) / Prims.pow2 52 + sum6 /\
c3 =
sum0 +
(d4 % Prims.pow2 52 / Prims.pow2 48 +
((d4 / Prims.pow2 52 + sum5) % Prims.pow2 52) * Prims.pow2 4) *
(r / Prims.pow2 4))
(ensures
(c3 + (sum1 + r * d8) * Prims.pow2 52 + (sum2 + r * sum7) * Prims.pow2 104 +
t3 * Prims.pow2 156 +
(d4 % Prims.pow2 48) * Prims.pow2 208) %
Spec.K256.PointOps.prime ==
(sum0 + sum5 * r + (sum1 + sum6 * r) * Prims.pow2 52 + (sum2 + r * sum7) * Prims.pow2 104 +
(sum3 + r * sum8) * Prims.pow2 156 +
sum4 * Prims.pow2 208) %
Spec.K256.PointOps.prime) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.nat",
"Hacl.Spec.K256.Field52.Definitions.Lemmas.as_nat_mod_prime",
"Prims.op_Addition",
"FStar.Mul.op_Star",
"Prims.unit",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Prims.op_Modulus",
"Prims.pow2",
"Prims.op_Division",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"FStar.Calc.calc_step",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"Hacl.Spec.K256.MathLemmas.lemma_distr_pow",
"Prims.squash",
"Hacl.Spec.K256.MathLemmas.lemma_distr_eucl_mul_add",
"Hacl.Spec.K256.MathLemmas.lemma_swap_mul3",
"Hacl.Spec.K256.MathLemmas.lemma_distr_eucl_mul",
"Prims.op_Subtraction",
"FStar.Pervasives.assert_norm",
"Prims.b2t",
"Prims.op_Equality",
"Hacl.Spec.K256.Field52.Lemmas4.simplify_c3",
"FStar.Math.Lemmas.distributivity_add_left",
"FStar.Math.Lemmas.distributivity_sub_left",
"FStar.Math.Lemmas.distributivity_add_right"
] | [] | false | false | true | false | false | let lemma_nat_r43210_mod_prime c3 d4 d8 t3 r sum0 sum1 sum2 sum3 sum4 sum5 sum6 sum7 sum8 =
| let tmp2 = sum3 + r * (sum8 % pow2 64) in
let tmp1 = d4 / pow2 52 + sum5 in
let tmp0 = sum0 + (tmp1 % pow2 52 - d4 / pow2 52) * r in
let d4mod = (d4 % pow2 48) * pow2 208 + (d4 / pow2 48) * 0x1000003D1 in
calc ( == ) {
c3 + (d4 % pow2 48) * pow2 208 + (sum1 + r * d8) * pow2 52;
( == ) { (simplify_c3 d4 r sum5;
assert_norm (0x1000003D10 / pow2 4 = 0x1000003D1)) }
d4mod + tmp0 + (sum1 + r * d8) * pow2 52;
( == ) { Math.Lemmas.distributivity_add_left sum1 (r * d8) (pow2 52) }
d4mod + sum0 + (tmp1 % pow2 52 - d4 / pow2 52) * r + sum1 * pow2 52 +
(r * (tmp1 / pow2 52 + sum6)) * pow2 52;
( == ) { Math.Lemmas.distributivity_sub_left (tmp1 % pow2 52) (d4 / pow2 52) r }
d4mod + sum0 + (tmp1 % pow2 52) * r - (d4 / pow2 52) * r + sum1 * pow2 52 +
(r * (tmp1 / pow2 52 + sum6)) * pow2 52;
( == ) { ML.lemma_distr_eucl_mul_add r tmp1 sum6 (pow2 52) }
d4mod + sum0 + r * (d4 / pow2 52 + sum5) - (d4 / pow2 52) * r + sum1 * pow2 52 +
(r * sum6) * pow2 52;
( == ) { Math.Lemmas.distributivity_add_right r (d4 / pow2 52) sum5 }
d4mod + sum0 + r * sum5 + sum1 * pow2 52 + (r * sum6) * pow2 52;
( == ) { Math.Lemmas.distributivity_add_left sum1 (r * sum6) (pow2 52) }
d4mod + sum0 + r * sum5 + (sum1 + r * sum6) * pow2 52;
};
calc ( == ) {
(tmp2 % pow2 52) * pow2 156 +
(tmp2 / pow2 52 + sum4 + (r * pow2 12) * (sum8 / pow2 64)) * pow2 208;
( == ) { ML.lemma_distr_pow (tmp2 % pow2 52)
(tmp2 / pow2 52 + sum4 + (r * pow2 12) * (sum8 / pow2 64))
52
156 }
(tmp2 % pow2 52 + (tmp2 / pow2 52 + sum4 + (r * pow2 12) * (sum8 / pow2 64)) * pow2 52) * pow2 156;
( == ) { ML.lemma_distr_eucl_mul_add 1 tmp2 (sum4 + (r * pow2 12) * (sum8 / pow2 64)) (pow2 52) }
(tmp2 + (sum4 + (r * pow2 12) * (sum8 / pow2 64)) * pow2 52) * pow2 156;
( == ) { ML.lemma_swap_mul3 r (pow2 12) (sum8 / pow2 64) }
(tmp2 + (sum4 + (r * (sum8 / pow2 64)) * pow2 12) * pow2 52) * pow2 156;
( == ) { ML.lemma_distr_pow sum4 (r * (sum8 / pow2 64)) 12 52 }
(sum3 + r * (sum8 % pow2 64) + sum4 * pow2 52 + (r * (sum8 / pow2 64)) * pow2 64) * pow2 156;
( == ) { ML.lemma_distr_eucl_mul r sum8 (pow2 64) }
(sum3 + r * sum8 + sum4 * pow2 52) * pow2 156;
( == ) { ML.lemma_distr_pow (sum3 + r * sum8) sum4 52 156 }
(sum3 + r * sum8) * pow2 156 + sum4 * pow2 208;
};
LD.as_nat_mod_prime (sum0 + r * sum5) (sum1 + r * sum6) (sum2 + r * sum7) t3 d4 | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.one_mod | val one_mod : BE.lone_st U64 4ul 0ul mk_to_p256_order_comm_monoid | val one_mod : BE.lone_st U64 4ul 0ul mk_to_p256_order_comm_monoid | let one_mod ctx one = make_qone one | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 35,
"end_line": 48,
"start_col": 0,
"start_line": 48
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
unfold
let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True
unfold
let linv (a:LSeq.lseq uint64 4) : Type0 =
BD.bn_v a < S.order
unfold
let refl (a:LSeq.lseq uint64 4{linv a}) : GTot S.qelem =
SM.from_qmont (BD.bn_v a)
inline_for_extraction noextract
let mk_to_p256_order_comm_monoid : BE.to_comm_monoid U64 4ul 0ul = {
BE.a_spec = S.qelem;
BE.comm_monoid = SI.nat_mod_comm_monoid;
BE.linv_ctx = linv_ctx;
BE.linv = linv;
BE.refl = refl;
}
inline_for_extraction noextract | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Hacl.Impl.Exponentiation.Definitions.lone_st Lib.IntTypes.U64
4ul
0ul
Hacl.Impl.P256.Qinv.mk_to_p256_order_comm_monoid | Prims.Tot | [
"total"
] | [] | [
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint_t",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.P256.Scalar.make_qone",
"Prims.unit"
] | [] | false | false | false | false | false | let one_mod ctx one =
| make_qone one | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.mk_to_p256_order_comm_monoid | val mk_to_p256_order_comm_monoid:BE.to_comm_monoid U64 4ul 0ul | val mk_to_p256_order_comm_monoid:BE.to_comm_monoid U64 4ul 0ul | let mk_to_p256_order_comm_monoid : BE.to_comm_monoid U64 4ul 0ul = {
BE.a_spec = S.qelem;
BE.comm_monoid = SI.nat_mod_comm_monoid;
BE.linv_ctx = linv_ctx;
BE.linv = linv;
BE.refl = refl;
} | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 1,
"end_line": 44,
"start_col": 0,
"start_line": 38
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
unfold
let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True
unfold
let linv (a:LSeq.lseq uint64 4) : Type0 =
BD.bn_v a < S.order
unfold
let refl (a:LSeq.lseq uint64 4{linv a}) : GTot S.qelem =
SM.from_qmont (BD.bn_v a) | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Hacl.Impl.Exponentiation.Definitions.to_comm_monoid Lib.IntTypes.U64
(4ul <: FStar.UInt32.t)
(0ul <: FStar.UInt32.t) | Prims.Tot | [
"total"
] | [] | [
"Hacl.Impl.Exponentiation.Definitions.Mkto_comm_monoid",
"Lib.IntTypes.U64",
"FStar.UInt32.uint_to_t",
"Spec.P256.PointOps.qelem",
"Hacl.Spec.P256.Qinv.nat_mod_comm_monoid",
"Hacl.Impl.P256.Qinv.linv_ctx",
"Hacl.Impl.P256.Qinv.linv",
"Hacl.Impl.P256.Qinv.refl"
] | [] | false | false | false | false | false | let mk_to_p256_order_comm_monoid:BE.to_comm_monoid U64 4ul 0ul =
| {
BE.a_spec = S.qelem;
BE.comm_monoid = SI.nat_mod_comm_monoid;
BE.linv_ctx = linv_ctx;
BE.linv = linv;
BE.refl = refl
} | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.linv | val linv (a: LSeq.lseq uint64 4) : Type0 | val linv (a: LSeq.lseq uint64 4) : Type0 | let linv (a:LSeq.lseq uint64 4) : Type0 =
BD.bn_v a < S.order | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 21,
"end_line": 30,
"start_col": 0,
"start_line": 29
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
unfold
let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Lib.Sequence.lseq Lib.IntTypes.uint64 4 -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Lib.Sequence.lseq",
"Lib.IntTypes.uint64",
"Prims.b2t",
"Prims.op_LessThan",
"Hacl.Spec.Bignum.Definitions.bn_v",
"Lib.IntTypes.U64",
"Spec.P256.PointOps.order"
] | [] | false | false | false | false | true | let linv (a: LSeq.lseq uint64 4) : Type0 =
| BD.bn_v a < S.order | false |
MerkleTree.New.High.Correct.Path.fst | MerkleTree.New.High.Correct.Path.mt_get_path_inv_ok_ | val mt_get_path_inv_ok_:
#hsz:pos -> #f:MTS.hash_fun_t ->
lv:nat{lv < 32} ->
i:nat ->
j:nat{j > 0 /\ i <= j /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv i olds} ->
hs:hashess #hsz {S.length hs = 32 /\ hs_wf_elts lv hs i j} ->
rhs:hashes #hsz {S.length rhs = 32} ->
k:nat{i <= k && k <= j} ->
p:path #hsz ->
acc:hash -> actd:bool ->
Lemma (requires (log2c_div j; log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
(mt_hashes_inv #_ #f lv j (merge_hs #_ #f olds hs) /\
(let t1 = hash_seq_spec_full #_ #f (S.index (merge_hs #_ #f olds hs) lv) acc actd in
let t2 = S.slice rhs lv (lv + log2c j) in
mt_rhs_inv #_ #f j t1 t2 actd))))
(ensures (S.equal (path_spec k j actd
(S.slice (mt_get_path_ lv hs rhs i j k p actd)
(S.length p) (S.length p + mt_path_length k j actd)))
(MTS.mt_get_path #_ #f #(log2c j)
(hash_seq_spec_full #_ #f
(S.index (merge_hs #_ #f olds hs) lv) acc actd) k))) | val mt_get_path_inv_ok_:
#hsz:pos -> #f:MTS.hash_fun_t ->
lv:nat{lv < 32} ->
i:nat ->
j:nat{j > 0 /\ i <= j /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv i olds} ->
hs:hashess #hsz {S.length hs = 32 /\ hs_wf_elts lv hs i j} ->
rhs:hashes #hsz {S.length rhs = 32} ->
k:nat{i <= k && k <= j} ->
p:path #hsz ->
acc:hash -> actd:bool ->
Lemma (requires (log2c_div j; log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
(mt_hashes_inv #_ #f lv j (merge_hs #_ #f olds hs) /\
(let t1 = hash_seq_spec_full #_ #f (S.index (merge_hs #_ #f olds hs) lv) acc actd in
let t2 = S.slice rhs lv (lv + log2c j) in
mt_rhs_inv #_ #f j t1 t2 actd))))
(ensures (S.equal (path_spec k j actd
(S.slice (mt_get_path_ lv hs rhs i j k p actd)
(S.length p) (S.length p + mt_path_length k j actd)))
(MTS.mt_get_path #_ #f #(log2c j)
(hash_seq_spec_full #_ #f
(S.index (merge_hs #_ #f olds hs) lv) acc actd) k))) | let mt_get_path_inv_ok_ #_ #f lv i j olds hs rhs k p acc actd =
log2c_div j; log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
mt_hashes_lth_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
mt_hashes_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
mt_get_path_acc_consistent #_ #f lv i j olds hs rhs k actd;
mt_get_path_slice lv hs rhs i j k p actd;
mt_get_path_acc_inv_ok #_ #f j
(S.slice (merge_hs #_ #f olds hs) lv (lv + log2c j))
(S.slice rhs lv (lv + log2c j))
k acc actd | {
"file_name": "src/MerkleTree.New.High.Correct.Path.fst",
"git_rev": "7d7bdc20f2033171e279c176b26e84f9069d23c6",
"git_url": "https://github.com/hacl-star/merkle-tree.git",
"project_name": "merkle-tree"
} | {
"end_col": 14,
"end_line": 275,
"start_col": 0,
"start_line": 264
} | module MerkleTree.New.High.Correct.Path
open EverCrypt
open EverCrypt.Helpers
open MerkleTree.New.High.Correct.Base
// Need to use some facts of `mt_get_root`
open MerkleTree.New.High.Correct.Rhs
open FStar.Classical
open FStar.Ghost
open FStar.Seq
module List = FStar.List.Tot
module S = FStar.Seq
module U32 = FStar.UInt32
module U8 = FStar.UInt8
type uint32_t = U32.t
type uint8_t = U8.t
module EHS = EverCrypt.Hash
module MTS = MerkleTree.Spec
open MerkleTree.New.High
#reset-options "--z3rlimit 20"
/// Correctness of path generation
val path_spec:
#hsz:pos ->
k:nat ->
j:nat{k <= j} ->
actd:bool ->
p:path #hsz {S.length p = mt_path_length k j actd} ->
GTot (sp:S.seq (MTS.padded_hash #hsz){S.length sp = log2c j})
(decreases j)
let rec path_spec #hsz k j actd p =
if j = 0 then S.empty
else (if k % 2 = 0
then (if j = k || (j = k + 1 && not actd)
then S.cons MTS.HPad (path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) p)
else S.cons (MTS.HRaw #hsz (S.head p))
(path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) (S.tail p)))
else S.cons (MTS.HRaw #hsz (S.head p))
(path_spec (k / 2) (j / 2) (actd || (j % 2 = 1)) (S.tail p)))
val mt_get_path_step_acc:
#hsz:pos ->
j:nat{j > 0} ->
chs:hashes #hsz {S.length chs = j} ->
crh:hash #hsz ->
k:nat{k <= j} ->
actd:bool ->
GTot (option (hash #hsz))
let mt_get_path_step_acc #hsz j chs crh k actd =
if k % 2 = 1
then Some (S.index chs (k - 1))
else (if k = j then None
else if k + 1 = j
then (if actd then Some crh else None)
else Some (S.index chs (k + 1)))
val mt_get_path_acc:
#hsz:pos -> #f:MTS.hash_fun_t #hsz ->
j:nat ->
fhs:hashess #hsz {S.length fhs = log2c j /\ mt_hashes_lth_inv_log #hsz j fhs} ->
rhs:hashes #hsz {S.length rhs = log2c j} ->
k:nat{k <= j} ->
actd:bool ->
GTot (np:path #hsz {S.length np = mt_path_length k j actd})
(decreases j)
let rec mt_get_path_acc #_ #f j fhs rhs k actd =
if j = 0 then S.empty
else
(let sp = mt_get_path_step_acc #_ j (S.head fhs) (S.head rhs) k actd in
let rp = mt_get_path_acc #_ #f (j / 2) (S.tail fhs) (S.tail rhs) (k / 2)
(actd || j % 2 = 1) in
if Some? sp
then (S.cons (Some?.v sp) rp)
else rp)
val mt_get_path_step_acc_consistent:
#hsz:pos -> #f:MTS.hash_fun_t ->
lv:nat{lv <= 32} ->
i:nat ->
j:nat{i <= j /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv i olds} ->
hs:hashess #hsz {S.length hs = 32 /\ hs_wf_elts lv hs i j} ->
rhs:hashes #hsz {S.length rhs = 32} ->
k:nat{i <= k && k <= j} ->
actd:bool ->
Lemma (requires (j <> 0))
(ensures
(log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
mt_hashes_lth_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
(match mt_get_path_step_acc j
(S.index (merge_hs #_ #f olds hs) lv) (S.index rhs lv)
k actd with
| Some v ->
S.equal (mt_make_path_step lv hs rhs i j k S.empty actd)
(S.cons v S.empty)
| None ->
S.equal (mt_make_path_step lv hs rhs i j k S.empty actd)
S.empty)))
let mt_get_path_step_acc_consistent #_ #_ lv i j olds hs rhs k actd = ()
private val seq_cons_append:
#a:Type -> hd:a -> tl:S.seq a ->
Lemma (S.equal (S.append (S.cons hd S.empty) tl)
(S.cons hd tl))
private let seq_cons_append #a hd tl = ()
val mt_get_path_acc_consistent:
#hsz:pos -> #f:MTS.hash_fun_t ->
lv:nat{lv <= 32} ->
i:nat ->
j:nat{i <= j /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv i olds} ->
hs:hashess #hsz {S.length hs = 32 /\ hs_wf_elts lv hs i j} ->
rhs:hashes #hsz {S.length rhs = 32} ->
k:nat{i <= k && k <= j} ->
actd:bool ->
Lemma (requires True)
(ensures
(log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
mt_hashes_lth_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
S.equal (mt_get_path_acc #_ #f j
(S.slice (merge_hs #_ #f olds hs) lv (lv + log2c j))
(S.slice rhs lv (lv + log2c j)) k actd)
(mt_get_path_ #_ lv hs rhs i j k S.empty actd)))
(decreases j)
#push-options "--z3rlimit 1000 --max_fuel 1 --max_ifuel 0"
let rec mt_get_path_acc_consistent #hsz #f lv i j olds hs rhs k actd =
log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
mt_hashes_lth_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
if j = 0 then ()
else begin
let nactd = if j % 2 = 0 then actd else true in
let nactd_ = actd || j % 2 = 1 in
assert (nactd == nactd_);
let pa = mt_get_path_acc #_ #f j
(S.slice (merge_hs #_ #f olds hs) lv (lv + log2c j))
(S.slice rhs lv (lv + log2c j)) k actd in
let p = mt_get_path_ lv hs rhs i j k S.empty actd in
log2c_div j; log2c_bound (j / 2) (32 - (lv + 1));
assert (mt_hashes_lth_inv (lv + 1) (j / 2) (merge_hs #_ #f olds hs));
assert (mt_hashes_lth_inv_log #hsz (j / 2)
(S.slice (merge_hs #_ #f olds hs) (lv + 1) (lv + 1 + log2c (j / 2))));
let npsa = mt_get_path_step_acc j
(S.index (merge_hs #_ #f olds hs) lv) (S.index rhs lv) k actd in
let npa = mt_get_path_acc #_ #f (j / 2)
(S.slice (merge_hs #_ #f olds hs) (lv + 1) (lv + 1 + log2c (j / 2)))
(S.slice rhs (lv + 1) (lv + 1 + log2c (j / 2))) (k / 2) nactd_ in
let nps = mt_make_path_step lv hs rhs i j k S.empty actd in
let np = mt_get_path_ (lv + 1) hs rhs (i / 2) (j / 2) (k / 2) nps nactd in
let npe = mt_get_path_ (lv + 1) hs rhs (i / 2) (j / 2) (k / 2) S.empty nactd in
mt_get_path_pull (lv + 1) hs rhs (i / 2) (j / 2) (k / 2) nps nactd;
assert (S.equal p np);
assert (S.equal np (S.append nps npe));
assert (S.equal p (S.append nps npe));
assert (S.equal pa (if Some? npsa
then S.cons (Some?.v npsa) npa
else npa));
mt_get_path_acc_consistent #_ #f (lv + 1) (i / 2) (j / 2)
olds hs rhs (k / 2) nactd;
assert (S.equal npa npe);
mt_get_path_step_acc_consistent #_ #f lv i j olds hs rhs k actd;
if Some? npsa
then begin
assert (S.equal nps (S.cons (Some?.v npsa) S.empty));
assert (S.equal p (S.append (S.cons (Some?.v npsa) S.empty) npa));
assert (S.equal pa (S.cons (Some?.v npsa) npa));
seq_cons_append (Some?.v npsa) npa;
assert (S.equal pa p)
end
else begin
assert (S.equal nps S.empty);
S.append_empty_l npe;
assert (S.equal p npe);
assert (S.equal pa npa);
assert (S.equal pa p)
end
end
#pop-options
val mt_get_path_acc_inv_ok:
#hsz:pos -> #f:MTS.hash_fun_t ->
j:nat ->
fhs:hashess #hsz {S.length fhs = log2c j} ->
rhs:hashes #hsz {S.length rhs = log2c j} ->
k:nat{k <= j} ->
acc:hash -> actd:bool ->
Lemma (requires (j > 0 /\
mt_hashes_lth_inv_log #hsz j fhs /\
mt_hashes_inv_log #_ #f j fhs /\
mt_rhs_inv #_ #f j (hash_seq_spec_full #_ #f (S.head fhs) acc actd) rhs actd))
(ensures (S.equal (path_spec k j actd (mt_get_path_acc #_ #f j fhs rhs k actd))
(MTS.mt_get_path #_ #f #(log2c j)
(hash_seq_spec_full #_ #f (S.head fhs) acc actd) k)))
(decreases j)
#push-options "--z3rlimit 120 --max_fuel 1"
let rec mt_get_path_acc_inv_ok #_ #f j fhs rhs k acc actd =
// Below dummy `let` is necessary to provide guidance to the SMT solver.
let _ = mt_get_path_step_acc j (S.head fhs) (S.head rhs) k actd in
let smt = hash_seq_spec_full #_ #f (S.head fhs) acc actd in
let nacc = (if j % 2 = 0 then acc
else if actd
then f (S.last (S.head fhs)) acc
else S.last (S.head fhs)) in
let nactd = actd || j % 2 = 1 in
if j = 1 then (if k = 0 then () else ())
else begin
mt_hashes_lth_inv_log_next #_ #f j fhs;
hash_seq_spec_full_next #_ #f j (S.head fhs) (S.head (S.tail fhs)) acc actd nacc nactd;
mt_get_path_acc_inv_ok #_ #f (j / 2) (S.tail fhs) (S.tail rhs) (k / 2) nacc nactd;
if k % 2 = 0
then begin
if k = j || (k + 1 = j && not actd)
then assert (S.index smt (k + 1) == MTS.HPad)
else if k + 1 = j
then assert (S.index smt (k + 1) == MTS.HRaw (S.head rhs))
else hash_seq_spec_full_index_raw #_ #f (S.head fhs) acc actd (k + 1)
end
else begin
hash_seq_spec_full_index_raw #_ #f (S.head fhs) acc actd (k - 1)
end
end
#pop-options
#push-options "--max_fuel 1 --initial_fuel 1 --max_ifuel 0 --z3rlimit 60"
val mt_get_path_inv_ok_:
#hsz:pos -> #f:MTS.hash_fun_t ->
lv:nat{lv < 32} ->
i:nat ->
j:nat{j > 0 /\ i <= j /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv i olds} ->
hs:hashess #hsz {S.length hs = 32 /\ hs_wf_elts lv hs i j} ->
rhs:hashes #hsz {S.length rhs = 32} ->
k:nat{i <= k && k <= j} ->
p:path #hsz ->
acc:hash -> actd:bool ->
Lemma (requires (log2c_div j; log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
(mt_hashes_inv #_ #f lv j (merge_hs #_ #f olds hs) /\
(let t1 = hash_seq_spec_full #_ #f (S.index (merge_hs #_ #f olds hs) lv) acc actd in
let t2 = S.slice rhs lv (lv + log2c j) in
mt_rhs_inv #_ #f j t1 t2 actd))))
(ensures (S.equal (path_spec k j actd
(S.slice (mt_get_path_ lv hs rhs i j k p actd)
(S.length p) (S.length p + mt_path_length k j actd)))
(MTS.mt_get_path #_ #f #(log2c j)
(hash_seq_spec_full #_ #f | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"MerkleTree.Spec.fst.checked",
"MerkleTree.New.High.Correct.Rhs.fst.checked",
"MerkleTree.New.High.Correct.Base.fst.checked",
"MerkleTree.New.High.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"EverCrypt.Helpers.fsti.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": false,
"source_file": "MerkleTree.New.High.Correct.Path.fst"
} | [
{
"abbrev": false,
"full_module": "MerkleTree.New.High",
"short_module": null
},
{
"abbrev": true,
"full_module": "MerkleTree.Spec",
"short_module": "MTS"
},
{
"abbrev": true,
"full_module": "EverCrypt.Hash",
"short_module": "EHS"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "List"
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Classical",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct.Rhs",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt.Helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 1,
"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": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
lv: Prims.nat{lv < 32} ->
i: Prims.nat ->
j: Prims.nat{j > 0 /\ i <= j /\ j < Prims.pow2 (32 - lv)} ->
olds:
MerkleTree.New.High.hashess
{FStar.Seq.Base.length olds = 32 /\ MerkleTree.New.High.Correct.Base.mt_olds_inv lv i olds} ->
hs:
MerkleTree.New.High.hashess
{FStar.Seq.Base.length hs = 32 /\ MerkleTree.New.High.hs_wf_elts lv hs i j} ->
rhs: MerkleTree.New.High.hashes{FStar.Seq.Base.length rhs = 32} ->
k: Prims.nat{i <= k && k <= j} ->
p: MerkleTree.New.High.path ->
acc: MerkleTree.New.High.hash ->
actd: Prims.bool
-> FStar.Pervasives.Lemma
(requires
(MerkleTree.New.High.Correct.Base.log2c_div j;
MerkleTree.New.High.Correct.Base.log2c_bound j (32 - lv);
MerkleTree.New.High.Correct.Base.mt_olds_hs_lth_inv_ok lv i j olds hs;
MerkleTree.New.High.Correct.Base.mt_hashes_inv lv
j
(MerkleTree.New.High.Correct.Base.merge_hs olds hs) /\
(let t1 =
MerkleTree.New.High.Correct.Base.hash_seq_spec_full (FStar.Seq.Base.index (MerkleTree.New.High.Correct.Base.merge_hs
olds
hs)
lv)
acc
actd
in
let t2 = FStar.Seq.Base.slice rhs lv (lv + MerkleTree.New.High.Correct.Base.log2c j) in
MerkleTree.New.High.Correct.Base.mt_rhs_inv j t1 t2 actd)))
(ensures
FStar.Seq.Base.equal (MerkleTree.New.High.Correct.Path.path_spec k
j
actd
(FStar.Seq.Base.slice (MerkleTree.New.High.mt_get_path_ lv hs rhs i j k p actd)
(FStar.Seq.Base.length p)
(FStar.Seq.Base.length p + MerkleTree.New.High.mt_path_length k j actd)))
(MerkleTree.Spec.mt_get_path (MerkleTree.New.High.Correct.Base.hash_seq_spec_full (FStar.Seq.Base.index
(MerkleTree.New.High.Correct.Base.merge_hs olds hs)
lv)
acc
actd)
k)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.pos",
"MerkleTree.Spec.hash_fun_t",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.l_and",
"Prims.op_GreaterThan",
"Prims.op_LessThanOrEqual",
"Prims.pow2",
"Prims.op_Subtraction",
"MerkleTree.New.High.hashess",
"Prims.op_Equality",
"Prims.int",
"FStar.Seq.Base.length",
"MerkleTree.New.High.hashes",
"MerkleTree.New.High.Correct.Base.mt_olds_inv",
"MerkleTree.New.High.hs_wf_elts",
"MerkleTree.New.High.hash",
"Prims.op_AmpAmp",
"MerkleTree.New.High.path",
"Prims.bool",
"MerkleTree.New.High.Correct.Path.mt_get_path_acc_inv_ok",
"FStar.Seq.Base.slice",
"MerkleTree.New.High.Correct.Base.merge_hs",
"Prims.op_Addition",
"MerkleTree.New.High.Correct.Base.log2c",
"Prims.unit",
"MerkleTree.New.High.mt_get_path_slice",
"MerkleTree.New.High.Correct.Path.mt_get_path_acc_consistent",
"MerkleTree.New.High.Correct.Base.mt_hashes_inv_log_converted_",
"MerkleTree.New.High.Correct.Base.mt_hashes_lth_inv_log_converted_",
"MerkleTree.New.High.Correct.Base.mt_olds_hs_lth_inv_ok",
"MerkleTree.New.High.Correct.Base.log2c_bound",
"MerkleTree.New.High.Correct.Base.log2c_div"
] | [] | true | false | true | false | false | let mt_get_path_inv_ok_ #_ #f lv i j olds hs rhs k p acc actd =
| log2c_div j;
log2c_bound j (32 - lv);
mt_olds_hs_lth_inv_ok #_ #f lv i j olds hs;
mt_hashes_lth_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
mt_hashes_inv_log_converted_ #_ #f lv j (merge_hs #_ #f olds hs);
mt_get_path_acc_consistent #_ #f lv i j olds hs rhs k actd;
mt_get_path_slice lv hs rhs i j k p actd;
mt_get_path_acc_inv_ok #_
#f
j
(S.slice (merge_hs #_ #f olds hs) lv (lv + log2c j))
(S.slice rhs lv (lv + log2c j))
k
acc
actd | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.sqr_mod | val sqr_mod : BE.lsqr_st U64 4ul 0ul mk_to_p256_order_comm_monoid | val sqr_mod : BE.lsqr_st U64 4ul 0ul mk_to_p256_order_comm_monoid | let sqr_mod ctx x xx = qsqr xx x | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 32,
"end_line": 58,
"start_col": 0,
"start_line": 58
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
unfold
let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True
unfold
let linv (a:LSeq.lseq uint64 4) : Type0 =
BD.bn_v a < S.order
unfold
let refl (a:LSeq.lseq uint64 4{linv a}) : GTot S.qelem =
SM.from_qmont (BD.bn_v a)
inline_for_extraction noextract
let mk_to_p256_order_comm_monoid : BE.to_comm_monoid U64 4ul 0ul = {
BE.a_spec = S.qelem;
BE.comm_monoid = SI.nat_mod_comm_monoid;
BE.linv_ctx = linv_ctx;
BE.linv = linv;
BE.refl = refl;
}
inline_for_extraction noextract
val one_mod : BE.lone_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let one_mod ctx one = make_qone one
inline_for_extraction noextract
val mul_mod : BE.lmul_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let mul_mod ctx x y xy = qmul xy x y
inline_for_extraction noextract | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Hacl.Impl.Exponentiation.Definitions.lsqr_st Lib.IntTypes.U64
4ul
0ul
Hacl.Impl.P256.Qinv.mk_to_p256_order_comm_monoid | Prims.Tot | [
"total"
] | [] | [
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint_t",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.P256.Scalar.qsqr",
"Prims.unit"
] | [] | false | false | false | false | false | let sqr_mod ctx x xx =
| qsqr xx x | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.qsquare_times_in_place | val qsquare_times_in_place (out:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ as_nat h out < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 out) (v b)) | val qsquare_times_in_place (out:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ as_nat h out < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 out) (v b)) | let qsquare_times_in_place out b =
let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 out) (v b);
BE.lexp_pow2_in_place 4ul 0ul mk_p256_order_concrete_ops (null uint64) out b | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 78,
"end_line": 81,
"start_col": 0,
"start_line": 78
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
unfold
let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True
unfold
let linv (a:LSeq.lseq uint64 4) : Type0 =
BD.bn_v a < S.order
unfold
let refl (a:LSeq.lseq uint64 4{linv a}) : GTot S.qelem =
SM.from_qmont (BD.bn_v a)
inline_for_extraction noextract
let mk_to_p256_order_comm_monoid : BE.to_comm_monoid U64 4ul 0ul = {
BE.a_spec = S.qelem;
BE.comm_monoid = SI.nat_mod_comm_monoid;
BE.linv_ctx = linv_ctx;
BE.linv = linv;
BE.refl = refl;
}
inline_for_extraction noextract
val one_mod : BE.lone_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let one_mod ctx one = make_qone one
inline_for_extraction noextract
val mul_mod : BE.lmul_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let mul_mod ctx x y xy = qmul xy x y
inline_for_extraction noextract
val sqr_mod : BE.lsqr_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let sqr_mod ctx x xx = qsqr xx x
inline_for_extraction noextract
let mk_p256_order_concrete_ops : BE.concrete_ops U64 4ul 0ul = {
BE.to = mk_to_p256_order_comm_monoid;
BE.lone = one_mod;
BE.lmul = mul_mod;
BE.lsqr = sqr_mod;
}
inline_for_extraction noextract
val qsquare_times_in_place (out:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ as_nat h out < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 out) (v b)) | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | out: Hacl.Impl.P256.Bignum.felem -> b: Lib.IntTypes.size_t -> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.P256.Bignum.felem",
"Lib.IntTypes.size_t",
"Hacl.Impl.Exponentiation.lexp_pow2_in_place",
"Lib.IntTypes.U64",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.P256.Qinv.mk_p256_order_concrete_ops",
"Lib.Buffer.null",
"Lib.Buffer.MUT",
"Lib.IntTypes.uint64",
"Prims.unit",
"Spec.Exponentiation.exp_pow2_lemma",
"Spec.P256.PointOps.qelem",
"Hacl.Spec.P256.Qinv.mk_nat_mod_concrete_ops",
"Hacl.Impl.P256.Scalar.qmont_as_nat",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get"
] | [] | false | true | false | false | false | let qsquare_times_in_place out b =
| let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 out) (v b);
BE.lexp_pow2_in_place 4ul 0ul mk_p256_order_concrete_ops (null uint64) out b | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.mul_mod | val mul_mod : BE.lmul_st U64 4ul 0ul mk_to_p256_order_comm_monoid | val mul_mod : BE.lmul_st U64 4ul 0ul mk_to_p256_order_comm_monoid | let mul_mod ctx x y xy = qmul xy x y | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 36,
"end_line": 53,
"start_col": 0,
"start_line": 53
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
unfold
let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True
unfold
let linv (a:LSeq.lseq uint64 4) : Type0 =
BD.bn_v a < S.order
unfold
let refl (a:LSeq.lseq uint64 4{linv a}) : GTot S.qelem =
SM.from_qmont (BD.bn_v a)
inline_for_extraction noextract
let mk_to_p256_order_comm_monoid : BE.to_comm_monoid U64 4ul 0ul = {
BE.a_spec = S.qelem;
BE.comm_monoid = SI.nat_mod_comm_monoid;
BE.linv_ctx = linv_ctx;
BE.linv = linv;
BE.refl = refl;
}
inline_for_extraction noextract
val one_mod : BE.lone_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let one_mod ctx one = make_qone one
inline_for_extraction noextract | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Hacl.Impl.Exponentiation.Definitions.lmul_st Lib.IntTypes.U64
4ul
0ul
Hacl.Impl.P256.Qinv.mk_to_p256_order_comm_monoid | Prims.Tot | [
"total"
] | [] | [
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint_t",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.P256.Scalar.qmul",
"Prims.unit"
] | [] | false | false | false | false | false | let mul_mod ctx x y xy =
| qmul xy x y | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.mk_p256_order_concrete_ops | val mk_p256_order_concrete_ops:BE.concrete_ops U64 4ul 0ul | val mk_p256_order_concrete_ops:BE.concrete_ops U64 4ul 0ul | let mk_p256_order_concrete_ops : BE.concrete_ops U64 4ul 0ul = {
BE.to = mk_to_p256_order_comm_monoid;
BE.lone = one_mod;
BE.lmul = mul_mod;
BE.lsqr = sqr_mod;
} | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 1,
"end_line": 67,
"start_col": 0,
"start_line": 62
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
unfold
let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True
unfold
let linv (a:LSeq.lseq uint64 4) : Type0 =
BD.bn_v a < S.order
unfold
let refl (a:LSeq.lseq uint64 4{linv a}) : GTot S.qelem =
SM.from_qmont (BD.bn_v a)
inline_for_extraction noextract
let mk_to_p256_order_comm_monoid : BE.to_comm_monoid U64 4ul 0ul = {
BE.a_spec = S.qelem;
BE.comm_monoid = SI.nat_mod_comm_monoid;
BE.linv_ctx = linv_ctx;
BE.linv = linv;
BE.refl = refl;
}
inline_for_extraction noextract
val one_mod : BE.lone_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let one_mod ctx one = make_qone one
inline_for_extraction noextract
val mul_mod : BE.lmul_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let mul_mod ctx x y xy = qmul xy x y
inline_for_extraction noextract
val sqr_mod : BE.lsqr_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let sqr_mod ctx x xx = qsqr xx x | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Hacl.Impl.Exponentiation.Definitions.concrete_ops Lib.IntTypes.U64
(4ul <: FStar.UInt32.t)
(0ul <: FStar.UInt32.t) | Prims.Tot | [
"total"
] | [] | [
"Hacl.Impl.Exponentiation.Definitions.Mkconcrete_ops",
"Lib.IntTypes.U64",
"FStar.UInt32.uint_to_t",
"FStar.Ghost.hide",
"Hacl.Impl.Exponentiation.Definitions.to_comm_monoid",
"Hacl.Impl.P256.Qinv.mk_to_p256_order_comm_monoid",
"Hacl.Impl.P256.Qinv.one_mod",
"Hacl.Impl.P256.Qinv.mul_mod",
"Hacl.Impl.P256.Qinv.sqr_mod"
] | [] | false | false | false | false | false | let mk_p256_order_concrete_ops:BE.concrete_ops U64 4ul 0ul =
| { BE.to = mk_to_p256_order_comm_monoid; BE.lone = one_mod; BE.lmul = mul_mod; BE.lsqr = sqr_mod } | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.refl | val refl (a: LSeq.lseq uint64 4 {linv a}) : GTot S.qelem | val refl (a: LSeq.lseq uint64 4 {linv a}) : GTot S.qelem | let refl (a:LSeq.lseq uint64 4{linv a}) : GTot S.qelem =
SM.from_qmont (BD.bn_v a) | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 27,
"end_line": 34,
"start_col": 0,
"start_line": 33
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
unfold
let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True
unfold
let linv (a:LSeq.lseq uint64 4) : Type0 =
BD.bn_v a < S.order | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Lib.Sequence.lseq Lib.IntTypes.uint64 4 {Hacl.Impl.P256.Qinv.linv a}
-> Prims.GTot Spec.P256.PointOps.qelem | Prims.GTot | [
"sometrivial"
] | [] | [
"Lib.Sequence.lseq",
"Lib.IntTypes.uint64",
"Hacl.Impl.P256.Qinv.linv",
"Hacl.Spec.P256.Montgomery.from_qmont",
"Hacl.Spec.Bignum.Definitions.bn_v",
"Lib.IntTypes.U64",
"Spec.P256.PointOps.qelem"
] | [] | false | false | false | false | false | let refl (a: LSeq.lseq uint64 4 {linv a}) : GTot S.qelem =
| SM.from_qmont (BD.bn_v a) | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.qsquare_times | val qsquare_times (out a:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ live h a /\ disjoint out a /\
as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 a) (v b)) | val qsquare_times (out a:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ live h a /\ disjoint out a /\
as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 a) (v b)) | let qsquare_times out a b =
let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 a) (v b);
BE.lexp_pow2 4ul 0ul mk_p256_order_concrete_ops (null uint64) a b out | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 71,
"end_line": 96,
"start_col": 0,
"start_line": 93
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
unfold
let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True
unfold
let linv (a:LSeq.lseq uint64 4) : Type0 =
BD.bn_v a < S.order
unfold
let refl (a:LSeq.lseq uint64 4{linv a}) : GTot S.qelem =
SM.from_qmont (BD.bn_v a)
inline_for_extraction noextract
let mk_to_p256_order_comm_monoid : BE.to_comm_monoid U64 4ul 0ul = {
BE.a_spec = S.qelem;
BE.comm_monoid = SI.nat_mod_comm_monoid;
BE.linv_ctx = linv_ctx;
BE.linv = linv;
BE.refl = refl;
}
inline_for_extraction noextract
val one_mod : BE.lone_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let one_mod ctx one = make_qone one
inline_for_extraction noextract
val mul_mod : BE.lmul_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let mul_mod ctx x y xy = qmul xy x y
inline_for_extraction noextract
val sqr_mod : BE.lsqr_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let sqr_mod ctx x xx = qsqr xx x
inline_for_extraction noextract
let mk_p256_order_concrete_ops : BE.concrete_ops U64 4ul 0ul = {
BE.to = mk_to_p256_order_comm_monoid;
BE.lone = one_mod;
BE.lmul = mul_mod;
BE.lsqr = sqr_mod;
}
inline_for_extraction noextract
val qsquare_times_in_place (out:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ as_nat h out < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 out) (v b))
let qsquare_times_in_place out b =
let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 out) (v b);
BE.lexp_pow2_in_place 4ul 0ul mk_p256_order_concrete_ops (null uint64) out b
inline_for_extraction noextract
val qsquare_times (out a:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ live h a /\ disjoint out a /\
as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 a) (v b)) | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | out: Hacl.Impl.P256.Bignum.felem -> a: Hacl.Impl.P256.Bignum.felem -> b: Lib.IntTypes.size_t
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.P256.Bignum.felem",
"Lib.IntTypes.size_t",
"Hacl.Impl.Exponentiation.lexp_pow2",
"Lib.IntTypes.U64",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.P256.Qinv.mk_p256_order_concrete_ops",
"Lib.Buffer.null",
"Lib.Buffer.MUT",
"Lib.IntTypes.uint64",
"Prims.unit",
"Spec.Exponentiation.exp_pow2_lemma",
"Spec.P256.PointOps.qelem",
"Hacl.Spec.P256.Qinv.mk_nat_mod_concrete_ops",
"Hacl.Impl.P256.Scalar.qmont_as_nat",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get"
] | [] | false | true | false | false | false | let qsquare_times out a b =
| let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 a) (v b);
BE.lexp_pow2 4ul 0ul mk_p256_order_concrete_ops (null uint64) a b out | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.qinv_x153_x177 | val qinv_x153_x177 (x153 x_101 x_111 x_101111:felem) : Stack unit
(requires fun h ->
live h x153 /\ live h x_101 /\ live h x_111 /\ live h x_101111 /\
disjoint x153 x_101 /\ disjoint x153 x_111 /\ disjoint x153 x_101111 /\
as_nat h x153 < S.order /\ as_nat h x_101 < S.order /\
as_nat h x_111 < S.order /\ as_nat h x_101111 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x153) h0 h1 /\
as_nat h1 x153 < S.order /\
qmont_as_nat h1 x153 = SI.qinv_x153_x177 (qmont_as_nat h0 x153)
(qmont_as_nat h0 x_101) (qmont_as_nat h0 x_111) (qmont_as_nat h0 x_101111)) | val qinv_x153_x177 (x153 x_101 x_111 x_101111:felem) : Stack unit
(requires fun h ->
live h x153 /\ live h x_101 /\ live h x_111 /\ live h x_101111 /\
disjoint x153 x_101 /\ disjoint x153 x_111 /\ disjoint x153 x_101111 /\
as_nat h x153 < S.order /\ as_nat h x_101 < S.order /\
as_nat h x_111 < S.order /\ as_nat h x_101111 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x153) h0 h1 /\
as_nat h1 x153 < S.order /\
qmont_as_nat h1 x153 = SI.qinv_x153_x177 (qmont_as_nat h0 x153)
(qmont_as_nat h0 x_101) (qmont_as_nat h0 x_111) (qmont_as_nat h0 x_101111)) | let qinv_x153_x177 x153 x_101 x_111 x_101111 =
let h0 = ST.get () in
qsquare_times_in_place x153 4ul;
qmul x153 x153 x_101;
let h1 = ST.get () in
assert (qmont_as_nat h1 x153 == // x157
S.qmul (SI.qsquare_times (qmont_as_nat h0 x153) 4) (qmont_as_nat h0 x_101));
qsquare_times_in_place x153 3ul;
qmul x153 x153 x_101;
let h2 = ST.get () in
assert (qmont_as_nat h2 x153 == // x160
S.qmul (SI.qsquare_times (qmont_as_nat h1 x153) 3) (qmont_as_nat h0 x_101));
qsquare_times_in_place x153 3ul;
qmul x153 x153 x_101;
let h3 = ST.get () in
assert (qmont_as_nat h3 x153 == // x163
S.qmul (SI.qsquare_times (qmont_as_nat h2 x153) 3) (qmont_as_nat h0 x_101));
qsquare_times_in_place x153 5ul;
qmul x153 x153 x_111;
let h4 = ST.get () in
assert (qmont_as_nat h4 x153 == // x168
S.qmul (SI.qsquare_times (qmont_as_nat h3 x153) 5) (qmont_as_nat h0 x_111));
qsquare_times_in_place x153 9ul;
qmul x153 x153 x_101111;
let h5 = ST.get () in
assert (qmont_as_nat h5 x153 == // x177
S.qmul (SI.qsquare_times (qmont_as_nat h4 x153) 9) (qmont_as_nat h0 x_101111)) | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 82,
"end_line": 237,
"start_col": 0,
"start_line": 207
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
unfold
let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True
unfold
let linv (a:LSeq.lseq uint64 4) : Type0 =
BD.bn_v a < S.order
unfold
let refl (a:LSeq.lseq uint64 4{linv a}) : GTot S.qelem =
SM.from_qmont (BD.bn_v a)
inline_for_extraction noextract
let mk_to_p256_order_comm_monoid : BE.to_comm_monoid U64 4ul 0ul = {
BE.a_spec = S.qelem;
BE.comm_monoid = SI.nat_mod_comm_monoid;
BE.linv_ctx = linv_ctx;
BE.linv = linv;
BE.refl = refl;
}
inline_for_extraction noextract
val one_mod : BE.lone_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let one_mod ctx one = make_qone one
inline_for_extraction noextract
val mul_mod : BE.lmul_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let mul_mod ctx x y xy = qmul xy x y
inline_for_extraction noextract
val sqr_mod : BE.lsqr_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let sqr_mod ctx x xx = qsqr xx x
inline_for_extraction noextract
let mk_p256_order_concrete_ops : BE.concrete_ops U64 4ul 0ul = {
BE.to = mk_to_p256_order_comm_monoid;
BE.lone = one_mod;
BE.lmul = mul_mod;
BE.lsqr = sqr_mod;
}
inline_for_extraction noextract
val qsquare_times_in_place (out:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ as_nat h out < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 out) (v b))
let qsquare_times_in_place out b =
let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 out) (v b);
BE.lexp_pow2_in_place 4ul 0ul mk_p256_order_concrete_ops (null uint64) out b
inline_for_extraction noextract
val qsquare_times (out a:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ live h a /\ disjoint out a /\
as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 a) (v b))
let qsquare_times out a b =
let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 a) (v b);
BE.lexp_pow2 4ul 0ul mk_p256_order_concrete_ops (null uint64) a b out
// x6 can be modified
// x_11 cannot be modified
inline_for_extraction noextract
val qinv_x8_x128 (x128 x6 x_11:felem) : Stack unit
(requires fun h ->
live h x128 /\ live h x6 /\ live h x_11 /\
disjoint x128 x6 /\ disjoint x128 x_11 /\ disjoint x6 x_11 /\
as_nat h x6 < S.order /\ as_nat h x_11 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x128 |+| loc x6) h0 h1 /\
as_nat h1 x128 < S.order /\
qmont_as_nat h1 x128 = SI.qinv_x8_x128 (qmont_as_nat h0 x6) (qmont_as_nat h0 x_11))
let qinv_x8_x128 x128 x6 x_11 =
let h0 = ST.get () in
qsquare_times_in_place x6 2ul;
qmul x6 x6 x_11;
let h1 = ST.get () in
assert (qmont_as_nat h1 x6 == // x8
S.qmul (SI.qsquare_times (qmont_as_nat h0 x6) 2) (qmont_as_nat h0 x_11));
qsquare_times x128 x6 8ul;
qmul x128 x128 x6;
let h2 = ST.get () in
assert (qmont_as_nat h2 x128 == // x16
S.qmul (SI.qsquare_times (qmont_as_nat h1 x6) 8) (qmont_as_nat h1 x6));
qsquare_times x6 x128 16ul;
qmul x6 x6 x128;
let h3 = ST.get () in
assert (qmont_as_nat h3 x6 == // x32
S.qmul (SI.qsquare_times (qmont_as_nat h2 x128) 16) (qmont_as_nat h2 x128));
qsquare_times x128 x6 64ul;
qmul x128 x128 x6;
let h4 = ST.get () in
assert (qmont_as_nat h4 x128 == // x96
S.qmul (SI.qsquare_times (qmont_as_nat h3 x6) 64) (qmont_as_nat h3 x6));
qsquare_times_in_place x128 32ul;
qmul x128 x128 x6;
let h5 = ST.get () in
assert (qmont_as_nat h5 x128 == // x128
S.qmul (SI.qsquare_times (qmont_as_nat h4 x128) 32) (qmont_as_nat h3 x6))
// x128 can be modified
inline_for_extraction noextract
val qinv_x134_x153 (x128 x_11 x_111 x_1111 x_10101 x_101111:felem) : Stack unit
(requires fun h ->
live h x128 /\ live h x_11 /\ live h x_111 /\
live h x_1111 /\ live h x_10101 /\ live h x_101111 /\
disjoint x128 x_11 /\ disjoint x128 x_111 /\ disjoint x128 x_1111 /\
disjoint x128 x_10101 /\ disjoint x128 x_101111 /\
as_nat h x128 < S.order /\ as_nat h x_11 < S.order /\
as_nat h x_111 < S.order /\ as_nat h x_1111 < S.order /\
as_nat h x_10101 < S.order /\ as_nat h x_101111 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x128) h0 h1 /\
as_nat h1 x128 < S.order /\
qmont_as_nat h1 x128 = SI.qinv_x134_x153
(qmont_as_nat h0 x128) (qmont_as_nat h0 x_11) (qmont_as_nat h0 x_111)
(qmont_as_nat h0 x_1111) (qmont_as_nat h0 x_10101) (qmont_as_nat h0 x_101111))
let qinv_x134_x153 x128 x_11 x_111 x_1111 x_10101 x_101111 =
let h0 = ST.get () in
qsquare_times_in_place x128 6ul;
qmul x128 x128 x_101111;
let h1 = ST.get () in
assert (qmont_as_nat h1 x128 == // x134
S.qmul (SI.qsquare_times (qmont_as_nat h0 x128) 6) (qmont_as_nat h0 x_101111));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_111;
let h2 = ST.get () in
assert (qmont_as_nat h2 x128 == // x139
S.qmul (SI.qsquare_times (qmont_as_nat h1 x128) 5) (qmont_as_nat h0 x_111));
qsquare_times_in_place x128 4ul;
qmul x128 x128 x_11;
let h3 = ST.get () in
assert (qmont_as_nat h3 x128 == // x143
S.qmul (SI.qsquare_times (qmont_as_nat h2 x128) 4) (qmont_as_nat h0 x_11));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_1111;
let h4 = ST.get () in
assert (qmont_as_nat h4 x128 == // x148
S.qmul (SI.qsquare_times (qmont_as_nat h3 x128) 5) (qmont_as_nat h0 x_1111));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_10101;
let h5 = ST.get () in
assert (qmont_as_nat h5 x128 == // x153
S.qmul (SI.qsquare_times (qmont_as_nat h4 x128) 5) (qmont_as_nat h0 x_10101))
// x153 can be modified
inline_for_extraction noextract
val qinv_x153_x177 (x153 x_101 x_111 x_101111:felem) : Stack unit
(requires fun h ->
live h x153 /\ live h x_101 /\ live h x_111 /\ live h x_101111 /\
disjoint x153 x_101 /\ disjoint x153 x_111 /\ disjoint x153 x_101111 /\
as_nat h x153 < S.order /\ as_nat h x_101 < S.order /\
as_nat h x_111 < S.order /\ as_nat h x_101111 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x153) h0 h1 /\
as_nat h1 x153 < S.order /\
qmont_as_nat h1 x153 = SI.qinv_x153_x177 (qmont_as_nat h0 x153)
(qmont_as_nat h0 x_101) (qmont_as_nat h0 x_111) (qmont_as_nat h0 x_101111)) | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
x153: Hacl.Impl.P256.Bignum.felem ->
x_101: Hacl.Impl.P256.Bignum.felem ->
x_111: Hacl.Impl.P256.Bignum.felem ->
x_101111: Hacl.Impl.P256.Bignum.felem
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.P256.Bignum.felem",
"Prims._assert",
"Prims.eq2",
"Spec.P256.PointOps.qelem",
"Hacl.Impl.P256.Scalar.qmont_as_nat",
"Spec.P256.PointOps.qmul",
"Hacl.Spec.P256.Qinv.qsquare_times",
"Prims.unit",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Hacl.Impl.P256.Scalar.qmul",
"Hacl.Impl.P256.Qinv.qsquare_times_in_place",
"FStar.UInt32.__uint_to_t"
] | [] | false | true | false | false | false | let qinv_x153_x177 x153 x_101 x_111 x_101111 =
| let h0 = ST.get () in
qsquare_times_in_place x153 4ul;
qmul x153 x153 x_101;
let h1 = ST.get () in
assert (qmont_as_nat h1 x153 ==
S.qmul (SI.qsquare_times (qmont_as_nat h0 x153) 4) (qmont_as_nat h0 x_101));
qsquare_times_in_place x153 3ul;
qmul x153 x153 x_101;
let h2 = ST.get () in
assert (qmont_as_nat h2 x153 ==
S.qmul (SI.qsquare_times (qmont_as_nat h1 x153) 3) (qmont_as_nat h0 x_101));
qsquare_times_in_place x153 3ul;
qmul x153 x153 x_101;
let h3 = ST.get () in
assert (qmont_as_nat h3 x153 ==
S.qmul (SI.qsquare_times (qmont_as_nat h2 x153) 3) (qmont_as_nat h0 x_101));
qsquare_times_in_place x153 5ul;
qmul x153 x153 x_111;
let h4 = ST.get () in
assert (qmont_as_nat h4 x153 ==
S.qmul (SI.qsquare_times (qmont_as_nat h3 x153) 5) (qmont_as_nat h0 x_111));
qsquare_times_in_place x153 9ul;
qmul x153 x153 x_101111;
let h5 = ST.get () in
assert (qmont_as_nat h5 x153 ==
S.qmul (SI.qsquare_times (qmont_as_nat h4 x153) 9) (qmont_as_nat h0 x_101111)) | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.qinv_x8_x128 | val qinv_x8_x128 (x128 x6 x_11:felem) : Stack unit
(requires fun h ->
live h x128 /\ live h x6 /\ live h x_11 /\
disjoint x128 x6 /\ disjoint x128 x_11 /\ disjoint x6 x_11 /\
as_nat h x6 < S.order /\ as_nat h x_11 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x128 |+| loc x6) h0 h1 /\
as_nat h1 x128 < S.order /\
qmont_as_nat h1 x128 = SI.qinv_x8_x128 (qmont_as_nat h0 x6) (qmont_as_nat h0 x_11)) | val qinv_x8_x128 (x128 x6 x_11:felem) : Stack unit
(requires fun h ->
live h x128 /\ live h x6 /\ live h x_11 /\
disjoint x128 x6 /\ disjoint x128 x_11 /\ disjoint x6 x_11 /\
as_nat h x6 < S.order /\ as_nat h x_11 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x128 |+| loc x6) h0 h1 /\
as_nat h1 x128 < S.order /\
qmont_as_nat h1 x128 = SI.qinv_x8_x128 (qmont_as_nat h0 x6) (qmont_as_nat h0 x_11)) | let qinv_x8_x128 x128 x6 x_11 =
let h0 = ST.get () in
qsquare_times_in_place x6 2ul;
qmul x6 x6 x_11;
let h1 = ST.get () in
assert (qmont_as_nat h1 x6 == // x8
S.qmul (SI.qsquare_times (qmont_as_nat h0 x6) 2) (qmont_as_nat h0 x_11));
qsquare_times x128 x6 8ul;
qmul x128 x128 x6;
let h2 = ST.get () in
assert (qmont_as_nat h2 x128 == // x16
S.qmul (SI.qsquare_times (qmont_as_nat h1 x6) 8) (qmont_as_nat h1 x6));
qsquare_times x6 x128 16ul;
qmul x6 x6 x128;
let h3 = ST.get () in
assert (qmont_as_nat h3 x6 == // x32
S.qmul (SI.qsquare_times (qmont_as_nat h2 x128) 16) (qmont_as_nat h2 x128));
qsquare_times x128 x6 64ul;
qmul x128 x128 x6;
let h4 = ST.get () in
assert (qmont_as_nat h4 x128 == // x96
S.qmul (SI.qsquare_times (qmont_as_nat h3 x6) 64) (qmont_as_nat h3 x6));
qsquare_times_in_place x128 32ul;
qmul x128 x128 x6;
let h5 = ST.get () in
assert (qmont_as_nat h5 x128 == // x128
S.qmul (SI.qsquare_times (qmont_as_nat h4 x128) 32) (qmont_as_nat h3 x6)) | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 77,
"end_line": 141,
"start_col": 0,
"start_line": 111
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
unfold
let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True
unfold
let linv (a:LSeq.lseq uint64 4) : Type0 =
BD.bn_v a < S.order
unfold
let refl (a:LSeq.lseq uint64 4{linv a}) : GTot S.qelem =
SM.from_qmont (BD.bn_v a)
inline_for_extraction noextract
let mk_to_p256_order_comm_monoid : BE.to_comm_monoid U64 4ul 0ul = {
BE.a_spec = S.qelem;
BE.comm_monoid = SI.nat_mod_comm_monoid;
BE.linv_ctx = linv_ctx;
BE.linv = linv;
BE.refl = refl;
}
inline_for_extraction noextract
val one_mod : BE.lone_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let one_mod ctx one = make_qone one
inline_for_extraction noextract
val mul_mod : BE.lmul_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let mul_mod ctx x y xy = qmul xy x y
inline_for_extraction noextract
val sqr_mod : BE.lsqr_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let sqr_mod ctx x xx = qsqr xx x
inline_for_extraction noextract
let mk_p256_order_concrete_ops : BE.concrete_ops U64 4ul 0ul = {
BE.to = mk_to_p256_order_comm_monoid;
BE.lone = one_mod;
BE.lmul = mul_mod;
BE.lsqr = sqr_mod;
}
inline_for_extraction noextract
val qsquare_times_in_place (out:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ as_nat h out < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 out) (v b))
let qsquare_times_in_place out b =
let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 out) (v b);
BE.lexp_pow2_in_place 4ul 0ul mk_p256_order_concrete_ops (null uint64) out b
inline_for_extraction noextract
val qsquare_times (out a:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ live h a /\ disjoint out a /\
as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 a) (v b))
let qsquare_times out a b =
let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 a) (v b);
BE.lexp_pow2 4ul 0ul mk_p256_order_concrete_ops (null uint64) a b out
// x6 can be modified
// x_11 cannot be modified
inline_for_extraction noextract
val qinv_x8_x128 (x128 x6 x_11:felem) : Stack unit
(requires fun h ->
live h x128 /\ live h x6 /\ live h x_11 /\
disjoint x128 x6 /\ disjoint x128 x_11 /\ disjoint x6 x_11 /\
as_nat h x6 < S.order /\ as_nat h x_11 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x128 |+| loc x6) h0 h1 /\
as_nat h1 x128 < S.order /\
qmont_as_nat h1 x128 = SI.qinv_x8_x128 (qmont_as_nat h0 x6) (qmont_as_nat h0 x_11)) | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
x128: Hacl.Impl.P256.Bignum.felem ->
x6: Hacl.Impl.P256.Bignum.felem ->
x_11: Hacl.Impl.P256.Bignum.felem
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.P256.Bignum.felem",
"Prims._assert",
"Prims.eq2",
"Spec.P256.PointOps.qelem",
"Hacl.Impl.P256.Scalar.qmont_as_nat",
"Spec.P256.PointOps.qmul",
"Hacl.Spec.P256.Qinv.qsquare_times",
"Prims.unit",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Hacl.Impl.P256.Scalar.qmul",
"Hacl.Impl.P256.Qinv.qsquare_times_in_place",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.P256.Qinv.qsquare_times"
] | [] | false | true | false | false | false | let qinv_x8_x128 x128 x6 x_11 =
| let h0 = ST.get () in
qsquare_times_in_place x6 2ul;
qmul x6 x6 x_11;
let h1 = ST.get () in
assert (qmont_as_nat h1 x6 ==
S.qmul (SI.qsquare_times (qmont_as_nat h0 x6) 2) (qmont_as_nat h0 x_11));
qsquare_times x128 x6 8ul;
qmul x128 x128 x6;
let h2 = ST.get () in
assert (qmont_as_nat h2 x128 ==
S.qmul (SI.qsquare_times (qmont_as_nat h1 x6) 8) (qmont_as_nat h1 x6));
qsquare_times x6 x128 16ul;
qmul x6 x6 x128;
let h3 = ST.get () in
assert (qmont_as_nat h3 x6 ==
S.qmul (SI.qsquare_times (qmont_as_nat h2 x128) 16) (qmont_as_nat h2 x128));
qsquare_times x128 x6 64ul;
qmul x128 x128 x6;
let h4 = ST.get () in
assert (qmont_as_nat h4 x128 ==
S.qmul (SI.qsquare_times (qmont_as_nat h3 x6) 64) (qmont_as_nat h3 x6));
qsquare_times_in_place x128 32ul;
qmul x128 x128 x6;
let h5 = ST.get () in
assert (qmont_as_nat h5 x128 ==
S.qmul (SI.qsquare_times (qmont_as_nat h4 x128) 32) (qmont_as_nat h3 x6)) | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.qinv_x134_x153 | val qinv_x134_x153 (x128 x_11 x_111 x_1111 x_10101 x_101111:felem) : Stack unit
(requires fun h ->
live h x128 /\ live h x_11 /\ live h x_111 /\
live h x_1111 /\ live h x_10101 /\ live h x_101111 /\
disjoint x128 x_11 /\ disjoint x128 x_111 /\ disjoint x128 x_1111 /\
disjoint x128 x_10101 /\ disjoint x128 x_101111 /\
as_nat h x128 < S.order /\ as_nat h x_11 < S.order /\
as_nat h x_111 < S.order /\ as_nat h x_1111 < S.order /\
as_nat h x_10101 < S.order /\ as_nat h x_101111 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x128) h0 h1 /\
as_nat h1 x128 < S.order /\
qmont_as_nat h1 x128 = SI.qinv_x134_x153
(qmont_as_nat h0 x128) (qmont_as_nat h0 x_11) (qmont_as_nat h0 x_111)
(qmont_as_nat h0 x_1111) (qmont_as_nat h0 x_10101) (qmont_as_nat h0 x_101111)) | val qinv_x134_x153 (x128 x_11 x_111 x_1111 x_10101 x_101111:felem) : Stack unit
(requires fun h ->
live h x128 /\ live h x_11 /\ live h x_111 /\
live h x_1111 /\ live h x_10101 /\ live h x_101111 /\
disjoint x128 x_11 /\ disjoint x128 x_111 /\ disjoint x128 x_1111 /\
disjoint x128 x_10101 /\ disjoint x128 x_101111 /\
as_nat h x128 < S.order /\ as_nat h x_11 < S.order /\
as_nat h x_111 < S.order /\ as_nat h x_1111 < S.order /\
as_nat h x_10101 < S.order /\ as_nat h x_101111 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x128) h0 h1 /\
as_nat h1 x128 < S.order /\
qmont_as_nat h1 x128 = SI.qinv_x134_x153
(qmont_as_nat h0 x128) (qmont_as_nat h0 x_11) (qmont_as_nat h0 x_111)
(qmont_as_nat h0 x_1111) (qmont_as_nat h0 x_10101) (qmont_as_nat h0 x_101111)) | let qinv_x134_x153 x128 x_11 x_111 x_1111 x_10101 x_101111 =
let h0 = ST.get () in
qsquare_times_in_place x128 6ul;
qmul x128 x128 x_101111;
let h1 = ST.get () in
assert (qmont_as_nat h1 x128 == // x134
S.qmul (SI.qsquare_times (qmont_as_nat h0 x128) 6) (qmont_as_nat h0 x_101111));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_111;
let h2 = ST.get () in
assert (qmont_as_nat h2 x128 == // x139
S.qmul (SI.qsquare_times (qmont_as_nat h1 x128) 5) (qmont_as_nat h0 x_111));
qsquare_times_in_place x128 4ul;
qmul x128 x128 x_11;
let h3 = ST.get () in
assert (qmont_as_nat h3 x128 == // x143
S.qmul (SI.qsquare_times (qmont_as_nat h2 x128) 4) (qmont_as_nat h0 x_11));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_1111;
let h4 = ST.get () in
assert (qmont_as_nat h4 x128 == // x148
S.qmul (SI.qsquare_times (qmont_as_nat h3 x128) 5) (qmont_as_nat h0 x_1111));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_10101;
let h5 = ST.get () in
assert (qmont_as_nat h5 x128 == // x153
S.qmul (SI.qsquare_times (qmont_as_nat h4 x128) 5) (qmont_as_nat h0 x_10101)) | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 81,
"end_line": 191,
"start_col": 0,
"start_line": 161
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
unfold
let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True
unfold
let linv (a:LSeq.lseq uint64 4) : Type0 =
BD.bn_v a < S.order
unfold
let refl (a:LSeq.lseq uint64 4{linv a}) : GTot S.qelem =
SM.from_qmont (BD.bn_v a)
inline_for_extraction noextract
let mk_to_p256_order_comm_monoid : BE.to_comm_monoid U64 4ul 0ul = {
BE.a_spec = S.qelem;
BE.comm_monoid = SI.nat_mod_comm_monoid;
BE.linv_ctx = linv_ctx;
BE.linv = linv;
BE.refl = refl;
}
inline_for_extraction noextract
val one_mod : BE.lone_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let one_mod ctx one = make_qone one
inline_for_extraction noextract
val mul_mod : BE.lmul_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let mul_mod ctx x y xy = qmul xy x y
inline_for_extraction noextract
val sqr_mod : BE.lsqr_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let sqr_mod ctx x xx = qsqr xx x
inline_for_extraction noextract
let mk_p256_order_concrete_ops : BE.concrete_ops U64 4ul 0ul = {
BE.to = mk_to_p256_order_comm_monoid;
BE.lone = one_mod;
BE.lmul = mul_mod;
BE.lsqr = sqr_mod;
}
inline_for_extraction noextract
val qsquare_times_in_place (out:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ as_nat h out < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 out) (v b))
let qsquare_times_in_place out b =
let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 out) (v b);
BE.lexp_pow2_in_place 4ul 0ul mk_p256_order_concrete_ops (null uint64) out b
inline_for_extraction noextract
val qsquare_times (out a:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ live h a /\ disjoint out a /\
as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 a) (v b))
let qsquare_times out a b =
let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 a) (v b);
BE.lexp_pow2 4ul 0ul mk_p256_order_concrete_ops (null uint64) a b out
// x6 can be modified
// x_11 cannot be modified
inline_for_extraction noextract
val qinv_x8_x128 (x128 x6 x_11:felem) : Stack unit
(requires fun h ->
live h x128 /\ live h x6 /\ live h x_11 /\
disjoint x128 x6 /\ disjoint x128 x_11 /\ disjoint x6 x_11 /\
as_nat h x6 < S.order /\ as_nat h x_11 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x128 |+| loc x6) h0 h1 /\
as_nat h1 x128 < S.order /\
qmont_as_nat h1 x128 = SI.qinv_x8_x128 (qmont_as_nat h0 x6) (qmont_as_nat h0 x_11))
let qinv_x8_x128 x128 x6 x_11 =
let h0 = ST.get () in
qsquare_times_in_place x6 2ul;
qmul x6 x6 x_11;
let h1 = ST.get () in
assert (qmont_as_nat h1 x6 == // x8
S.qmul (SI.qsquare_times (qmont_as_nat h0 x6) 2) (qmont_as_nat h0 x_11));
qsquare_times x128 x6 8ul;
qmul x128 x128 x6;
let h2 = ST.get () in
assert (qmont_as_nat h2 x128 == // x16
S.qmul (SI.qsquare_times (qmont_as_nat h1 x6) 8) (qmont_as_nat h1 x6));
qsquare_times x6 x128 16ul;
qmul x6 x6 x128;
let h3 = ST.get () in
assert (qmont_as_nat h3 x6 == // x32
S.qmul (SI.qsquare_times (qmont_as_nat h2 x128) 16) (qmont_as_nat h2 x128));
qsquare_times x128 x6 64ul;
qmul x128 x128 x6;
let h4 = ST.get () in
assert (qmont_as_nat h4 x128 == // x96
S.qmul (SI.qsquare_times (qmont_as_nat h3 x6) 64) (qmont_as_nat h3 x6));
qsquare_times_in_place x128 32ul;
qmul x128 x128 x6;
let h5 = ST.get () in
assert (qmont_as_nat h5 x128 == // x128
S.qmul (SI.qsquare_times (qmont_as_nat h4 x128) 32) (qmont_as_nat h3 x6))
// x128 can be modified
inline_for_extraction noextract
val qinv_x134_x153 (x128 x_11 x_111 x_1111 x_10101 x_101111:felem) : Stack unit
(requires fun h ->
live h x128 /\ live h x_11 /\ live h x_111 /\
live h x_1111 /\ live h x_10101 /\ live h x_101111 /\
disjoint x128 x_11 /\ disjoint x128 x_111 /\ disjoint x128 x_1111 /\
disjoint x128 x_10101 /\ disjoint x128 x_101111 /\
as_nat h x128 < S.order /\ as_nat h x_11 < S.order /\
as_nat h x_111 < S.order /\ as_nat h x_1111 < S.order /\
as_nat h x_10101 < S.order /\ as_nat h x_101111 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x128) h0 h1 /\
as_nat h1 x128 < S.order /\
qmont_as_nat h1 x128 = SI.qinv_x134_x153
(qmont_as_nat h0 x128) (qmont_as_nat h0 x_11) (qmont_as_nat h0 x_111)
(qmont_as_nat h0 x_1111) (qmont_as_nat h0 x_10101) (qmont_as_nat h0 x_101111)) | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
x128: Hacl.Impl.P256.Bignum.felem ->
x_11: Hacl.Impl.P256.Bignum.felem ->
x_111: Hacl.Impl.P256.Bignum.felem ->
x_1111: Hacl.Impl.P256.Bignum.felem ->
x_10101: Hacl.Impl.P256.Bignum.felem ->
x_101111: Hacl.Impl.P256.Bignum.felem
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.P256.Bignum.felem",
"Prims._assert",
"Prims.eq2",
"Spec.P256.PointOps.qelem",
"Hacl.Impl.P256.Scalar.qmont_as_nat",
"Spec.P256.PointOps.qmul",
"Hacl.Spec.P256.Qinv.qsquare_times",
"Prims.unit",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Hacl.Impl.P256.Scalar.qmul",
"Hacl.Impl.P256.Qinv.qsquare_times_in_place",
"FStar.UInt32.__uint_to_t"
] | [] | false | true | false | false | false | let qinv_x134_x153 x128 x_11 x_111 x_1111 x_10101 x_101111 =
| let h0 = ST.get () in
qsquare_times_in_place x128 6ul;
qmul x128 x128 x_101111;
let h1 = ST.get () in
assert (qmont_as_nat h1 x128 ==
S.qmul (SI.qsquare_times (qmont_as_nat h0 x128) 6) (qmont_as_nat h0 x_101111));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_111;
let h2 = ST.get () in
assert (qmont_as_nat h2 x128 ==
S.qmul (SI.qsquare_times (qmont_as_nat h1 x128) 5) (qmont_as_nat h0 x_111));
qsquare_times_in_place x128 4ul;
qmul x128 x128 x_11;
let h3 = ST.get () in
assert (qmont_as_nat h3 x128 ==
S.qmul (SI.qsquare_times (qmont_as_nat h2 x128) 4) (qmont_as_nat h0 x_11));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_1111;
let h4 = ST.get () in
assert (qmont_as_nat h4 x128 ==
S.qmul (SI.qsquare_times (qmont_as_nat h3 x128) 5) (qmont_as_nat h0 x_1111));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_10101;
let h5 = ST.get () in
assert (qmont_as_nat h5 x128 ==
S.qmul (SI.qsquare_times (qmont_as_nat h4 x128) 5) (qmont_as_nat h0 x_10101)) | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.qinv_x240_x256 | val qinv_x240_x256 (x240 x_1111 x_10101 a:felem) : Stack unit
(requires fun h ->
live h x240 /\ live h x_1111 /\ live h x_10101 /\ live h a /\
disjoint x240 x_1111 /\ disjoint x240 x_10101 /\ disjoint x240 a /\
as_nat h x240 < S.order /\ as_nat h x_1111 < S.order /\
as_nat h x_10101 < S.order /\ as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc x240) h0 h1 /\
as_nat h1 x240 < S.order /\
qmont_as_nat h1 x240 = SI.qinv_x240_x256 (qmont_as_nat h0 a)
(qmont_as_nat h0 x240) (qmont_as_nat h0 x_1111) (qmont_as_nat h0 x_10101)) | val qinv_x240_x256 (x240 x_1111 x_10101 a:felem) : Stack unit
(requires fun h ->
live h x240 /\ live h x_1111 /\ live h x_10101 /\ live h a /\
disjoint x240 x_1111 /\ disjoint x240 x_10101 /\ disjoint x240 a /\
as_nat h x240 < S.order /\ as_nat h x_1111 < S.order /\
as_nat h x_10101 < S.order /\ as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc x240) h0 h1 /\
as_nat h1 x240 < S.order /\
qmont_as_nat h1 x240 = SI.qinv_x240_x256 (qmont_as_nat h0 a)
(qmont_as_nat h0 x240) (qmont_as_nat h0 x_1111) (qmont_as_nat h0 x_10101)) | let qinv_x240_x256 x240 x_1111 x_10101 a =
let h0 = ST.get () in
qsquare_times_in_place x240 3ul;
qmul x240 x240 a;
let h1 = ST.get () in
assert (qmont_as_nat h1 x240 == // x243
S.qmul (SI.qsquare_times (qmont_as_nat h0 x240) 3) (qmont_as_nat h0 a));
qsquare_times_in_place x240 7ul;
qmul x240 x240 x_10101;
let h2 = ST.get () in
assert (qmont_as_nat h2 x240 == // x250
S.qmul (SI.qsquare_times (qmont_as_nat h1 x240) 7) (qmont_as_nat h0 x_10101));
qsquare_times_in_place x240 6ul;
qmul x240 x240 x_1111;
let h3 = ST.get () in
assert (qmont_as_nat h3 x240 == // x256
S.qmul (SI.qsquare_times (qmont_as_nat h2 x240) 6) (qmont_as_nat h0 x_1111)) | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 80,
"end_line": 379,
"start_col": 0,
"start_line": 361
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
unfold
let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True
unfold
let linv (a:LSeq.lseq uint64 4) : Type0 =
BD.bn_v a < S.order
unfold
let refl (a:LSeq.lseq uint64 4{linv a}) : GTot S.qelem =
SM.from_qmont (BD.bn_v a)
inline_for_extraction noextract
let mk_to_p256_order_comm_monoid : BE.to_comm_monoid U64 4ul 0ul = {
BE.a_spec = S.qelem;
BE.comm_monoid = SI.nat_mod_comm_monoid;
BE.linv_ctx = linv_ctx;
BE.linv = linv;
BE.refl = refl;
}
inline_for_extraction noextract
val one_mod : BE.lone_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let one_mod ctx one = make_qone one
inline_for_extraction noextract
val mul_mod : BE.lmul_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let mul_mod ctx x y xy = qmul xy x y
inline_for_extraction noextract
val sqr_mod : BE.lsqr_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let sqr_mod ctx x xx = qsqr xx x
inline_for_extraction noextract
let mk_p256_order_concrete_ops : BE.concrete_ops U64 4ul 0ul = {
BE.to = mk_to_p256_order_comm_monoid;
BE.lone = one_mod;
BE.lmul = mul_mod;
BE.lsqr = sqr_mod;
}
inline_for_extraction noextract
val qsquare_times_in_place (out:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ as_nat h out < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 out) (v b))
let qsquare_times_in_place out b =
let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 out) (v b);
BE.lexp_pow2_in_place 4ul 0ul mk_p256_order_concrete_ops (null uint64) out b
inline_for_extraction noextract
val qsquare_times (out a:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ live h a /\ disjoint out a /\
as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 a) (v b))
let qsquare_times out a b =
let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 a) (v b);
BE.lexp_pow2 4ul 0ul mk_p256_order_concrete_ops (null uint64) a b out
// x6 can be modified
// x_11 cannot be modified
inline_for_extraction noextract
val qinv_x8_x128 (x128 x6 x_11:felem) : Stack unit
(requires fun h ->
live h x128 /\ live h x6 /\ live h x_11 /\
disjoint x128 x6 /\ disjoint x128 x_11 /\ disjoint x6 x_11 /\
as_nat h x6 < S.order /\ as_nat h x_11 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x128 |+| loc x6) h0 h1 /\
as_nat h1 x128 < S.order /\
qmont_as_nat h1 x128 = SI.qinv_x8_x128 (qmont_as_nat h0 x6) (qmont_as_nat h0 x_11))
let qinv_x8_x128 x128 x6 x_11 =
let h0 = ST.get () in
qsquare_times_in_place x6 2ul;
qmul x6 x6 x_11;
let h1 = ST.get () in
assert (qmont_as_nat h1 x6 == // x8
S.qmul (SI.qsquare_times (qmont_as_nat h0 x6) 2) (qmont_as_nat h0 x_11));
qsquare_times x128 x6 8ul;
qmul x128 x128 x6;
let h2 = ST.get () in
assert (qmont_as_nat h2 x128 == // x16
S.qmul (SI.qsquare_times (qmont_as_nat h1 x6) 8) (qmont_as_nat h1 x6));
qsquare_times x6 x128 16ul;
qmul x6 x6 x128;
let h3 = ST.get () in
assert (qmont_as_nat h3 x6 == // x32
S.qmul (SI.qsquare_times (qmont_as_nat h2 x128) 16) (qmont_as_nat h2 x128));
qsquare_times x128 x6 64ul;
qmul x128 x128 x6;
let h4 = ST.get () in
assert (qmont_as_nat h4 x128 == // x96
S.qmul (SI.qsquare_times (qmont_as_nat h3 x6) 64) (qmont_as_nat h3 x6));
qsquare_times_in_place x128 32ul;
qmul x128 x128 x6;
let h5 = ST.get () in
assert (qmont_as_nat h5 x128 == // x128
S.qmul (SI.qsquare_times (qmont_as_nat h4 x128) 32) (qmont_as_nat h3 x6))
// x128 can be modified
inline_for_extraction noextract
val qinv_x134_x153 (x128 x_11 x_111 x_1111 x_10101 x_101111:felem) : Stack unit
(requires fun h ->
live h x128 /\ live h x_11 /\ live h x_111 /\
live h x_1111 /\ live h x_10101 /\ live h x_101111 /\
disjoint x128 x_11 /\ disjoint x128 x_111 /\ disjoint x128 x_1111 /\
disjoint x128 x_10101 /\ disjoint x128 x_101111 /\
as_nat h x128 < S.order /\ as_nat h x_11 < S.order /\
as_nat h x_111 < S.order /\ as_nat h x_1111 < S.order /\
as_nat h x_10101 < S.order /\ as_nat h x_101111 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x128) h0 h1 /\
as_nat h1 x128 < S.order /\
qmont_as_nat h1 x128 = SI.qinv_x134_x153
(qmont_as_nat h0 x128) (qmont_as_nat h0 x_11) (qmont_as_nat h0 x_111)
(qmont_as_nat h0 x_1111) (qmont_as_nat h0 x_10101) (qmont_as_nat h0 x_101111))
let qinv_x134_x153 x128 x_11 x_111 x_1111 x_10101 x_101111 =
let h0 = ST.get () in
qsquare_times_in_place x128 6ul;
qmul x128 x128 x_101111;
let h1 = ST.get () in
assert (qmont_as_nat h1 x128 == // x134
S.qmul (SI.qsquare_times (qmont_as_nat h0 x128) 6) (qmont_as_nat h0 x_101111));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_111;
let h2 = ST.get () in
assert (qmont_as_nat h2 x128 == // x139
S.qmul (SI.qsquare_times (qmont_as_nat h1 x128) 5) (qmont_as_nat h0 x_111));
qsquare_times_in_place x128 4ul;
qmul x128 x128 x_11;
let h3 = ST.get () in
assert (qmont_as_nat h3 x128 == // x143
S.qmul (SI.qsquare_times (qmont_as_nat h2 x128) 4) (qmont_as_nat h0 x_11));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_1111;
let h4 = ST.get () in
assert (qmont_as_nat h4 x128 == // x148
S.qmul (SI.qsquare_times (qmont_as_nat h3 x128) 5) (qmont_as_nat h0 x_1111));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_10101;
let h5 = ST.get () in
assert (qmont_as_nat h5 x128 == // x153
S.qmul (SI.qsquare_times (qmont_as_nat h4 x128) 5) (qmont_as_nat h0 x_10101))
// x153 can be modified
inline_for_extraction noextract
val qinv_x153_x177 (x153 x_101 x_111 x_101111:felem) : Stack unit
(requires fun h ->
live h x153 /\ live h x_101 /\ live h x_111 /\ live h x_101111 /\
disjoint x153 x_101 /\ disjoint x153 x_111 /\ disjoint x153 x_101111 /\
as_nat h x153 < S.order /\ as_nat h x_101 < S.order /\
as_nat h x_111 < S.order /\ as_nat h x_101111 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x153) h0 h1 /\
as_nat h1 x153 < S.order /\
qmont_as_nat h1 x153 = SI.qinv_x153_x177 (qmont_as_nat h0 x153)
(qmont_as_nat h0 x_101) (qmont_as_nat h0 x_111) (qmont_as_nat h0 x_101111))
let qinv_x153_x177 x153 x_101 x_111 x_101111 =
let h0 = ST.get () in
qsquare_times_in_place x153 4ul;
qmul x153 x153 x_101;
let h1 = ST.get () in
assert (qmont_as_nat h1 x153 == // x157
S.qmul (SI.qsquare_times (qmont_as_nat h0 x153) 4) (qmont_as_nat h0 x_101));
qsquare_times_in_place x153 3ul;
qmul x153 x153 x_101;
let h2 = ST.get () in
assert (qmont_as_nat h2 x153 == // x160
S.qmul (SI.qsquare_times (qmont_as_nat h1 x153) 3) (qmont_as_nat h0 x_101));
qsquare_times_in_place x153 3ul;
qmul x153 x153 x_101;
let h3 = ST.get () in
assert (qmont_as_nat h3 x153 == // x163
S.qmul (SI.qsquare_times (qmont_as_nat h2 x153) 3) (qmont_as_nat h0 x_101));
qsquare_times_in_place x153 5ul;
qmul x153 x153 x_111;
let h4 = ST.get () in
assert (qmont_as_nat h4 x153 == // x168
S.qmul (SI.qsquare_times (qmont_as_nat h3 x153) 5) (qmont_as_nat h0 x_111));
qsquare_times_in_place x153 9ul;
qmul x153 x153 x_101111;
let h5 = ST.get () in
assert (qmont_as_nat h5 x153 == // x177
S.qmul (SI.qsquare_times (qmont_as_nat h4 x153) 9) (qmont_as_nat h0 x_101111))
// x153 can be modified
inline_for_extraction noextract
val qinv_x177_x210 (x177 x_111 x_1111 a:felem) : Stack unit
(requires fun h ->
live h x177 /\ live h x_111 /\ live h x_1111 /\ live h a /\
disjoint x177 x_111 /\ disjoint x177 x_1111 /\ disjoint x177 a /\
as_nat h x177 < S.order /\ as_nat h x_111 < S.order /\
as_nat h x_1111 < S.order /\ as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc x177) h0 h1 /\
as_nat h1 x177 < S.order /\
qmont_as_nat h1 x177 = SI.qinv_x177_x210 (qmont_as_nat h0 a)
(qmont_as_nat h0 x177) (qmont_as_nat h0 x_111) (qmont_as_nat h0 x_1111))
let qinv_x177_x210 x177 x_111 x_1111 a =
let h0 = ST.get () in
qsquare_times_in_place x177 6ul;
qmul x177 x177 x_1111;
let h1 = ST.get () in
assert (qmont_as_nat h1 x177 == // x183
S.qmul (SI.qsquare_times (qmont_as_nat h0 x177) 6) (qmont_as_nat h0 x_1111));
qsquare_times_in_place x177 2ul;
qmul x177 x177 a;
let h2 = ST.get () in
assert (qmont_as_nat h2 x177 == // x185
S.qmul (SI.qsquare_times (qmont_as_nat h1 x177) 2) (qmont_as_nat h0 a));
qsquare_times_in_place x177 5ul;
qmul x177 x177 a;
let h3 = ST.get () in
assert (qmont_as_nat h3 x177 == // x190
S.qmul (SI.qsquare_times (qmont_as_nat h2 x177) 5) (qmont_as_nat h0 a));
qsquare_times_in_place x177 6ul;
qmul x177 x177 x_1111;
let h4 = ST.get () in
assert (qmont_as_nat h4 x177 == // x196
S.qmul (SI.qsquare_times (qmont_as_nat h3 x177) 6) (qmont_as_nat h0 x_1111));
qsquare_times_in_place x177 5ul;
qmul x177 x177 x_111;
let h5 = ST.get () in
assert (qmont_as_nat h5 x177 == // x201
S.qmul (SI.qsquare_times (qmont_as_nat h4 x177) 5) (qmont_as_nat h0 x_111));
qsquare_times_in_place x177 4ul;
qmul x177 x177 x_111;
let h6 = ST.get () in
assert (qmont_as_nat h6 x177 == // x205
S.qmul (SI.qsquare_times (qmont_as_nat h5 x177) 4) (qmont_as_nat h0 x_111));
qsquare_times_in_place x177 5ul;
qmul x177 x177 x_111;
let h7 = ST.get () in
assert (qmont_as_nat h7 x177 == // x210
S.qmul (SI.qsquare_times (qmont_as_nat h6 x177) 5) (qmont_as_nat h0 x_111))
inline_for_extraction noextract
val qinv_x210_x240 (x210 x_11 x_101 x_101111:felem) : Stack unit
(requires fun h ->
live h x210 /\ live h x_11 /\ live h x_101 /\ live h x_101111 /\
disjoint x210 x_11 /\ disjoint x210 x_101 /\ disjoint x210 x_101111 /\
as_nat h x210 < S.order /\ as_nat h x_11 < S.order /\
as_nat h x_101 < S.order /\ as_nat h x_101111 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x210) h0 h1 /\
as_nat h1 x210 < S.order /\
qmont_as_nat h1 x210 = SI.qinv_x210_x240 (qmont_as_nat h0 x210)
(qmont_as_nat h0 x_11) (qmont_as_nat h0 x_101) (qmont_as_nat h0 x_101111))
let qinv_x210_x240 x210 x_11 x_101 x_101111 =
let h0 = ST.get () in
qsquare_times_in_place x210 5ul;
qmul x210 x210 x_101;
let h1 = ST.get () in
assert (qmont_as_nat h1 x210 == // x215
S.qmul (SI.qsquare_times (qmont_as_nat h0 x210) 5) (qmont_as_nat h0 x_101));
qsquare_times_in_place x210 3ul;
qmul x210 x210 x_11;
let h2 = ST.get () in
assert (qmont_as_nat h2 x210 == // x218
S.qmul (SI.qsquare_times (qmont_as_nat h1 x210) 3) (qmont_as_nat h0 x_11));
qsquare_times_in_place x210 10ul;
qmul x210 x210 x_101111;
let h3 = ST.get () in
assert (qmont_as_nat h3 x210 == // x228
S.qmul (SI.qsquare_times (qmont_as_nat h2 x210) 10) (qmont_as_nat h0 x_101111));
qsquare_times_in_place x210 2ul;
qmul x210 x210 x_11;
let h4 = ST.get () in
assert (qmont_as_nat h4 x210 == // x230
S.qmul (SI.qsquare_times (qmont_as_nat h3 x210) 2) (qmont_as_nat h0 x_11));
qsquare_times_in_place x210 5ul;
qmul x210 x210 x_11;
let h5 = ST.get () in
assert (qmont_as_nat h5 x210 == // x235
S.qmul (SI.qsquare_times (qmont_as_nat h4 x210) 5) (qmont_as_nat h0 x_11));
qsquare_times_in_place x210 5ul;
qmul x210 x210 x_11;
let h6 = ST.get () in
assert (qmont_as_nat h6 x210 == // x240
S.qmul (SI.qsquare_times (qmont_as_nat h5 x210) 5) (qmont_as_nat h0 x_11))
inline_for_extraction noextract
val qinv_x240_x256 (x240 x_1111 x_10101 a:felem) : Stack unit
(requires fun h ->
live h x240 /\ live h x_1111 /\ live h x_10101 /\ live h a /\
disjoint x240 x_1111 /\ disjoint x240 x_10101 /\ disjoint x240 a /\
as_nat h x240 < S.order /\ as_nat h x_1111 < S.order /\
as_nat h x_10101 < S.order /\ as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc x240) h0 h1 /\
as_nat h1 x240 < S.order /\
qmont_as_nat h1 x240 = SI.qinv_x240_x256 (qmont_as_nat h0 a)
(qmont_as_nat h0 x240) (qmont_as_nat h0 x_1111) (qmont_as_nat h0 x_10101)) | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
x240: Hacl.Impl.P256.Bignum.felem ->
x_1111: Hacl.Impl.P256.Bignum.felem ->
x_10101: Hacl.Impl.P256.Bignum.felem ->
a: Hacl.Impl.P256.Bignum.felem
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.P256.Bignum.felem",
"Prims._assert",
"Prims.eq2",
"Spec.P256.PointOps.qelem",
"Hacl.Impl.P256.Scalar.qmont_as_nat",
"Spec.P256.PointOps.qmul",
"Hacl.Spec.P256.Qinv.qsquare_times",
"Prims.unit",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Hacl.Impl.P256.Scalar.qmul",
"Hacl.Impl.P256.Qinv.qsquare_times_in_place",
"FStar.UInt32.__uint_to_t"
] | [] | false | true | false | false | false | let qinv_x240_x256 x240 x_1111 x_10101 a =
| let h0 = ST.get () in
qsquare_times_in_place x240 3ul;
qmul x240 x240 a;
let h1 = ST.get () in
assert (qmont_as_nat h1 x240 ==
S.qmul (SI.qsquare_times (qmont_as_nat h0 x240) 3) (qmont_as_nat h0 a));
qsquare_times_in_place x240 7ul;
qmul x240 x240 x_10101;
let h2 = ST.get () in
assert (qmont_as_nat h2 x240 ==
S.qmul (SI.qsquare_times (qmont_as_nat h1 x240) 7) (qmont_as_nat h0 x_10101));
qsquare_times_in_place x240 6ul;
qmul x240 x240 x_1111;
let h3 = ST.get () in
assert (qmont_as_nat h3 x240 ==
S.qmul (SI.qsquare_times (qmont_as_nat h2 x240) 6) (qmont_as_nat h0 x_1111)) | false |
Hacl.Impl.P256.Qinv.fst | Hacl.Impl.P256.Qinv.qinv_x177_x210 | val qinv_x177_x210 (x177 x_111 x_1111 a:felem) : Stack unit
(requires fun h ->
live h x177 /\ live h x_111 /\ live h x_1111 /\ live h a /\
disjoint x177 x_111 /\ disjoint x177 x_1111 /\ disjoint x177 a /\
as_nat h x177 < S.order /\ as_nat h x_111 < S.order /\
as_nat h x_1111 < S.order /\ as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc x177) h0 h1 /\
as_nat h1 x177 < S.order /\
qmont_as_nat h1 x177 = SI.qinv_x177_x210 (qmont_as_nat h0 a)
(qmont_as_nat h0 x177) (qmont_as_nat h0 x_111) (qmont_as_nat h0 x_1111)) | val qinv_x177_x210 (x177 x_111 x_1111 a:felem) : Stack unit
(requires fun h ->
live h x177 /\ live h x_111 /\ live h x_1111 /\ live h a /\
disjoint x177 x_111 /\ disjoint x177 x_1111 /\ disjoint x177 a /\
as_nat h x177 < S.order /\ as_nat h x_111 < S.order /\
as_nat h x_1111 < S.order /\ as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc x177) h0 h1 /\
as_nat h1 x177 < S.order /\
qmont_as_nat h1 x177 = SI.qinv_x177_x210 (qmont_as_nat h0 a)
(qmont_as_nat h0 x177) (qmont_as_nat h0 x_111) (qmont_as_nat h0 x_1111)) | let qinv_x177_x210 x177 x_111 x_1111 a =
let h0 = ST.get () in
qsquare_times_in_place x177 6ul;
qmul x177 x177 x_1111;
let h1 = ST.get () in
assert (qmont_as_nat h1 x177 == // x183
S.qmul (SI.qsquare_times (qmont_as_nat h0 x177) 6) (qmont_as_nat h0 x_1111));
qsquare_times_in_place x177 2ul;
qmul x177 x177 a;
let h2 = ST.get () in
assert (qmont_as_nat h2 x177 == // x185
S.qmul (SI.qsquare_times (qmont_as_nat h1 x177) 2) (qmont_as_nat h0 a));
qsquare_times_in_place x177 5ul;
qmul x177 x177 a;
let h3 = ST.get () in
assert (qmont_as_nat h3 x177 == // x190
S.qmul (SI.qsquare_times (qmont_as_nat h2 x177) 5) (qmont_as_nat h0 a));
qsquare_times_in_place x177 6ul;
qmul x177 x177 x_1111;
let h4 = ST.get () in
assert (qmont_as_nat h4 x177 == // x196
S.qmul (SI.qsquare_times (qmont_as_nat h3 x177) 6) (qmont_as_nat h0 x_1111));
qsquare_times_in_place x177 5ul;
qmul x177 x177 x_111;
let h5 = ST.get () in
assert (qmont_as_nat h5 x177 == // x201
S.qmul (SI.qsquare_times (qmont_as_nat h4 x177) 5) (qmont_as_nat h0 x_111));
qsquare_times_in_place x177 4ul;
qmul x177 x177 x_111;
let h6 = ST.get () in
assert (qmont_as_nat h6 x177 == // x205
S.qmul (SI.qsquare_times (qmont_as_nat h5 x177) 4) (qmont_as_nat h0 x_111));
qsquare_times_in_place x177 5ul;
qmul x177 x177 x_111;
let h7 = ST.get () in
assert (qmont_as_nat h7 x177 == // x210
S.qmul (SI.qsquare_times (qmont_as_nat h6 x177) 5) (qmont_as_nat h0 x_111)) | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Qinv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 79,
"end_line": 295,
"start_col": 0,
"start_line": 253
} | module Hacl.Impl.P256.Qinv
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.P256.Bignum
open Hacl.Impl.P256.Scalar
module SE = Spec.Exponentiation
module BE = Hacl.Impl.Exponentiation
module BD = Hacl.Spec.Bignum.Definitions
module LSeq = Lib.Sequence
module S = Spec.P256
module SI = Hacl.Spec.P256.Qinv
module SM = Hacl.Spec.P256.Montgomery
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
unfold
let linv_ctx (a:LSeq.lseq uint64 0) : Type0 = True
unfold
let linv (a:LSeq.lseq uint64 4) : Type0 =
BD.bn_v a < S.order
unfold
let refl (a:LSeq.lseq uint64 4{linv a}) : GTot S.qelem =
SM.from_qmont (BD.bn_v a)
inline_for_extraction noextract
let mk_to_p256_order_comm_monoid : BE.to_comm_monoid U64 4ul 0ul = {
BE.a_spec = S.qelem;
BE.comm_monoid = SI.nat_mod_comm_monoid;
BE.linv_ctx = linv_ctx;
BE.linv = linv;
BE.refl = refl;
}
inline_for_extraction noextract
val one_mod : BE.lone_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let one_mod ctx one = make_qone one
inline_for_extraction noextract
val mul_mod : BE.lmul_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let mul_mod ctx x y xy = qmul xy x y
inline_for_extraction noextract
val sqr_mod : BE.lsqr_st U64 4ul 0ul mk_to_p256_order_comm_monoid
let sqr_mod ctx x xx = qsqr xx x
inline_for_extraction noextract
let mk_p256_order_concrete_ops : BE.concrete_ops U64 4ul 0ul = {
BE.to = mk_to_p256_order_comm_monoid;
BE.lone = one_mod;
BE.lmul = mul_mod;
BE.lsqr = sqr_mod;
}
inline_for_extraction noextract
val qsquare_times_in_place (out:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ as_nat h out < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 out) (v b))
let qsquare_times_in_place out b =
let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 out) (v b);
BE.lexp_pow2_in_place 4ul 0ul mk_p256_order_concrete_ops (null uint64) out b
inline_for_extraction noextract
val qsquare_times (out a:felem) (b:size_t) : Stack unit
(requires fun h ->
live h out /\ live h a /\ disjoint out a /\
as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
as_nat h1 out < S.order /\
qmont_as_nat h1 out == SI.qsquare_times (qmont_as_nat h0 a) (v b))
let qsquare_times out a b =
let h0 = ST.get () in
SE.exp_pow2_lemma SI.mk_nat_mod_concrete_ops (qmont_as_nat h0 a) (v b);
BE.lexp_pow2 4ul 0ul mk_p256_order_concrete_ops (null uint64) a b out
// x6 can be modified
// x_11 cannot be modified
inline_for_extraction noextract
val qinv_x8_x128 (x128 x6 x_11:felem) : Stack unit
(requires fun h ->
live h x128 /\ live h x6 /\ live h x_11 /\
disjoint x128 x6 /\ disjoint x128 x_11 /\ disjoint x6 x_11 /\
as_nat h x6 < S.order /\ as_nat h x_11 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x128 |+| loc x6) h0 h1 /\
as_nat h1 x128 < S.order /\
qmont_as_nat h1 x128 = SI.qinv_x8_x128 (qmont_as_nat h0 x6) (qmont_as_nat h0 x_11))
let qinv_x8_x128 x128 x6 x_11 =
let h0 = ST.get () in
qsquare_times_in_place x6 2ul;
qmul x6 x6 x_11;
let h1 = ST.get () in
assert (qmont_as_nat h1 x6 == // x8
S.qmul (SI.qsquare_times (qmont_as_nat h0 x6) 2) (qmont_as_nat h0 x_11));
qsquare_times x128 x6 8ul;
qmul x128 x128 x6;
let h2 = ST.get () in
assert (qmont_as_nat h2 x128 == // x16
S.qmul (SI.qsquare_times (qmont_as_nat h1 x6) 8) (qmont_as_nat h1 x6));
qsquare_times x6 x128 16ul;
qmul x6 x6 x128;
let h3 = ST.get () in
assert (qmont_as_nat h3 x6 == // x32
S.qmul (SI.qsquare_times (qmont_as_nat h2 x128) 16) (qmont_as_nat h2 x128));
qsquare_times x128 x6 64ul;
qmul x128 x128 x6;
let h4 = ST.get () in
assert (qmont_as_nat h4 x128 == // x96
S.qmul (SI.qsquare_times (qmont_as_nat h3 x6) 64) (qmont_as_nat h3 x6));
qsquare_times_in_place x128 32ul;
qmul x128 x128 x6;
let h5 = ST.get () in
assert (qmont_as_nat h5 x128 == // x128
S.qmul (SI.qsquare_times (qmont_as_nat h4 x128) 32) (qmont_as_nat h3 x6))
// x128 can be modified
inline_for_extraction noextract
val qinv_x134_x153 (x128 x_11 x_111 x_1111 x_10101 x_101111:felem) : Stack unit
(requires fun h ->
live h x128 /\ live h x_11 /\ live h x_111 /\
live h x_1111 /\ live h x_10101 /\ live h x_101111 /\
disjoint x128 x_11 /\ disjoint x128 x_111 /\ disjoint x128 x_1111 /\
disjoint x128 x_10101 /\ disjoint x128 x_101111 /\
as_nat h x128 < S.order /\ as_nat h x_11 < S.order /\
as_nat h x_111 < S.order /\ as_nat h x_1111 < S.order /\
as_nat h x_10101 < S.order /\ as_nat h x_101111 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x128) h0 h1 /\
as_nat h1 x128 < S.order /\
qmont_as_nat h1 x128 = SI.qinv_x134_x153
(qmont_as_nat h0 x128) (qmont_as_nat h0 x_11) (qmont_as_nat h0 x_111)
(qmont_as_nat h0 x_1111) (qmont_as_nat h0 x_10101) (qmont_as_nat h0 x_101111))
let qinv_x134_x153 x128 x_11 x_111 x_1111 x_10101 x_101111 =
let h0 = ST.get () in
qsquare_times_in_place x128 6ul;
qmul x128 x128 x_101111;
let h1 = ST.get () in
assert (qmont_as_nat h1 x128 == // x134
S.qmul (SI.qsquare_times (qmont_as_nat h0 x128) 6) (qmont_as_nat h0 x_101111));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_111;
let h2 = ST.get () in
assert (qmont_as_nat h2 x128 == // x139
S.qmul (SI.qsquare_times (qmont_as_nat h1 x128) 5) (qmont_as_nat h0 x_111));
qsquare_times_in_place x128 4ul;
qmul x128 x128 x_11;
let h3 = ST.get () in
assert (qmont_as_nat h3 x128 == // x143
S.qmul (SI.qsquare_times (qmont_as_nat h2 x128) 4) (qmont_as_nat h0 x_11));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_1111;
let h4 = ST.get () in
assert (qmont_as_nat h4 x128 == // x148
S.qmul (SI.qsquare_times (qmont_as_nat h3 x128) 5) (qmont_as_nat h0 x_1111));
qsquare_times_in_place x128 5ul;
qmul x128 x128 x_10101;
let h5 = ST.get () in
assert (qmont_as_nat h5 x128 == // x153
S.qmul (SI.qsquare_times (qmont_as_nat h4 x128) 5) (qmont_as_nat h0 x_10101))
// x153 can be modified
inline_for_extraction noextract
val qinv_x153_x177 (x153 x_101 x_111 x_101111:felem) : Stack unit
(requires fun h ->
live h x153 /\ live h x_101 /\ live h x_111 /\ live h x_101111 /\
disjoint x153 x_101 /\ disjoint x153 x_111 /\ disjoint x153 x_101111 /\
as_nat h x153 < S.order /\ as_nat h x_101 < S.order /\
as_nat h x_111 < S.order /\ as_nat h x_101111 < S.order)
(ensures fun h0 _ h1 -> modifies (loc x153) h0 h1 /\
as_nat h1 x153 < S.order /\
qmont_as_nat h1 x153 = SI.qinv_x153_x177 (qmont_as_nat h0 x153)
(qmont_as_nat h0 x_101) (qmont_as_nat h0 x_111) (qmont_as_nat h0 x_101111))
let qinv_x153_x177 x153 x_101 x_111 x_101111 =
let h0 = ST.get () in
qsquare_times_in_place x153 4ul;
qmul x153 x153 x_101;
let h1 = ST.get () in
assert (qmont_as_nat h1 x153 == // x157
S.qmul (SI.qsquare_times (qmont_as_nat h0 x153) 4) (qmont_as_nat h0 x_101));
qsquare_times_in_place x153 3ul;
qmul x153 x153 x_101;
let h2 = ST.get () in
assert (qmont_as_nat h2 x153 == // x160
S.qmul (SI.qsquare_times (qmont_as_nat h1 x153) 3) (qmont_as_nat h0 x_101));
qsquare_times_in_place x153 3ul;
qmul x153 x153 x_101;
let h3 = ST.get () in
assert (qmont_as_nat h3 x153 == // x163
S.qmul (SI.qsquare_times (qmont_as_nat h2 x153) 3) (qmont_as_nat h0 x_101));
qsquare_times_in_place x153 5ul;
qmul x153 x153 x_111;
let h4 = ST.get () in
assert (qmont_as_nat h4 x153 == // x168
S.qmul (SI.qsquare_times (qmont_as_nat h3 x153) 5) (qmont_as_nat h0 x_111));
qsquare_times_in_place x153 9ul;
qmul x153 x153 x_101111;
let h5 = ST.get () in
assert (qmont_as_nat h5 x153 == // x177
S.qmul (SI.qsquare_times (qmont_as_nat h4 x153) 9) (qmont_as_nat h0 x_101111))
// x153 can be modified
inline_for_extraction noextract
val qinv_x177_x210 (x177 x_111 x_1111 a:felem) : Stack unit
(requires fun h ->
live h x177 /\ live h x_111 /\ live h x_1111 /\ live h a /\
disjoint x177 x_111 /\ disjoint x177 x_1111 /\ disjoint x177 a /\
as_nat h x177 < S.order /\ as_nat h x_111 < S.order /\
as_nat h x_1111 < S.order /\ as_nat h a < S.order)
(ensures fun h0 _ h1 -> modifies (loc x177) h0 h1 /\
as_nat h1 x177 < S.order /\
qmont_as_nat h1 x177 = SI.qinv_x177_x210 (qmont_as_nat h0 a)
(qmont_as_nat h0 x177) (qmont_as_nat h0 x_111) (qmont_as_nat h0 x_1111)) | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.P256.Qinv.fst.checked",
"Hacl.Spec.P256.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Impl.P256.Scalar.fsti.checked",
"Hacl.Impl.P256.Bignum.fsti.checked",
"Hacl.Impl.Exponentiation.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Impl.P256.Qinv.fst"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Montgomery",
"short_module": "SM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.P256.Qinv",
"short_module": "SI"
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Scalar",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
x177: Hacl.Impl.P256.Bignum.felem ->
x_111: Hacl.Impl.P256.Bignum.felem ->
x_1111: Hacl.Impl.P256.Bignum.felem ->
a: Hacl.Impl.P256.Bignum.felem
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.P256.Bignum.felem",
"Prims._assert",
"Prims.eq2",
"Spec.P256.PointOps.qelem",
"Hacl.Impl.P256.Scalar.qmont_as_nat",
"Spec.P256.PointOps.qmul",
"Hacl.Spec.P256.Qinv.qsquare_times",
"Prims.unit",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Hacl.Impl.P256.Scalar.qmul",
"Hacl.Impl.P256.Qinv.qsquare_times_in_place",
"FStar.UInt32.__uint_to_t"
] | [] | false | true | false | false | false | let qinv_x177_x210 x177 x_111 x_1111 a =
| let h0 = ST.get () in
qsquare_times_in_place x177 6ul;
qmul x177 x177 x_1111;
let h1 = ST.get () in
assert (qmont_as_nat h1 x177 ==
S.qmul (SI.qsquare_times (qmont_as_nat h0 x177) 6) (qmont_as_nat h0 x_1111));
qsquare_times_in_place x177 2ul;
qmul x177 x177 a;
let h2 = ST.get () in
assert (qmont_as_nat h2 x177 ==
S.qmul (SI.qsquare_times (qmont_as_nat h1 x177) 2) (qmont_as_nat h0 a));
qsquare_times_in_place x177 5ul;
qmul x177 x177 a;
let h3 = ST.get () in
assert (qmont_as_nat h3 x177 ==
S.qmul (SI.qsquare_times (qmont_as_nat h2 x177) 5) (qmont_as_nat h0 a));
qsquare_times_in_place x177 6ul;
qmul x177 x177 x_1111;
let h4 = ST.get () in
assert (qmont_as_nat h4 x177 ==
S.qmul (SI.qsquare_times (qmont_as_nat h3 x177) 6) (qmont_as_nat h0 x_1111));
qsquare_times_in_place x177 5ul;
qmul x177 x177 x_111;
let h5 = ST.get () in
assert (qmont_as_nat h5 x177 ==
S.qmul (SI.qsquare_times (qmont_as_nat h4 x177) 5) (qmont_as_nat h0 x_111));
qsquare_times_in_place x177 4ul;
qmul x177 x177 x_111;
let h6 = ST.get () in
assert (qmont_as_nat h6 x177 ==
S.qmul (SI.qsquare_times (qmont_as_nat h5 x177) 4) (qmont_as_nat h0 x_111));
qsquare_times_in_place x177 5ul;
qmul x177 x177 x_111;
let h7 = ST.get () in
assert (qmont_as_nat h7 x177 ==
S.qmul (SI.qsquare_times (qmont_as_nat h6 x177) 5) (qmont_as_nat h0 x_111)) | false |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.