effect
stringclasses 48
values | original_source_type
stringlengths 0
23k
| opens_and_abbrevs
listlengths 2
92
| isa_cross_project_example
bool 1
class | source_definition
stringlengths 9
57.9k
| partial_definition
stringlengths 7
23.3k
| is_div
bool 2
classes | is_type
null | is_proof
bool 2
classes | completed_definiton
stringlengths 1
250k
| dependencies
dict | effect_flags
sequencelengths 0
2
| ideal_premises
sequencelengths 0
236
| mutual_with
sequencelengths 0
11
| file_context
stringlengths 0
407k
| interleaved
bool 1
class | is_simply_typed
bool 2
classes | file_name
stringlengths 5
48
| vconfig
dict | is_simple_lemma
null | source_type
stringlengths 10
23k
| proof_features
sequencelengths 0
1
| name
stringlengths 8
95
| source
dict | verbose_type
stringlengths 1
7.42k
| source_range
dict |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FStar.ST.ST | val of_seq (#a:Type0) (s:seq a)
: ST (array a)
(requires fun _ -> True)
(ensures create_post s) | [
{
"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
}
] | false | let of_seq #a s = ST.alloc s | val of_seq (#a:Type0) (s:seq a)
: ST (array a)
(requires fun _ -> True)
(ensures create_post s)
let of_seq #a s = | true | null | false | ST.alloc s | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"FStar.Seq.Base.seq",
"FStar.ST.alloc",
"FStar.Heap.trivial_preorder",
"FStar.ST.mref",
"FStar.Array.array"
] | [] | (*
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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr
let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2') | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val of_seq (#a:Type0) (s:seq a)
: ST (array a)
(requires fun _ -> True)
(ensures create_post s) | [] | FStar.Array.of_seq | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | s: FStar.Seq.Base.seq a -> FStar.ST.ST (FStar.Array.array a) | {
"end_col": 28,
"end_line": 37,
"start_col": 18,
"start_line": 37
} |
FStar.ST.ST | val to_seq (#a:Type0) (s:array a)
: ST (seq a)
(requires (fun h -> contains h s))
(ensures (fun h0 x h1 -> (sel h0 s == x /\ h0 == h1))) | [
{
"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
}
] | false | let to_seq #a s = !s | val to_seq (#a:Type0) (s:array a)
: ST (seq a)
(requires (fun h -> contains h s))
(ensures (fun h0 x h1 -> (sel h0 s == x /\ h0 == h1)))
let to_seq #a s = | true | null | false | !s | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"FStar.Array.array",
"FStar.Ref.op_Bang",
"FStar.Seq.Base.seq"
] | [] | (*
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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr
let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2')
let of_seq #a s = ST.alloc s | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val to_seq (#a:Type0) (s:array a)
: ST (seq a)
(requires (fun h -> contains h s))
(ensures (fun h0 x h1 -> (sel h0 s == x /\ h0 == h1))) | [] | FStar.Array.to_seq | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | s: FStar.Array.array a -> FStar.ST.ST (FStar.Seq.Base.seq a) | {
"end_col": 20,
"end_line": 39,
"start_col": 18,
"start_line": 39
} |
FStar.ST.ST | val index (#a:Type0) (x:array a) (n:nat)
: ST a
(requires (fun h -> contains h x /\ n < Seq.length (sel h x)))
(ensures (fun h0 v h1 -> n < Seq.length (sel h0 x) /\
h0 == h1 /\
v == Seq.index (sel h0 x) n)) | [
{
"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
}
] | false | let index #a x n =
let s = to_seq x in
Seq.index s n | val index (#a:Type0) (x:array a) (n:nat)
: ST a
(requires (fun h -> contains h x /\ n < Seq.length (sel h x)))
(ensures (fun h0 v h1 -> n < Seq.length (sel h0 x) /\
h0 == h1 /\
v == Seq.index (sel h0 x) n))
let index #a x n = | true | null | false | let s = to_seq x in
Seq.index s n | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"FStar.Array.array",
"Prims.nat",
"FStar.Seq.Base.index",
"FStar.Seq.Base.seq",
"FStar.Array.to_seq"
] | [] | (*
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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr
let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2')
let of_seq #a s = ST.alloc s
let to_seq #a s = !s
let of_list #a l = of_seq (Seq.seq_of_list l)
let create #a n init = ST.alloc (Seq.create n init) | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val index (#a:Type0) (x:array a) (n:nat)
: ST a
(requires (fun h -> contains h x /\ n < Seq.length (sel h x)))
(ensures (fun h0 v h1 -> n < Seq.length (sel h0 x) /\
h0 == h1 /\
v == Seq.index (sel h0 x) n)) | [] | FStar.Array.index | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | x: FStar.Array.array a -> n: Prims.nat -> FStar.ST.ST a | {
"end_col": 15,
"end_line": 47,
"start_col": 18,
"start_line": 45
} |
FStar.ST.ST | val length (#a:Type0) (x:array a)
: ST nat
(requires (fun h -> contains h x))
(ensures (fun h0 y h1 -> y = length (sel h0 x) /\ h0 == h1)) | [
{
"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
}
] | false | let length #a x = let s = !x in Seq.length s | val length (#a:Type0) (x:array a)
: ST nat
(requires (fun h -> contains h x))
(ensures (fun h0 y h1 -> y = length (sel h0 x) /\ h0 == h1))
let length #a x = | true | null | false | let s = !x in
Seq.length s | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"FStar.Array.array",
"FStar.Seq.Base.length",
"Prims.nat",
"FStar.Seq.Base.seq",
"FStar.Ref.op_Bang"
] | [] | (*
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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr
let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2')
let of_seq #a s = ST.alloc s
let to_seq #a s = !s
let of_list #a l = of_seq (Seq.seq_of_list l)
let create #a n init = ST.alloc (Seq.create n init)
let index #a x n =
let s = to_seq x in
Seq.index s n
let upd #a x n v =
let s = !x in
let s' = Seq.upd s n v in
x:= s' | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val length (#a:Type0) (x:array a)
: ST nat
(requires (fun h -> contains h x))
(ensures (fun h0 y h1 -> y = length (sel h0 x) /\ h0 == h1)) | [] | FStar.Array.length | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | x: FStar.Array.array a -> FStar.ST.ST Prims.nat | {
"end_col": 44,
"end_line": 54,
"start_col": 17,
"start_line": 54
} |
FStar.ST.ST | 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)) | [
{
"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
}
] | false | let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2') | 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))
let op_At_Bar #a s1 s2 = | true | null | false | let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2') | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"FStar.Array.array",
"FStar.ST.alloc",
"FStar.Seq.Base.seq",
"FStar.Heap.trivial_preorder",
"FStar.Seq.Base.append",
"FStar.ST.mref",
"FStar.Ref.op_Bang"
] | [] | (*
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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val 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)) | [] | FStar.Array.op_At_Bar | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | s1: FStar.Array.array a -> s2: FStar.Array.array a -> FStar.ST.ST (FStar.Array.array a) | {
"end_col": 31,
"end_line": 35,
"start_col": 24,
"start_line": 32
} |
FStar.ST.ST | val upd (#a:Type0) (x:array a) (n:nat) (v:a)
:ST unit
(requires (fun h -> contains h x /\ n < Seq.length (sel h x)))
(ensures (fun h0 u h1 -> n < Seq.length (sel h0 x) /\
contains h1 x /\
modifies (Set.singleton (addr_of x)) h0 h1 /\
sel h1 x == Seq.upd (sel h0 x) n v)) | [
{
"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
}
] | false | let upd #a x n v =
let s = !x in
let s' = Seq.upd s n v in
x:= s' | val upd (#a:Type0) (x:array a) (n:nat) (v:a)
:ST unit
(requires (fun h -> contains h x /\ n < Seq.length (sel h x)))
(ensures (fun h0 u h1 -> n < Seq.length (sel h0 x) /\
contains h1 x /\
modifies (Set.singleton (addr_of x)) h0 h1 /\
sel h1 x == Seq.upd (sel h0 x) n v))
let upd #a x n v = | true | null | false | let s = !x in
let s' = Seq.upd s n v in
x := s' | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"FStar.Array.array",
"Prims.nat",
"FStar.Ref.op_Colon_Equals",
"FStar.Seq.Base.seq",
"Prims.unit",
"FStar.Seq.Base.upd",
"FStar.Ref.op_Bang"
] | [] | (*
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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr
let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2')
let of_seq #a s = ST.alloc s
let to_seq #a s = !s
let of_list #a l = of_seq (Seq.seq_of_list l)
let create #a n init = ST.alloc (Seq.create n init)
let index #a x n =
let s = to_seq x in
Seq.index s n | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val upd (#a:Type0) (x:array a) (n:nat) (v:a)
:ST unit
(requires (fun h -> contains h x /\ n < Seq.length (sel h x)))
(ensures (fun h0 u h1 -> n < Seq.length (sel h0 x) /\
contains h1 x /\
modifies (Set.singleton (addr_of x)) h0 h1 /\
sel h1 x == Seq.upd (sel h0 x) n v)) | [] | FStar.Array.upd | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | x: FStar.Array.array a -> n: Prims.nat -> v: a -> FStar.ST.ST Prims.unit | {
"end_col": 8,
"end_line": 52,
"start_col": 18,
"start_line": 49
} |
FStar.ST.ST | val op (#a:Type0) (f:seq a -> seq a) (x:array a)
: ST unit
(requires (fun h -> contains h x))
(ensures (fun h0 u h1 -> modifies (Set.singleton (addr_of x)) h0 h1 /\ sel h1 x == f (sel h0 x))) | [
{
"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
}
] | false | let op #a f x =
let s = !x in
let s' = f s in
x := s' | val op (#a:Type0) (f:seq a -> seq a) (x:array a)
: ST unit
(requires (fun h -> contains h x))
(ensures (fun h0 u h1 -> modifies (Set.singleton (addr_of x)) h0 h1 /\ sel h1 x == f (sel h0 x)))
let op #a f x = | true | null | false | let s = !x in
let s' = f s in
x := s' | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"FStar.Seq.Base.seq",
"FStar.Array.array",
"FStar.Ref.op_Colon_Equals",
"Prims.unit",
"FStar.Ref.op_Bang"
] | [] | (*
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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr
let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2')
let of_seq #a s = ST.alloc s
let to_seq #a s = !s
let of_list #a l = of_seq (Seq.seq_of_list l)
let create #a n init = ST.alloc (Seq.create n init)
let index #a x n =
let s = to_seq x in
Seq.index s n
let upd #a x n v =
let s = !x in
let s' = Seq.upd s n v in
x:= s'
let length #a x = let s = !x in Seq.length s | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op (#a:Type0) (f:seq a -> seq a) (x:array a)
: ST unit
(requires (fun h -> contains h x))
(ensures (fun h0 u h1 -> modifies (Set.singleton (addr_of x)) h0 h1 /\ sel h1 x == f (sel h0 x))) | [] | FStar.Array.op | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | f: (_: FStar.Seq.Base.seq a -> FStar.Seq.Base.seq a) -> x: FStar.Array.array a
-> FStar.ST.ST Prims.unit | {
"end_col": 9,
"end_line": 59,
"start_col": 15,
"start_line": 56
} |
FStar.ST.ST | val create (#a:Type0) (n:nat) (init:a)
: ST (array a)
(requires (fun h -> True))
(ensures (fun h0 x h1 -> x `unused_in` h0 /\
contains h1 x /\
modifies Set.empty h0 h1 /\
sel h1 x == Seq.create n init)) | [
{
"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
}
] | false | let create #a n init = ST.alloc (Seq.create n init) | val create (#a:Type0) (n:nat) (init:a)
: ST (array a)
(requires (fun h -> True))
(ensures (fun h0 x h1 -> x `unused_in` h0 /\
contains h1 x /\
modifies Set.empty h0 h1 /\
sel h1 x == Seq.create n init))
let create #a n init = | true | null | false | ST.alloc (Seq.create n init) | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"Prims.nat",
"FStar.ST.alloc",
"FStar.Seq.Base.seq",
"FStar.Heap.trivial_preorder",
"FStar.Seq.Base.create",
"FStar.ST.mref",
"FStar.Array.array"
] | [] | (*
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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr
let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2')
let of_seq #a s = ST.alloc s
let to_seq #a s = !s
let of_list #a l = of_seq (Seq.seq_of_list l) | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val create (#a:Type0) (n:nat) (init:a)
: ST (array a)
(requires (fun h -> True))
(ensures (fun h0 x h1 -> x `unused_in` h0 /\
contains h1 x /\
modifies Set.empty h0 h1 /\
sel h1 x == Seq.create n init)) | [] | FStar.Array.create | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | n: Prims.nat -> init: a -> FStar.ST.ST (FStar.Array.array a) | {
"end_col": 51,
"end_line": 43,
"start_col": 23,
"start_line": 43
} |
FStar.ST.ST | val swap (#a:Type0) (x:array a) (i:nat) (j:nat{i <= j})
: ST unit
(requires (fun h -> contains h x /\ j < Seq.length (sel h x)))
(ensures (fun h0 _u h1 -> j < Seq.length (sel h0 x) /\
contains h1 x /\
modifies (Set.singleton (addr_of x)) h0 h1 /\
sel h1 x == Seq.swap (sel h0 x) i j)) | [
{
"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
}
] | false | let swap #a x i j =
let tmpi = index x i in
let tmpj = index x j in
upd x j tmpi;
upd x i tmpj | val swap (#a:Type0) (x:array a) (i:nat) (j:nat{i <= j})
: ST unit
(requires (fun h -> contains h x /\ j < Seq.length (sel h x)))
(ensures (fun h0 _u h1 -> j < Seq.length (sel h0 x) /\
contains h1 x /\
modifies (Set.singleton (addr_of x)) h0 h1 /\
sel h1 x == Seq.swap (sel h0 x) i j))
let swap #a x i j = | true | null | false | let tmpi = index x i in
let tmpj = index x j in
upd x j tmpi;
upd x i tmpj | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"FStar.Array.array",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.Array.upd",
"Prims.unit",
"FStar.Array.index"
] | [] | (*
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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr
let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2')
let of_seq #a s = ST.alloc s
let to_seq #a s = !s
let of_list #a l = of_seq (Seq.seq_of_list l)
let create #a n init = ST.alloc (Seq.create n init)
let index #a x n =
let s = to_seq x in
Seq.index s n
let upd #a x n v =
let s = !x in
let s' = Seq.upd s n v in
x:= s'
let length #a x = let s = !x in Seq.length s
let op #a f x =
let s = !x in
let s' = f s in
x := s' | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val swap (#a:Type0) (x:array a) (i:nat) (j:nat{i <= j})
: ST unit
(requires (fun h -> contains h x /\ j < Seq.length (sel h x)))
(ensures (fun h0 _u h1 -> j < Seq.length (sel h0 x) /\
contains h1 x /\
modifies (Set.singleton (addr_of x)) h0 h1 /\
sel h1 x == Seq.swap (sel h0 x) i j)) | [] | FStar.Array.swap | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | x: FStar.Array.array a -> i: Prims.nat -> j: Prims.nat{i <= j} -> FStar.ST.ST Prims.unit | {
"end_col": 14,
"end_line": 65,
"start_col": 19,
"start_line": 61
} |
FStar.ST.ST | val copy (#a:Type0) (s:array a)
: ST (array a)
(requires (fun h -> contains h s /\ Seq.length (sel h s) > 0))
(ensures (fun h0 r h1 -> modifies Set.empty h0 h1 /\
r `unused_in` h0 /\
contains h1 r /\
sel h1 r == sel h0 s)) | [
{
"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
}
] | false | let copy #a s =
let cpy = create (length s) (index s 0) in
copy_aux s cpy 0;
cpy | val copy (#a:Type0) (s:array a)
: ST (array a)
(requires (fun h -> contains h s /\ Seq.length (sel h s) > 0))
(ensures (fun h0 r h1 -> modifies Set.empty h0 h1 /\
r `unused_in` h0 /\
contains h1 r /\
sel h1 r == sel h0 s))
let copy #a s = | true | null | false | let cpy = create (length s) (index s 0) in
copy_aux s cpy 0;
cpy | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"FStar.Array.array",
"Prims.unit",
"FStar.Array.copy_aux",
"FStar.Array.create",
"FStar.Array.index",
"Prims.nat",
"FStar.Array.length"
] | [] | (*
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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr
let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2')
let of_seq #a s = ST.alloc s
let to_seq #a s = !s
let of_list #a l = of_seq (Seq.seq_of_list l)
let create #a n init = ST.alloc (Seq.create n init)
let index #a x n =
let s = to_seq x in
Seq.index s n
let upd #a x n v =
let s = !x in
let s' = Seq.upd s n v in
x:= s'
let length #a x = let s = !x in Seq.length s
let op #a f x =
let s = !x in
let s' = f s in
x := s'
let swap #a x i j =
let tmpi = index x i in
let tmpj = index x j in
upd x j tmpi;
upd x i tmpj
val copy_aux:
#a:Type -> s:array a -> cpy:array a -> ctr:nat ->
ST unit
(requires (fun h -> (contains h s /\ contains h cpy /\ addr_of s <> addr_of cpy)
/\ (Seq.length (sel h cpy) = Seq.length (sel h s))
/\ (ctr <= Seq.length (sel h cpy))
/\ (forall (i:nat). i < ctr ==> Seq.index (sel h s) i == Seq.index (sel h cpy) i)))
(ensures (fun h0 u h1 -> (contains h1 s /\ contains h1 cpy /\ addr_of s <> addr_of cpy )
/\ (modifies (only cpy) h0 h1)
/\ (Seq.equal (sel h1 cpy) (sel h1 s))))
let rec copy_aux #a s cpy ctr =
match length cpy - ctr with
| 0 -> ()
| _ -> upd cpy ctr (index s ctr);
copy_aux s cpy (ctr+1) | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val copy (#a:Type0) (s:array a)
: ST (array a)
(requires (fun h -> contains h s /\ Seq.length (sel h s) > 0))
(ensures (fun h0 r h1 -> modifies Set.empty h0 h1 /\
r `unused_in` h0 /\
contains h1 r /\
sel h1 r == sel h0 s)) | [] | FStar.Array.copy | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | s: FStar.Array.array a -> FStar.ST.ST (FStar.Array.array a) | {
"end_col": 5,
"end_line": 86,
"start_col": 15,
"start_line": 83
} |
FStar.ST.ST | val sub (#a:Type0) (s:array a) (idx:nat) (len:nat)
: ST (array a)
(requires (fun h -> contains h s /\
Seq.length (sel h s) > 0 /\
idx + len <= Seq.length (sel h s)))
(ensures (fun h0 t h1 -> contains h1 t /\
t `unused_in` h0 /\
modifies Set.empty h0 h1 /\
Seq.slice (sel h0 s) idx (idx + len) == sel h1 t)) | [
{
"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
}
] | false | let sub #a s idx len =
let h0 = ST.get () in
let t = create len (index s 0) in
blit s idx t 0 len;
let h1 = ST.get () in
assert (Seq.equal (Seq.slice (sel h0 s) idx (idx + len)) (sel h1 t));
t | val sub (#a:Type0) (s:array a) (idx:nat) (len:nat)
: ST (array a)
(requires (fun h -> contains h s /\
Seq.length (sel h s) > 0 /\
idx + len <= Seq.length (sel h s)))
(ensures (fun h0 t h1 -> contains h1 t /\
t `unused_in` h0 /\
modifies Set.empty h0 h1 /\
Seq.slice (sel h0 s) idx (idx + len) == sel h1 t))
let sub #a s idx len = | true | null | false | let h0 = ST.get () in
let t = create len (index s 0) in
blit s idx t 0 len;
let h1 = ST.get () in
assert (Seq.equal (Seq.slice (sel h0 s) idx (idx + len)) (sel h1 t));
t | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"FStar.Array.array",
"Prims.nat",
"Prims.unit",
"Prims._assert",
"FStar.Seq.Base.equal",
"FStar.Seq.Base.slice",
"FStar.Array.sel",
"Prims.op_Addition",
"FStar.Monotonic.Heap.heap",
"FStar.ST.get",
"FStar.Array.blit",
"FStar.Array.create",
"FStar.Array.index"
] | [] | (*
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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr
let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2')
let of_seq #a s = ST.alloc s
let to_seq #a s = !s
let of_list #a l = of_seq (Seq.seq_of_list l)
let create #a n init = ST.alloc (Seq.create n init)
let index #a x n =
let s = to_seq x in
Seq.index s n
let upd #a x n v =
let s = !x in
let s' = Seq.upd s n v in
x:= s'
let length #a x = let s = !x in Seq.length s
let op #a f x =
let s = !x in
let s' = f s in
x := s'
let swap #a x i j =
let tmpi = index x i in
let tmpj = index x j in
upd x j tmpi;
upd x i tmpj
val copy_aux:
#a:Type -> s:array a -> cpy:array a -> ctr:nat ->
ST unit
(requires (fun h -> (contains h s /\ contains h cpy /\ addr_of s <> addr_of cpy)
/\ (Seq.length (sel h cpy) = Seq.length (sel h s))
/\ (ctr <= Seq.length (sel h cpy))
/\ (forall (i:nat). i < ctr ==> Seq.index (sel h s) i == Seq.index (sel h cpy) i)))
(ensures (fun h0 u h1 -> (contains h1 s /\ contains h1 cpy /\ addr_of s <> addr_of cpy )
/\ (modifies (only cpy) h0 h1)
/\ (Seq.equal (sel h1 cpy) (sel h1 s))))
let rec copy_aux #a s cpy ctr =
match length cpy - ctr with
| 0 -> ()
| _ -> upd cpy ctr (index s ctr);
copy_aux s cpy (ctr+1)
let copy #a s =
let cpy = create (length s) (index s 0) in
copy_aux s cpy 0;
cpy
private val blit_aux:
#a:Type -> s:array a -> s_idx:nat -> t:array a -> t_idx:nat -> len:nat -> ctr:nat ->
ST unit
(requires (fun h ->
(contains h s /\ contains h t /\ addr_of s <> addr_of t)
/\ (Seq.length (sel h s) >= s_idx + len)
/\ (Seq.length (sel h t) >= t_idx + len)
/\ (ctr <= len)
/\ (forall (i:nat).
i < ctr ==> Seq.index (sel h s) (s_idx+i) == Seq.index (sel h t) (t_idx+i))))
(ensures (fun h0 u h1 ->
(contains h1 s /\ contains h1 t /\ addr_of s <> addr_of t)
/\ (modifies (only t) h0 h1)
/\ (Seq.length (sel h1 s) >= s_idx + len)
/\ (Seq.length (sel h1 t) >= t_idx + len)
/\ (Seq.length (sel h0 s) = Seq.length (sel h1 s))
/\ (Seq.length (sel h0 t) = Seq.length (sel h1 t))
/\ (forall (i:nat).
i < len ==> Seq.index (sel h1 s) (s_idx+i) == Seq.index (sel h1 t) (t_idx+i))
/\ (forall (i:nat).
(i < Seq.length (sel h1 t) /\ (i < t_idx \/ i >= t_idx + len)) ==>
Seq.index (sel h1 t) i == Seq.index (sel h0 t) i) ))
#set-options "--z3rlimit 60"
let rec blit_aux #a s s_idx t t_idx len ctr =
match len - ctr with
| 0 -> ()
| _ -> upd t (t_idx + ctr) (index s (s_idx + ctr));
blit_aux s s_idx t t_idx len (ctr+1)
#set-options "--z3rlimit 5"
private val blit:
#a:Type -> s:array a -> s_idx:nat -> t:array a -> t_idx:nat -> len:nat ->
ST unit
(requires (fun h ->
(contains h s)
/\ (contains h t)
/\ (addr_of s <> addr_of t)
/\ (Seq.length (sel h s) >= s_idx + len)
/\ (Seq.length (sel h t) >= t_idx + len)))
(ensures (fun h0 u h1 ->
(contains h1 s /\ contains h1 t /\ addr_of s <> addr_of t)
/\ (Seq.length (sel h1 s) >= s_idx + len)
/\ (Seq.length (sel h1 t) >= t_idx + len)
/\ (Seq.length (sel h0 s) = Seq.length (sel h1 s))
/\ (Seq.length (sel h0 t) = Seq.length (sel h1 t))
/\ (modifies (only t) h0 h1)
/\ (forall (i:nat).
i < len ==> Seq.index (sel h1 s) (s_idx+i) == Seq.index (sel h1 t) (t_idx+i))
/\ (forall (i:nat).{:pattern (Seq.index (sel h1 t) i)}
(i < Seq.length (sel h1 t) /\ (i < t_idx \/ i >= t_idx + len)) ==>
(Seq.index (sel h1 t) i == Seq.index (sel h0 t) i)) ))
let blit #a s s_idx t t_idx len =
blit_aux s s_idx t t_idx len 0 | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 120,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val sub (#a:Type0) (s:array a) (idx:nat) (len:nat)
: ST (array a)
(requires (fun h -> contains h s /\
Seq.length (sel h s) > 0 /\
idx + len <= Seq.length (sel h s)))
(ensures (fun h0 t h1 -> contains h1 t /\
t `unused_in` h0 /\
modifies Set.empty h0 h1 /\
Seq.slice (sel h0 s) idx (idx + len) == sel h1 t)) | [] | FStar.Array.sub | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | s: FStar.Array.array a -> idx: Prims.nat -> len: Prims.nat -> FStar.ST.ST (FStar.Array.array a) | {
"end_col": 3,
"end_line": 150,
"start_col": 22,
"start_line": 144
} |
FStar.ST.ST | val copy_aux:
#a:Type -> s:array a -> cpy:array a -> ctr:nat ->
ST unit
(requires (fun h -> (contains h s /\ contains h cpy /\ addr_of s <> addr_of cpy)
/\ (Seq.length (sel h cpy) = Seq.length (sel h s))
/\ (ctr <= Seq.length (sel h cpy))
/\ (forall (i:nat). i < ctr ==> Seq.index (sel h s) i == Seq.index (sel h cpy) i)))
(ensures (fun h0 u h1 -> (contains h1 s /\ contains h1 cpy /\ addr_of s <> addr_of cpy )
/\ (modifies (only cpy) h0 h1)
/\ (Seq.equal (sel h1 cpy) (sel h1 s)))) | [
{
"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.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
}
] | false | let rec copy_aux #a s cpy ctr =
match length cpy - ctr with
| 0 -> ()
| _ -> upd cpy ctr (index s ctr);
copy_aux s cpy (ctr+1) | val copy_aux:
#a:Type -> s:array a -> cpy:array a -> ctr:nat ->
ST unit
(requires (fun h -> (contains h s /\ contains h cpy /\ addr_of s <> addr_of cpy)
/\ (Seq.length (sel h cpy) = Seq.length (sel h s))
/\ (ctr <= Seq.length (sel h cpy))
/\ (forall (i:nat). i < ctr ==> Seq.index (sel h s) i == Seq.index (sel h cpy) i)))
(ensures (fun h0 u h1 -> (contains h1 s /\ contains h1 cpy /\ addr_of s <> addr_of cpy )
/\ (modifies (only cpy) h0 h1)
/\ (Seq.equal (sel h1 cpy) (sel h1 s))))
let rec copy_aux #a s cpy ctr = | true | null | false | match length cpy - ctr with
| 0 -> ()
| _ ->
upd cpy ctr (index s ctr);
copy_aux s cpy (ctr + 1) | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"FStar.Array.array",
"Prims.nat",
"Prims.unit",
"Prims.int",
"FStar.Array.copy_aux",
"Prims.op_Addition",
"FStar.Array.upd",
"FStar.Array.index",
"Prims.op_Subtraction",
"FStar.Array.length"
] | [] | (*
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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr
let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2')
let of_seq #a s = ST.alloc s
let to_seq #a s = !s
let of_list #a l = of_seq (Seq.seq_of_list l)
let create #a n init = ST.alloc (Seq.create n init)
let index #a x n =
let s = to_seq x in
Seq.index s n
let upd #a x n v =
let s = !x in
let s' = Seq.upd s n v in
x:= s'
let length #a x = let s = !x in Seq.length s
let op #a f x =
let s = !x in
let s' = f s in
x := s'
let swap #a x i j =
let tmpi = index x i in
let tmpj = index x j in
upd x j tmpi;
upd x i tmpj
val copy_aux:
#a:Type -> s:array a -> cpy:array a -> ctr:nat ->
ST unit
(requires (fun h -> (contains h s /\ contains h cpy /\ addr_of s <> addr_of cpy)
/\ (Seq.length (sel h cpy) = Seq.length (sel h s))
/\ (ctr <= Seq.length (sel h cpy))
/\ (forall (i:nat). i < ctr ==> Seq.index (sel h s) i == Seq.index (sel h cpy) i)))
(ensures (fun h0 u h1 -> (contains h1 s /\ contains h1 cpy /\ addr_of s <> addr_of cpy )
/\ (modifies (only cpy) h0 h1)
/\ (Seq.equal (sel h1 cpy) (sel h1 s)))) | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val copy_aux:
#a:Type -> s:array a -> cpy:array a -> ctr:nat ->
ST unit
(requires (fun h -> (contains h s /\ contains h cpy /\ addr_of s <> addr_of cpy)
/\ (Seq.length (sel h cpy) = Seq.length (sel h s))
/\ (ctr <= Seq.length (sel h cpy))
/\ (forall (i:nat). i < ctr ==> Seq.index (sel h s) i == Seq.index (sel h cpy) i)))
(ensures (fun h0 u h1 -> (contains h1 s /\ contains h1 cpy /\ addr_of s <> addr_of cpy )
/\ (modifies (only cpy) h0 h1)
/\ (Seq.equal (sel h1 cpy) (sel h1 s)))) | [
"recursion"
] | FStar.Array.copy_aux | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | s: FStar.Array.array a -> cpy: FStar.Array.array a -> ctr: Prims.nat -> FStar.ST.ST Prims.unit | {
"end_col": 24,
"end_line": 81,
"start_col": 2,
"start_line": 78
} |
FStar.ST.ST | val blit:
#a:Type -> s:array a -> s_idx:nat -> t:array a -> t_idx:nat -> len:nat ->
ST unit
(requires (fun h ->
(contains h s)
/\ (contains h t)
/\ (addr_of s <> addr_of t)
/\ (Seq.length (sel h s) >= s_idx + len)
/\ (Seq.length (sel h t) >= t_idx + len)))
(ensures (fun h0 u h1 ->
(contains h1 s /\ contains h1 t /\ addr_of s <> addr_of t)
/\ (Seq.length (sel h1 s) >= s_idx + len)
/\ (Seq.length (sel h1 t) >= t_idx + len)
/\ (Seq.length (sel h0 s) = Seq.length (sel h1 s))
/\ (Seq.length (sel h0 t) = Seq.length (sel h1 t))
/\ (modifies (only t) h0 h1)
/\ (forall (i:nat).
i < len ==> Seq.index (sel h1 s) (s_idx+i) == Seq.index (sel h1 t) (t_idx+i))
/\ (forall (i:nat).{:pattern (Seq.index (sel h1 t) i)}
(i < Seq.length (sel h1 t) /\ (i < t_idx \/ i >= t_idx + len)) ==>
(Seq.index (sel h1 t) i == Seq.index (sel h0 t) i)) )) | [
{
"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.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
}
] | false | let blit #a s s_idx t t_idx len =
blit_aux s s_idx t t_idx len 0 | val blit:
#a:Type -> s:array a -> s_idx:nat -> t:array a -> t_idx:nat -> len:nat ->
ST unit
(requires (fun h ->
(contains h s)
/\ (contains h t)
/\ (addr_of s <> addr_of t)
/\ (Seq.length (sel h s) >= s_idx + len)
/\ (Seq.length (sel h t) >= t_idx + len)))
(ensures (fun h0 u h1 ->
(contains h1 s /\ contains h1 t /\ addr_of s <> addr_of t)
/\ (Seq.length (sel h1 s) >= s_idx + len)
/\ (Seq.length (sel h1 t) >= t_idx + len)
/\ (Seq.length (sel h0 s) = Seq.length (sel h1 s))
/\ (Seq.length (sel h0 t) = Seq.length (sel h1 t))
/\ (modifies (only t) h0 h1)
/\ (forall (i:nat).
i < len ==> Seq.index (sel h1 s) (s_idx+i) == Seq.index (sel h1 t) (t_idx+i))
/\ (forall (i:nat).{:pattern (Seq.index (sel h1 t) i)}
(i < Seq.length (sel h1 t) /\ (i < t_idx \/ i >= t_idx + len)) ==>
(Seq.index (sel h1 t) i == Seq.index (sel h0 t) i)) ))
let blit #a s s_idx t t_idx len = | true | null | false | blit_aux s s_idx t t_idx len 0 | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"FStar.Array.array",
"Prims.nat",
"FStar.Array.blit_aux",
"Prims.unit"
] | [] | (*
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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr
let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2')
let of_seq #a s = ST.alloc s
let to_seq #a s = !s
let of_list #a l = of_seq (Seq.seq_of_list l)
let create #a n init = ST.alloc (Seq.create n init)
let index #a x n =
let s = to_seq x in
Seq.index s n
let upd #a x n v =
let s = !x in
let s' = Seq.upd s n v in
x:= s'
let length #a x = let s = !x in Seq.length s
let op #a f x =
let s = !x in
let s' = f s in
x := s'
let swap #a x i j =
let tmpi = index x i in
let tmpj = index x j in
upd x j tmpi;
upd x i tmpj
val copy_aux:
#a:Type -> s:array a -> cpy:array a -> ctr:nat ->
ST unit
(requires (fun h -> (contains h s /\ contains h cpy /\ addr_of s <> addr_of cpy)
/\ (Seq.length (sel h cpy) = Seq.length (sel h s))
/\ (ctr <= Seq.length (sel h cpy))
/\ (forall (i:nat). i < ctr ==> Seq.index (sel h s) i == Seq.index (sel h cpy) i)))
(ensures (fun h0 u h1 -> (contains h1 s /\ contains h1 cpy /\ addr_of s <> addr_of cpy )
/\ (modifies (only cpy) h0 h1)
/\ (Seq.equal (sel h1 cpy) (sel h1 s))))
let rec copy_aux #a s cpy ctr =
match length cpy - ctr with
| 0 -> ()
| _ -> upd cpy ctr (index s ctr);
copy_aux s cpy (ctr+1)
let copy #a s =
let cpy = create (length s) (index s 0) in
copy_aux s cpy 0;
cpy
private val blit_aux:
#a:Type -> s:array a -> s_idx:nat -> t:array a -> t_idx:nat -> len:nat -> ctr:nat ->
ST unit
(requires (fun h ->
(contains h s /\ contains h t /\ addr_of s <> addr_of t)
/\ (Seq.length (sel h s) >= s_idx + len)
/\ (Seq.length (sel h t) >= t_idx + len)
/\ (ctr <= len)
/\ (forall (i:nat).
i < ctr ==> Seq.index (sel h s) (s_idx+i) == Seq.index (sel h t) (t_idx+i))))
(ensures (fun h0 u h1 ->
(contains h1 s /\ contains h1 t /\ addr_of s <> addr_of t)
/\ (modifies (only t) h0 h1)
/\ (Seq.length (sel h1 s) >= s_idx + len)
/\ (Seq.length (sel h1 t) >= t_idx + len)
/\ (Seq.length (sel h0 s) = Seq.length (sel h1 s))
/\ (Seq.length (sel h0 t) = Seq.length (sel h1 t))
/\ (forall (i:nat).
i < len ==> Seq.index (sel h1 s) (s_idx+i) == Seq.index (sel h1 t) (t_idx+i))
/\ (forall (i:nat).
(i < Seq.length (sel h1 t) /\ (i < t_idx \/ i >= t_idx + len)) ==>
Seq.index (sel h1 t) i == Seq.index (sel h0 t) i) ))
#set-options "--z3rlimit 60"
let rec blit_aux #a s s_idx t t_idx len ctr =
match len - ctr with
| 0 -> ()
| _ -> upd t (t_idx + ctr) (index s (s_idx + ctr));
blit_aux s s_idx t t_idx len (ctr+1)
#set-options "--z3rlimit 5"
private val blit:
#a:Type -> s:array a -> s_idx:nat -> t:array a -> t_idx:nat -> len:nat ->
ST unit
(requires (fun h ->
(contains h s)
/\ (contains h t)
/\ (addr_of s <> addr_of t)
/\ (Seq.length (sel h s) >= s_idx + len)
/\ (Seq.length (sel h t) >= t_idx + len)))
(ensures (fun h0 u h1 ->
(contains h1 s /\ contains h1 t /\ addr_of s <> addr_of t)
/\ (Seq.length (sel h1 s) >= s_idx + len)
/\ (Seq.length (sel h1 t) >= t_idx + len)
/\ (Seq.length (sel h0 s) = Seq.length (sel h1 s))
/\ (Seq.length (sel h0 t) = Seq.length (sel h1 t))
/\ (modifies (only t) h0 h1)
/\ (forall (i:nat).
i < len ==> Seq.index (sel h1 s) (s_idx+i) == Seq.index (sel h1 t) (t_idx+i))
/\ (forall (i:nat).{:pattern (Seq.index (sel h1 t) i)}
(i < Seq.length (sel h1 t) /\ (i < t_idx \/ i >= t_idx + len)) ==>
(Seq.index (sel h1 t) i == Seq.index (sel h0 t) i)) )) | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val blit:
#a:Type -> s:array a -> s_idx:nat -> t:array a -> t_idx:nat -> len:nat ->
ST unit
(requires (fun h ->
(contains h s)
/\ (contains h t)
/\ (addr_of s <> addr_of t)
/\ (Seq.length (sel h s) >= s_idx + len)
/\ (Seq.length (sel h t) >= t_idx + len)))
(ensures (fun h0 u h1 ->
(contains h1 s /\ contains h1 t /\ addr_of s <> addr_of t)
/\ (Seq.length (sel h1 s) >= s_idx + len)
/\ (Seq.length (sel h1 t) >= t_idx + len)
/\ (Seq.length (sel h0 s) = Seq.length (sel h1 s))
/\ (Seq.length (sel h0 t) = Seq.length (sel h1 t))
/\ (modifies (only t) h0 h1)
/\ (forall (i:nat).
i < len ==> Seq.index (sel h1 s) (s_idx+i) == Seq.index (sel h1 t) (t_idx+i))
/\ (forall (i:nat).{:pattern (Seq.index (sel h1 t) i)}
(i < Seq.length (sel h1 t) /\ (i < t_idx \/ i >= t_idx + len)) ==>
(Seq.index (sel h1 t) i == Seq.index (sel h0 t) i)) )) | [] | FStar.Array.blit | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} |
s: FStar.Array.array a ->
s_idx: Prims.nat ->
t: FStar.Array.array a ->
t_idx: Prims.nat ->
len: Prims.nat
-> FStar.ST.ST Prims.unit | {
"end_col": 32,
"end_line": 141,
"start_col": 2,
"start_line": 141
} |
FStar.ST.ST | val blit_aux:
#a:Type -> s:array a -> s_idx:nat -> t:array a -> t_idx:nat -> len:nat -> ctr:nat ->
ST unit
(requires (fun h ->
(contains h s /\ contains h t /\ addr_of s <> addr_of t)
/\ (Seq.length (sel h s) >= s_idx + len)
/\ (Seq.length (sel h t) >= t_idx + len)
/\ (ctr <= len)
/\ (forall (i:nat).
i < ctr ==> Seq.index (sel h s) (s_idx+i) == Seq.index (sel h t) (t_idx+i))))
(ensures (fun h0 u h1 ->
(contains h1 s /\ contains h1 t /\ addr_of s <> addr_of t)
/\ (modifies (only t) h0 h1)
/\ (Seq.length (sel h1 s) >= s_idx + len)
/\ (Seq.length (sel h1 t) >= t_idx + len)
/\ (Seq.length (sel h0 s) = Seq.length (sel h1 s))
/\ (Seq.length (sel h0 t) = Seq.length (sel h1 t))
/\ (forall (i:nat).
i < len ==> Seq.index (sel h1 s) (s_idx+i) == Seq.index (sel h1 t) (t_idx+i))
/\ (forall (i:nat).
(i < Seq.length (sel h1 t) /\ (i < t_idx \/ i >= t_idx + len)) ==>
Seq.index (sel h1 t) i == Seq.index (sel h0 t) i) )) | [
{
"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.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
}
] | false | let rec blit_aux #a s s_idx t t_idx len ctr =
match len - ctr with
| 0 -> ()
| _ -> upd t (t_idx + ctr) (index s (s_idx + ctr));
blit_aux s s_idx t t_idx len (ctr+1) | val blit_aux:
#a:Type -> s:array a -> s_idx:nat -> t:array a -> t_idx:nat -> len:nat -> ctr:nat ->
ST unit
(requires (fun h ->
(contains h s /\ contains h t /\ addr_of s <> addr_of t)
/\ (Seq.length (sel h s) >= s_idx + len)
/\ (Seq.length (sel h t) >= t_idx + len)
/\ (ctr <= len)
/\ (forall (i:nat).
i < ctr ==> Seq.index (sel h s) (s_idx+i) == Seq.index (sel h t) (t_idx+i))))
(ensures (fun h0 u h1 ->
(contains h1 s /\ contains h1 t /\ addr_of s <> addr_of t)
/\ (modifies (only t) h0 h1)
/\ (Seq.length (sel h1 s) >= s_idx + len)
/\ (Seq.length (sel h1 t) >= t_idx + len)
/\ (Seq.length (sel h0 s) = Seq.length (sel h1 s))
/\ (Seq.length (sel h0 t) = Seq.length (sel h1 t))
/\ (forall (i:nat).
i < len ==> Seq.index (sel h1 s) (s_idx+i) == Seq.index (sel h1 t) (t_idx+i))
/\ (forall (i:nat).
(i < Seq.length (sel h1 t) /\ (i < t_idx \/ i >= t_idx + len)) ==>
Seq.index (sel h1 t) i == Seq.index (sel h0 t) i) ))
let rec blit_aux #a s s_idx t t_idx len ctr = | true | null | false | match len - ctr with
| 0 -> ()
| _ ->
upd t (t_idx + ctr) (index s (s_idx + ctr));
blit_aux s s_idx t t_idx len (ctr + 1) | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"FStar.Array.array",
"Prims.nat",
"Prims.op_Subtraction",
"Prims.unit",
"Prims.int",
"FStar.Array.blit_aux",
"Prims.op_Addition",
"FStar.Array.upd",
"FStar.Array.index"
] | [] | (*
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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr
let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2')
let of_seq #a s = ST.alloc s
let to_seq #a s = !s
let of_list #a l = of_seq (Seq.seq_of_list l)
let create #a n init = ST.alloc (Seq.create n init)
let index #a x n =
let s = to_seq x in
Seq.index s n
let upd #a x n v =
let s = !x in
let s' = Seq.upd s n v in
x:= s'
let length #a x = let s = !x in Seq.length s
let op #a f x =
let s = !x in
let s' = f s in
x := s'
let swap #a x i j =
let tmpi = index x i in
let tmpj = index x j in
upd x j tmpi;
upd x i tmpj
val copy_aux:
#a:Type -> s:array a -> cpy:array a -> ctr:nat ->
ST unit
(requires (fun h -> (contains h s /\ contains h cpy /\ addr_of s <> addr_of cpy)
/\ (Seq.length (sel h cpy) = Seq.length (sel h s))
/\ (ctr <= Seq.length (sel h cpy))
/\ (forall (i:nat). i < ctr ==> Seq.index (sel h s) i == Seq.index (sel h cpy) i)))
(ensures (fun h0 u h1 -> (contains h1 s /\ contains h1 cpy /\ addr_of s <> addr_of cpy )
/\ (modifies (only cpy) h0 h1)
/\ (Seq.equal (sel h1 cpy) (sel h1 s))))
let rec copy_aux #a s cpy ctr =
match length cpy - ctr with
| 0 -> ()
| _ -> upd cpy ctr (index s ctr);
copy_aux s cpy (ctr+1)
let copy #a s =
let cpy = create (length s) (index s 0) in
copy_aux s cpy 0;
cpy
private val blit_aux:
#a:Type -> s:array a -> s_idx:nat -> t:array a -> t_idx:nat -> len:nat -> ctr:nat ->
ST unit
(requires (fun h ->
(contains h s /\ contains h t /\ addr_of s <> addr_of t)
/\ (Seq.length (sel h s) >= s_idx + len)
/\ (Seq.length (sel h t) >= t_idx + len)
/\ (ctr <= len)
/\ (forall (i:nat).
i < ctr ==> Seq.index (sel h s) (s_idx+i) == Seq.index (sel h t) (t_idx+i))))
(ensures (fun h0 u h1 ->
(contains h1 s /\ contains h1 t /\ addr_of s <> addr_of t)
/\ (modifies (only t) h0 h1)
/\ (Seq.length (sel h1 s) >= s_idx + len)
/\ (Seq.length (sel h1 t) >= t_idx + len)
/\ (Seq.length (sel h0 s) = Seq.length (sel h1 s))
/\ (Seq.length (sel h0 t) = Seq.length (sel h1 t))
/\ (forall (i:nat).
i < len ==> Seq.index (sel h1 s) (s_idx+i) == Seq.index (sel h1 t) (t_idx+i))
/\ (forall (i:nat).
(i < Seq.length (sel h1 t) /\ (i < t_idx \/ i >= t_idx + len)) ==>
Seq.index (sel h1 t) i == Seq.index (sel h0 t) i) ))
#set-options "--z3rlimit 60" | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val blit_aux:
#a:Type -> s:array a -> s_idx:nat -> t:array a -> t_idx:nat -> len:nat -> ctr:nat ->
ST unit
(requires (fun h ->
(contains h s /\ contains h t /\ addr_of s <> addr_of t)
/\ (Seq.length (sel h s) >= s_idx + len)
/\ (Seq.length (sel h t) >= t_idx + len)
/\ (ctr <= len)
/\ (forall (i:nat).
i < ctr ==> Seq.index (sel h s) (s_idx+i) == Seq.index (sel h t) (t_idx+i))))
(ensures (fun h0 u h1 ->
(contains h1 s /\ contains h1 t /\ addr_of s <> addr_of t)
/\ (modifies (only t) h0 h1)
/\ (Seq.length (sel h1 s) >= s_idx + len)
/\ (Seq.length (sel h1 t) >= t_idx + len)
/\ (Seq.length (sel h0 s) = Seq.length (sel h1 s))
/\ (Seq.length (sel h0 t) = Seq.length (sel h1 t))
/\ (forall (i:nat).
i < len ==> Seq.index (sel h1 s) (s_idx+i) == Seq.index (sel h1 t) (t_idx+i))
/\ (forall (i:nat).
(i < Seq.length (sel h1 t) /\ (i < t_idx \/ i >= t_idx + len)) ==>
Seq.index (sel h1 t) i == Seq.index (sel h0 t) i) )) | [
"recursion"
] | FStar.Array.blit_aux | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} |
s: FStar.Array.array a ->
s_idx: Prims.nat ->
t: FStar.Array.array a ->
t_idx: Prims.nat ->
len: Prims.nat ->
ctr: Prims.nat
-> FStar.ST.ST Prims.unit | {
"end_col": 45,
"end_line": 116,
"start_col": 2,
"start_line": 113
} |
Prims.Tot | val lte (a b: t) : Tot bool | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b) | val lte (a b: t) : Tot bool
let lte (a b: t) : Tot bool = | false | null | false | lte #n (v a) (v b) | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [
"total"
] | [
"FStar.Int128.t",
"FStar.Int.lte",
"FStar.Int128.n",
"FStar.Int128.v",
"Prims.bool"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b) | false | true | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lte (a b: t) : Tot bool | [] | FStar.Int128.lte | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | {
"end_col": 51,
"end_line": 118,
"start_col": 33,
"start_line": 118
} |
Prims.Tot | val lt (a b: t) : Tot bool | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b) | val lt (a b: t) : Tot bool
let lt (a b: t) : Tot bool = | false | null | false | lt #n (v a) (v b) | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [
"total"
] | [
"FStar.Int128.t",
"FStar.Int.lt",
"FStar.Int128.n",
"FStar.Int128.v",
"Prims.bool"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b) | false | true | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lt (a b: t) : Tot bool | [] | FStar.Int128.lt | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | {
"end_col": 49,
"end_line": 117,
"start_col": 32,
"start_line": 117
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let n = 128 | let n = | false | null | false | 128 | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [
"total"
] | [] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****) | false | true | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val n : Prims.int | [] | FStar.Int128.n | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | Prims.int | {
"end_col": 18,
"end_line": 20,
"start_col": 15,
"start_line": 20
} |
|
Prims.Tot | val eq (a b: t) : Tot bool | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b) | val eq (a b: t) : Tot bool
let eq (a b: t) : Tot bool = | false | null | false | eq #n (v a) (v b) | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [
"total"
] | [
"FStar.Int128.t",
"FStar.Int.eq",
"FStar.Int128.n",
"FStar.Int128.v",
"Prims.bool"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c)) | false | true | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val eq (a b: t) : Tot bool | [] | FStar.Int128.eq | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | {
"end_col": 49,
"end_line": 114,
"start_col": 32,
"start_line": 114
} |
Prims.Pure | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Amp_Hat = logand | let op_Amp_Hat = | false | null | false | logand | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [] | [
"FStar.Int128.logand"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add
unfold let op_Subtraction_Hat = sub
unfold let op_Star_Hat = mul
unfold let op_Slash_Hat = div
unfold let op_Percent_Hat = rem | false | false | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Amp_Hat : x: FStar.Int128.t -> y: FStar.Int128.t -> Prims.Pure FStar.Int128.t | [] | FStar.Int128.op_Amp_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | x: FStar.Int128.t -> y: FStar.Int128.t -> Prims.Pure FStar.Int128.t | {
"end_col": 30,
"end_line": 127,
"start_col": 24,
"start_line": 127
} |
|
Prims.Pure | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Bar_Hat = logor | let op_Bar_Hat = | false | null | false | logor | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [] | [
"FStar.Int128.logor"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add
unfold let op_Subtraction_Hat = sub
unfold let op_Star_Hat = mul
unfold let op_Slash_Hat = div
unfold let op_Percent_Hat = rem
unfold let op_Hat_Hat = logxor | false | false | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Bar_Hat : x: FStar.Int128.t -> y: FStar.Int128.t -> Prims.Pure FStar.Int128.t | [] | FStar.Int128.op_Bar_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | x: FStar.Int128.t -> y: FStar.Int128.t -> Prims.Pure FStar.Int128.t | {
"end_col": 29,
"end_line": 128,
"start_col": 24,
"start_line": 128
} |
|
Prims.Pure | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Subtraction_Hat = sub | let op_Subtraction_Hat = | false | null | false | sub | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [] | [
"FStar.Int128.sub"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *) | false | false | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Subtraction_Hat : a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.Pure FStar.Int128.t | [] | FStar.Int128.op_Subtraction_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.Pure FStar.Int128.t | {
"end_col": 35,
"end_line": 122,
"start_col": 32,
"start_line": 122
} |
|
Prims.Pure | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Slash_Hat = div | let op_Slash_Hat = | false | null | false | div | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [] | [
"FStar.Int128.div"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add
unfold let op_Subtraction_Hat = sub | false | false | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Slash_Hat : a: FStar.Int128.t -> b: FStar.Int128.t{FStar.Int128.v b <> 0} -> Prims.Pure FStar.Int128.t | [] | FStar.Int128.op_Slash_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t{FStar.Int128.v b <> 0} -> Prims.Pure FStar.Int128.t | {
"end_col": 29,
"end_line": 124,
"start_col": 26,
"start_line": 124
} |
|
Prims.Pure | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Less_Less_Hat = shift_left | let op_Less_Less_Hat = | false | null | false | shift_left | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [] | [
"FStar.Int128.shift_left"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add
unfold let op_Subtraction_Hat = sub
unfold let op_Star_Hat = mul
unfold let op_Slash_Hat = div
unfold let op_Percent_Hat = rem
unfold let op_Hat_Hat = logxor
unfold let op_Amp_Hat = logand | false | false | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Less_Less_Hat : a: FStar.Int128.t -> s: FStar.UInt32.t -> Prims.Pure FStar.Int128.t | [] | FStar.Int128.op_Less_Less_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> s: FStar.UInt32.t -> Prims.Pure FStar.Int128.t | {
"end_col": 40,
"end_line": 129,
"start_col": 30,
"start_line": 129
} |
|
Prims.Pure | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Percent_Hat = rem | let op_Percent_Hat = | false | null | false | rem | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [] | [
"FStar.Int128.rem"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add
unfold let op_Subtraction_Hat = sub
unfold let op_Star_Hat = mul | false | false | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Percent_Hat : a: FStar.Int128.t -> b: FStar.Int128.t{FStar.Int128.v b <> 0} -> Prims.Pure FStar.Int128.t | [] | FStar.Int128.op_Percent_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t{FStar.Int128.v b <> 0} -> Prims.Pure FStar.Int128.t | {
"end_col": 31,
"end_line": 125,
"start_col": 28,
"start_line": 125
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Greater_Hat = gt | let op_Greater_Hat = | false | null | false | gt | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [
"total"
] | [
"FStar.Int128.gt"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add
unfold let op_Subtraction_Hat = sub
unfold let op_Star_Hat = mul
unfold let op_Slash_Hat = div
unfold let op_Percent_Hat = rem
unfold let op_Hat_Hat = logxor
unfold let op_Amp_Hat = logand
unfold let op_Bar_Hat = logor
unfold let op_Less_Less_Hat = shift_left
unfold let op_Greater_Greater_Hat = shift_right
unfold let op_Greater_Greater_Greater_Hat = shift_arithmetic_right | false | true | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Greater_Hat : a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | [] | FStar.Int128.op_Greater_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | {
"end_col": 30,
"end_line": 133,
"start_col": 28,
"start_line": 133
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Equals_Hat = eq | let op_Equals_Hat = | false | null | false | eq | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [
"total"
] | [
"FStar.Int128.eq"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add
unfold let op_Subtraction_Hat = sub
unfold let op_Star_Hat = mul
unfold let op_Slash_Hat = div
unfold let op_Percent_Hat = rem
unfold let op_Hat_Hat = logxor
unfold let op_Amp_Hat = logand
unfold let op_Bar_Hat = logor
unfold let op_Less_Less_Hat = shift_left
unfold let op_Greater_Greater_Hat = shift_right | false | true | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Equals_Hat : a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | [] | FStar.Int128.op_Equals_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | {
"end_col": 29,
"end_line": 132,
"start_col": 27,
"start_line": 132
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Less_Hat = lt | let op_Less_Hat = | false | null | false | lt | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [
"total"
] | [
"FStar.Int128.lt"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add
unfold let op_Subtraction_Hat = sub
unfold let op_Star_Hat = mul
unfold let op_Slash_Hat = div
unfold let op_Percent_Hat = rem
unfold let op_Hat_Hat = logxor
unfold let op_Amp_Hat = logand
unfold let op_Bar_Hat = logor
unfold let op_Less_Less_Hat = shift_left
unfold let op_Greater_Greater_Hat = shift_right
unfold let op_Greater_Greater_Greater_Hat = shift_arithmetic_right
unfold let op_Equals_Hat = eq
unfold let op_Greater_Hat = gt | false | true | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Less_Hat : a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | [] | FStar.Int128.op_Less_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | {
"end_col": 27,
"end_line": 135,
"start_col": 25,
"start_line": 135
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Less_Equals_Hat = lte | let op_Less_Equals_Hat = | false | null | false | lte | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [
"total"
] | [
"FStar.Int128.lte"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add
unfold let op_Subtraction_Hat = sub
unfold let op_Star_Hat = mul
unfold let op_Slash_Hat = div
unfold let op_Percent_Hat = rem
unfold let op_Hat_Hat = logxor
unfold let op_Amp_Hat = logand
unfold let op_Bar_Hat = logor
unfold let op_Less_Less_Hat = shift_left
unfold let op_Greater_Greater_Hat = shift_right
unfold let op_Greater_Greater_Greater_Hat = shift_arithmetic_right
unfold let op_Equals_Hat = eq
unfold let op_Greater_Hat = gt
unfold let op_Greater_Equals_Hat = gte | false | true | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Less_Equals_Hat : a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | [] | FStar.Int128.op_Less_Equals_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | {
"end_col": 35,
"end_line": 136,
"start_col": 32,
"start_line": 136
} |
|
Prims.Tot | val gt (a b: t) : Tot bool | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b) | val gt (a b: t) : Tot bool
let gt (a b: t) : Tot bool = | false | null | false | gt #n (v a) (v b) | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [
"total"
] | [
"FStar.Int128.t",
"FStar.Int.gt",
"FStar.Int128.n",
"FStar.Int128.v",
"Prims.bool"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *) | false | true | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val gt (a b: t) : Tot bool | [] | FStar.Int128.gt | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | {
"end_col": 49,
"end_line": 115,
"start_col": 32,
"start_line": 115
} |
Prims.Tot | val gte (a b: t) : Tot bool | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b) | val gte (a b: t) : Tot bool
let gte (a b: t) : Tot bool = | false | null | false | gte #n (v a) (v b) | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [
"total"
] | [
"FStar.Int128.t",
"FStar.Int.gte",
"FStar.Int128.n",
"FStar.Int128.v",
"Prims.bool"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b) | false | true | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val gte (a b: t) : Tot bool | [] | FStar.Int128.gte | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | {
"end_col": 51,
"end_line": 116,
"start_col": 33,
"start_line": 116
} |
Prims.Pure | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Star_Hat = mul | let op_Star_Hat = | false | null | false | mul | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [] | [
"FStar.Int128.mul"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add | false | false | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Star_Hat : a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.Pure FStar.Int128.t | [] | FStar.Int128.op_Star_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.Pure FStar.Int128.t | {
"end_col": 28,
"end_line": 123,
"start_col": 25,
"start_line": 123
} |
|
Prims.Pure | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Plus_Hat = add | let op_Plus_Hat = | false | null | false | add | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [] | [
"FStar.Int128.add"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b) | false | false | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Plus_Hat : a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.Pure FStar.Int128.t | [] | FStar.Int128.op_Plus_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.Pure FStar.Int128.t | {
"end_col": 28,
"end_line": 121,
"start_col": 25,
"start_line": 121
} |
|
Prims.Pure | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Greater_Greater_Hat = shift_right | let op_Greater_Greater_Hat = | false | null | false | shift_right | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [] | [
"FStar.Int128.shift_right"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add
unfold let op_Subtraction_Hat = sub
unfold let op_Star_Hat = mul
unfold let op_Slash_Hat = div
unfold let op_Percent_Hat = rem
unfold let op_Hat_Hat = logxor
unfold let op_Amp_Hat = logand
unfold let op_Bar_Hat = logor | false | false | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Greater_Greater_Hat : a: FStar.Int128.t -> s: FStar.UInt32.t -> Prims.Pure FStar.Int128.t | [] | FStar.Int128.op_Greater_Greater_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> s: FStar.UInt32.t -> Prims.Pure FStar.Int128.t | {
"end_col": 47,
"end_line": 130,
"start_col": 36,
"start_line": 130
} |
|
Prims.Pure | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Greater_Greater_Greater_Hat = shift_arithmetic_right | let op_Greater_Greater_Greater_Hat = | false | null | false | shift_arithmetic_right | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [] | [
"FStar.Int128.shift_arithmetic_right"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add
unfold let op_Subtraction_Hat = sub
unfold let op_Star_Hat = mul
unfold let op_Slash_Hat = div
unfold let op_Percent_Hat = rem
unfold let op_Hat_Hat = logxor
unfold let op_Amp_Hat = logand
unfold let op_Bar_Hat = logor
unfold let op_Less_Less_Hat = shift_left | false | false | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Greater_Greater_Greater_Hat : a: FStar.Int128.t -> s: FStar.UInt32.t -> Prims.Pure FStar.Int128.t | [] | FStar.Int128.op_Greater_Greater_Greater_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> s: FStar.UInt32.t -> Prims.Pure FStar.Int128.t | {
"end_col": 66,
"end_line": 131,
"start_col": 44,
"start_line": 131
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Greater_Equals_Hat = gte | let op_Greater_Equals_Hat = | false | null | false | gte | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [
"total"
] | [
"FStar.Int128.gte"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add
unfold let op_Subtraction_Hat = sub
unfold let op_Star_Hat = mul
unfold let op_Slash_Hat = div
unfold let op_Percent_Hat = rem
unfold let op_Hat_Hat = logxor
unfold let op_Amp_Hat = logand
unfold let op_Bar_Hat = logor
unfold let op_Less_Less_Hat = shift_left
unfold let op_Greater_Greater_Hat = shift_right
unfold let op_Greater_Greater_Greater_Hat = shift_arithmetic_right
unfold let op_Equals_Hat = eq | false | true | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Greater_Equals_Hat : a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | [] | FStar.Int128.op_Greater_Equals_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t -> b: FStar.Int128.t -> Prims.bool | {
"end_col": 38,
"end_line": 134,
"start_col": 35,
"start_line": 134
} |
|
Prims.Pure | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let op_Hat_Hat = logxor | let op_Hat_Hat = | false | null | false | logxor | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [] | [
"FStar.Int128.logxor"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add
unfold let op_Subtraction_Hat = sub
unfold let op_Star_Hat = mul
unfold let op_Slash_Hat = div | false | false | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Hat_Hat : x: FStar.Int128.t -> y: FStar.Int128.t -> Prims.Pure FStar.Int128.t | [] | FStar.Int128.op_Hat_Hat | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | x: FStar.Int128.t -> y: FStar.Int128.t -> Prims.Pure FStar.Int128.t | {
"end_col": 30,
"end_line": 126,
"start_col": 24,
"start_line": 126
} |
|
Prims.Tot | val ct_abs (a: t{min_int n < v a}) : Tot (b: t{v b = abs (v a)}) | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"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
}
] | false | let ct_abs (a:t{min_int n < v a}) : Tot (b:t{v b = abs (v a)}) =
let mask = a >>>^ UInt32.uint_to_t (n - 1) in
if 0 <= v a then
begin
sign_bit_positive (v a);
nth_lemma (v mask) (FStar.Int.zero _);
logxor_lemma_1 (v a)
end
else
begin
sign_bit_negative (v a);
nth_lemma (v mask) (ones _);
logxor_lemma_2 (v a);
lognot_negative (v a);
UInt.lemma_lognot_value #n (to_uint (v a))
end;
(a ^^ mask) -^ mask | val ct_abs (a: t{min_int n < v a}) : Tot (b: t{v b = abs (v a)})
let ct_abs (a: t{min_int n < v a}) : Tot (b: t{v b = abs (v a)}) = | false | null | false | let mask = a >>>^ UInt32.uint_to_t (n - 1) in
if 0 <= v a
then
(sign_bit_positive (v a);
nth_lemma (v mask) (FStar.Int.zero _);
logxor_lemma_1 (v a))
else
(sign_bit_negative (v a);
nth_lemma (v mask) (ones _);
logxor_lemma_2 (v a);
lognot_negative (v a);
UInt.lemma_lognot_value #n (to_uint (v a)));
(a ^^ mask) -^ mask | {
"checked_file": "FStar.Int128.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int64.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int128.fsti"
} | [
"total"
] | [
"FStar.Int128.t",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.Int.min_int",
"FStar.Int128.n",
"FStar.Int128.v",
"FStar.Int128.op_Subtraction_Hat",
"FStar.Int128.op_Hat_Hat",
"Prims.unit",
"Prims.op_LessThanOrEqual",
"FStar.Int.logxor_lemma_1",
"FStar.Int.nth_lemma",
"FStar.Int.zero",
"FStar.Int.sign_bit_positive",
"Prims.bool",
"FStar.UInt.lemma_lognot_value",
"FStar.Int.to_uint",
"FStar.Int.lognot_negative",
"FStar.Int.logxor_lemma_2",
"FStar.Int.ones",
"FStar.Int.sign_bit_negative",
"FStar.Int128.op_Greater_Greater_Greater_Hat",
"FStar.UInt32.uint_to_t",
"Prims.op_Subtraction",
"Prims.op_Equality",
"Prims.int",
"Prims.abs"
] | [] | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int128
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
unfold let n = 128
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
new val t : eqtype
val v (x:t) : Tot (int_t n)
val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
val uv_inv (x : t) : Lemma
(ensures (int_to_t (v x) == x))
[SMTPat (v x)]
val vu_inv (x : int_t n) : Lemma
(ensures (v (int_to_t x) == x))
[SMTPat (int_to_t x)]
val v_inj (x1 x2: t): Lemma
(requires (v x1 == v x2))
(ensures (x1 == x2))
val zero : x:t{v x = 0}
val one : x:t{v x = 1}
val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c))
(* Subtraction primitives *)
val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c))
(* Multiplication primitives *)
val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c))
(* Division primitives *)
val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c))
(* Modulo primitives *)
(* If a/b is not representable the result of a%b is undefind *)
val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c))
(* Bitwise operators *)
val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z))
val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z))
val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z))
val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z))
(* Shift operators *)
(** If a is negative the result is implementation-defined *)
val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c))
(** If a is negative or a * pow2 s is not representable the result is undefined *)
val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c))
val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c))
(* Comparison operators *)
let eq (a:t) (b:t) : Tot bool = eq #n (v a) (v b)
let gt (a:t) (b:t) : Tot bool = gt #n (v a) (v b)
let gte (a:t) (b:t) : Tot bool = gte #n (v a) (v b)
let lt (a:t) (b:t) : Tot bool = lt #n (v a) (v b)
let lte (a:t) (b:t) : Tot bool = lte #n (v a) (v b)
(* Infix notations *)
unfold let op_Plus_Hat = add
unfold let op_Subtraction_Hat = sub
unfold let op_Star_Hat = mul
unfold let op_Slash_Hat = div
unfold let op_Percent_Hat = rem
unfold let op_Hat_Hat = logxor
unfold let op_Amp_Hat = logand
unfold let op_Bar_Hat = logor
unfold let op_Less_Less_Hat = shift_left
unfold let op_Greater_Greater_Hat = shift_right
unfold let op_Greater_Greater_Greater_Hat = shift_arithmetic_right
unfold let op_Equals_Hat = eq
unfold let op_Greater_Hat = gt
unfold let op_Greater_Equals_Hat = gte
unfold let op_Less_Hat = lt
unfold let op_Less_Equals_Hat = lte | false | false | FStar.Int128.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val ct_abs (a: t{min_int n < v a}) : Tot (b: t{v b = abs (v a)}) | [] | FStar.Int128.ct_abs | {
"file_name": "ulib/FStar.Int128.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int128.t{FStar.Int.min_int FStar.Int128.n < FStar.Int128.v a}
-> b: FStar.Int128.t{FStar.Int128.v b = Prims.abs (FStar.Int128.v a)} | {
"end_col": 21,
"end_line": 155,
"start_col": 64,
"start_line": 139
} |
Prims.Tot | val make_instr_annotate
(#outs: list instr_out)
(#args: list instr_operand)
(#havoc_flags: flag_havoc)
(i: instr_t outs args havoc_flags)
(ann: S.instr_annotation (InstrTypeRecord i))
: make_instr_t outs args | [
{
"abbrev": false,
"full_module": "Vale.X64.Memory_Sems",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"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": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Bytes_Code_s",
"short_module": "BC"
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Instruction_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let make_instr_annotate
(#outs:list instr_out) (#args:list instr_operand) (#havoc_flags:flag_havoc)
(i:instr_t outs args havoc_flags) (ann:S.instr_annotation (InstrTypeRecord i))
: make_instr_t outs args =
make_instr_outs outs args (fun oprs -> BC.Instr (InstrTypeRecord i) oprs ann) | val make_instr_annotate
(#outs: list instr_out)
(#args: list instr_operand)
(#havoc_flags: flag_havoc)
(i: instr_t outs args havoc_flags)
(ann: S.instr_annotation (InstrTypeRecord i))
: make_instr_t outs args
let make_instr_annotate
(#outs: list instr_out)
(#args: list instr_operand)
(#havoc_flags: flag_havoc)
(i: instr_t outs args havoc_flags)
(ann: S.instr_annotation (InstrTypeRecord i))
: make_instr_t outs args = | false | null | false | make_instr_outs outs args (fun oprs -> BC.Instr (InstrTypeRecord i) oprs ann) | {
"checked_file": "Vale.X64.InsLemmas.fsti.checked",
"dependencies": [
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.State.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Instruction_s.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.Bytes_Code_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.InsLemmas.fsti"
} | [
"total"
] | [
"Prims.list",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.flag_havoc",
"Vale.X64.Instruction_s.instr_t",
"Vale.X64.Machine_Semantics_s.instr_annotation",
"Vale.X64.Instruction_s.InstrTypeRecord",
"Vale.X64.InsLemmas.make_instr_outs",
"Vale.X64.Instruction_s.instr_operands_t",
"Vale.X64.Bytes_Code_s.Instr",
"Vale.X64.Machine_Semantics_s.ins",
"Vale.X64.InsLemmas.make_instr_t"
] | [] | module Vale.X64.InsLemmas
open FStar.Mul
open Vale.Arch.HeapImpl
open Vale.X64.Machine_s
open Vale.X64.Instruction_s
open Vale.X64.State
open Vale.X64.StateLemmas
open Vale.X64.Decls
open Vale.X64.Memory
module BC = Vale.X64.Bytes_Code_s
module S = Vale.X64.Machine_Semantics_s
let has_taint128 (o:operand128) (t:taint) : bool =
match o with
| OMem (_, t') | OStack (_, t') -> t = t'
| _ -> true
val lemma_valid_src_operand64_and_taint (o:operand64) (s:vale_state) : Lemma
(requires valid_operand o s)
(ensures S.valid_src_operand64_and_taint o (state_to_S s))
[SMTPat (S.valid_src_operand64_and_taint o (state_to_S s))]
val lemma_valid_src_operand128_and_taint (o:operand128) (s:vale_state) : Lemma
(requires valid_operand128 o s)
(ensures S.valid_src_operand128_and_taint o (state_to_S s))
[SMTPat (S.valid_src_operand128_and_taint o (state_to_S s))]
[@instr_attr]
let rec make_instr_t_args (args:list instr_operand) : Type0 =
match normal args with
| [] -> S.ins
| (IOpEx i)::args -> arrow (instr_operand_t i) (make_instr_t_args args)
| (IOpIm _)::args -> make_instr_t_args args
[@instr_attr]
let rec make_instr_t (outs:list instr_out) (args:list instr_operand) : Type0 =
match normal outs with
| [] -> make_instr_t_args args
| (_, IOpEx i)::outs -> arrow (instr_operand_t i) (make_instr_t outs args)
| (_, IOpIm _)::outs -> make_instr_t outs args
[@instr_attr]
let rec make_instr_args
(args:list instr_operand) (k:arrow (instr_operands_t_args args) S.ins)
: make_instr_t_args args =
match args with
| [] -> k ()
| (IOpEx i)::args -> fun (o:instr_operand_t i) ->
let k = coerce #(arrow (instr_operand_t i & instr_operands_t_args args) S.ins) k in // REVIEW: workaround for F* -> OCaml bug
let k (oprs:instr_operands_t_args args) : S.ins = k (o, oprs) in
make_instr_args args k
| (IOpIm i)::args -> coerce (make_instr_args args (coerce #(arrow (instr_operands_t_args args) S.ins) k))
[@instr_attr]
let rec make_instr_outs
(outs:list instr_out) (args:list instr_operand) (k:arrow (instr_operands_t outs args) S.ins)
: make_instr_t outs args =
match outs with
| [] -> make_instr_args args k
| (b, IOpEx i)::outs -> fun (o:instr_operand_t i) ->
let k = coerce #(arrow (instr_operand_t i & instr_operands_t outs args) S.ins) k in // REVIEW: workaround for F* -> OCaml bug
let k (oprs:instr_operands_t outs args) = k (o, oprs) in
make_instr_outs outs args k
| (_, IOpIm i)::outs -> coerce (make_instr_outs outs args (coerce #(arrow (instr_operands_t outs args) S.ins) k))
[@instr_attr]
let make_instr
(#outs:list instr_out) (#args:list instr_operand) (#havoc_flags:flag_havoc)
(i:instr_t outs args havoc_flags)
: make_instr_t outs args =
make_instr_outs outs args (fun oprs -> BC.Instr (InstrTypeRecord i) oprs S.AnnotateNone)
[@instr_attr]
let make_instr_annotate
(#outs:list instr_out) (#args:list instr_operand) (#havoc_flags:flag_havoc)
(i:instr_t outs args havoc_flags) (ann:S.instr_annotation (InstrTypeRecord i)) | false | false | Vale.X64.InsLemmas.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val make_instr_annotate
(#outs: list instr_out)
(#args: list instr_operand)
(#havoc_flags: flag_havoc)
(i: instr_t outs args havoc_flags)
(ann: S.instr_annotation (InstrTypeRecord i))
: make_instr_t outs args | [] | Vale.X64.InsLemmas.make_instr_annotate | {
"file_name": "vale/code/arch/x64/Vale.X64.InsLemmas.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
i: Vale.X64.Instruction_s.instr_t outs args havoc_flags ->
ann: Vale.X64.Machine_Semantics_s.instr_annotation (Vale.X64.Instruction_s.InstrTypeRecord i)
-> Vale.X64.InsLemmas.make_instr_t outs args | {
"end_col": 79,
"end_line": 78,
"start_col": 2,
"start_line": 78
} |
Prims.Tot | val make_instr
(#outs: list instr_out)
(#args: list instr_operand)
(#havoc_flags: flag_havoc)
(i: instr_t outs args havoc_flags)
: make_instr_t outs args | [
{
"abbrev": false,
"full_module": "Vale.X64.Memory_Sems",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"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": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Bytes_Code_s",
"short_module": "BC"
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Instruction_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let make_instr
(#outs:list instr_out) (#args:list instr_operand) (#havoc_flags:flag_havoc)
(i:instr_t outs args havoc_flags)
: make_instr_t outs args =
make_instr_outs outs args (fun oprs -> BC.Instr (InstrTypeRecord i) oprs S.AnnotateNone) | val make_instr
(#outs: list instr_out)
(#args: list instr_operand)
(#havoc_flags: flag_havoc)
(i: instr_t outs args havoc_flags)
: make_instr_t outs args
let make_instr
(#outs: list instr_out)
(#args: list instr_operand)
(#havoc_flags: flag_havoc)
(i: instr_t outs args havoc_flags)
: make_instr_t outs args = | false | null | false | make_instr_outs outs args (fun oprs -> BC.Instr (InstrTypeRecord i) oprs S.AnnotateNone) | {
"checked_file": "Vale.X64.InsLemmas.fsti.checked",
"dependencies": [
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.State.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Instruction_s.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.Bytes_Code_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.InsLemmas.fsti"
} | [
"total"
] | [
"Prims.list",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.flag_havoc",
"Vale.X64.Instruction_s.instr_t",
"Vale.X64.InsLemmas.make_instr_outs",
"Vale.X64.Instruction_s.instr_operands_t",
"Vale.X64.Bytes_Code_s.Instr",
"Vale.X64.Machine_Semantics_s.instr_annotation",
"Vale.X64.Instruction_s.InstrTypeRecord",
"Vale.X64.Machine_Semantics_s.AnnotateNone",
"Vale.X64.Machine_Semantics_s.ins",
"Vale.X64.InsLemmas.make_instr_t"
] | [] | module Vale.X64.InsLemmas
open FStar.Mul
open Vale.Arch.HeapImpl
open Vale.X64.Machine_s
open Vale.X64.Instruction_s
open Vale.X64.State
open Vale.X64.StateLemmas
open Vale.X64.Decls
open Vale.X64.Memory
module BC = Vale.X64.Bytes_Code_s
module S = Vale.X64.Machine_Semantics_s
let has_taint128 (o:operand128) (t:taint) : bool =
match o with
| OMem (_, t') | OStack (_, t') -> t = t'
| _ -> true
val lemma_valid_src_operand64_and_taint (o:operand64) (s:vale_state) : Lemma
(requires valid_operand o s)
(ensures S.valid_src_operand64_and_taint o (state_to_S s))
[SMTPat (S.valid_src_operand64_and_taint o (state_to_S s))]
val lemma_valid_src_operand128_and_taint (o:operand128) (s:vale_state) : Lemma
(requires valid_operand128 o s)
(ensures S.valid_src_operand128_and_taint o (state_to_S s))
[SMTPat (S.valid_src_operand128_and_taint o (state_to_S s))]
[@instr_attr]
let rec make_instr_t_args (args:list instr_operand) : Type0 =
match normal args with
| [] -> S.ins
| (IOpEx i)::args -> arrow (instr_operand_t i) (make_instr_t_args args)
| (IOpIm _)::args -> make_instr_t_args args
[@instr_attr]
let rec make_instr_t (outs:list instr_out) (args:list instr_operand) : Type0 =
match normal outs with
| [] -> make_instr_t_args args
| (_, IOpEx i)::outs -> arrow (instr_operand_t i) (make_instr_t outs args)
| (_, IOpIm _)::outs -> make_instr_t outs args
[@instr_attr]
let rec make_instr_args
(args:list instr_operand) (k:arrow (instr_operands_t_args args) S.ins)
: make_instr_t_args args =
match args with
| [] -> k ()
| (IOpEx i)::args -> fun (o:instr_operand_t i) ->
let k = coerce #(arrow (instr_operand_t i & instr_operands_t_args args) S.ins) k in // REVIEW: workaround for F* -> OCaml bug
let k (oprs:instr_operands_t_args args) : S.ins = k (o, oprs) in
make_instr_args args k
| (IOpIm i)::args -> coerce (make_instr_args args (coerce #(arrow (instr_operands_t_args args) S.ins) k))
[@instr_attr]
let rec make_instr_outs
(outs:list instr_out) (args:list instr_operand) (k:arrow (instr_operands_t outs args) S.ins)
: make_instr_t outs args =
match outs with
| [] -> make_instr_args args k
| (b, IOpEx i)::outs -> fun (o:instr_operand_t i) ->
let k = coerce #(arrow (instr_operand_t i & instr_operands_t outs args) S.ins) k in // REVIEW: workaround for F* -> OCaml bug
let k (oprs:instr_operands_t outs args) = k (o, oprs) in
make_instr_outs outs args k
| (_, IOpIm i)::outs -> coerce (make_instr_outs outs args (coerce #(arrow (instr_operands_t outs args) S.ins) k))
[@instr_attr]
let make_instr
(#outs:list instr_out) (#args:list instr_operand) (#havoc_flags:flag_havoc)
(i:instr_t outs args havoc_flags) | false | false | Vale.X64.InsLemmas.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val make_instr
(#outs: list instr_out)
(#args: list instr_operand)
(#havoc_flags: flag_havoc)
(i: instr_t outs args havoc_flags)
: make_instr_t outs args | [] | Vale.X64.InsLemmas.make_instr | {
"file_name": "vale/code/arch/x64/Vale.X64.InsLemmas.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | i: Vale.X64.Instruction_s.instr_t outs args havoc_flags -> Vale.X64.InsLemmas.make_instr_t outs args | {
"end_col": 90,
"end_line": 71,
"start_col": 2,
"start_line": 71
} |
Prims.Tot | val has_taint128 (o: operand128) (t: taint) : bool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Bytes_Code_s",
"short_module": "BC"
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Instruction_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let has_taint128 (o:operand128) (t:taint) : bool =
match o with
| OMem (_, t') | OStack (_, t') -> t = t'
| _ -> true | val has_taint128 (o: operand128) (t: taint) : bool
let has_taint128 (o: operand128) (t: taint) : bool = | false | null | false | match o with
| OMem (_, t') | OStack (_, t') -> t = t'
| _ -> true | {
"checked_file": "Vale.X64.InsLemmas.fsti.checked",
"dependencies": [
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.State.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Instruction_s.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.Bytes_Code_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.InsLemmas.fsti"
} | [
"total"
] | [
"Vale.X64.Machine_s.operand128",
"Vale.Arch.HeapTypes_s.taint",
"Vale.X64.Machine_s.maddr",
"Prims.op_Equality",
"Vale.X64.Machine_s.operand",
"Vale.X64.Machine_s.quad32",
"Vale.X64.Machine_s.reg_xmm",
"Prims.bool"
] | [] | module Vale.X64.InsLemmas
open FStar.Mul
open Vale.Arch.HeapImpl
open Vale.X64.Machine_s
open Vale.X64.Instruction_s
open Vale.X64.State
open Vale.X64.StateLemmas
open Vale.X64.Decls
open Vale.X64.Memory
module BC = Vale.X64.Bytes_Code_s
module S = Vale.X64.Machine_Semantics_s | false | true | Vale.X64.InsLemmas.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val has_taint128 (o: operand128) (t: taint) : bool | [] | Vale.X64.InsLemmas.has_taint128 | {
"file_name": "vale/code/arch/x64/Vale.X64.InsLemmas.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | o: Vale.X64.Machine_s.operand128 -> t: Vale.Arch.HeapTypes_s.taint -> Prims.bool | {
"end_col": 13,
"end_line": 16,
"start_col": 2,
"start_line": 14
} |
Prims.Tot | val make_instr_t_args (args: list instr_operand) : Type0 | [
{
"abbrev": false,
"full_module": "Vale.X64.Memory_Sems",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"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": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Bytes_Code_s",
"short_module": "BC"
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Instruction_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec make_instr_t_args (args:list instr_operand) : Type0 =
match normal args with
| [] -> S.ins
| (IOpEx i)::args -> arrow (instr_operand_t i) (make_instr_t_args args)
| (IOpIm _)::args -> make_instr_t_args args | val make_instr_t_args (args: list instr_operand) : Type0
let rec make_instr_t_args (args: list instr_operand) : Type0 = | false | null | false | match normal args with
| [] -> S.ins
| IOpEx i :: args -> arrow (instr_operand_t i) (make_instr_t_args args)
| IOpIm _ :: args -> make_instr_t_args args | {
"checked_file": "Vale.X64.InsLemmas.fsti.checked",
"dependencies": [
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.State.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Instruction_s.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.Bytes_Code_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.InsLemmas.fsti"
} | [
"total"
] | [
"Prims.list",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.normal",
"Vale.X64.Machine_Semantics_s.ins",
"Vale.X64.Instruction_s.instr_operand_explicit",
"Vale.X64.Instruction_s.arrow",
"Vale.X64.Instruction_s.instr_operand_t",
"Vale.X64.InsLemmas.make_instr_t_args",
"Vale.X64.Instruction_s.instr_operand_implicit"
] | [] | module Vale.X64.InsLemmas
open FStar.Mul
open Vale.Arch.HeapImpl
open Vale.X64.Machine_s
open Vale.X64.Instruction_s
open Vale.X64.State
open Vale.X64.StateLemmas
open Vale.X64.Decls
open Vale.X64.Memory
module BC = Vale.X64.Bytes_Code_s
module S = Vale.X64.Machine_Semantics_s
let has_taint128 (o:operand128) (t:taint) : bool =
match o with
| OMem (_, t') | OStack (_, t') -> t = t'
| _ -> true
val lemma_valid_src_operand64_and_taint (o:operand64) (s:vale_state) : Lemma
(requires valid_operand o s)
(ensures S.valid_src_operand64_and_taint o (state_to_S s))
[SMTPat (S.valid_src_operand64_and_taint o (state_to_S s))]
val lemma_valid_src_operand128_and_taint (o:operand128) (s:vale_state) : Lemma
(requires valid_operand128 o s)
(ensures S.valid_src_operand128_and_taint o (state_to_S s))
[SMTPat (S.valid_src_operand128_and_taint o (state_to_S s))]
[@instr_attr] | false | true | Vale.X64.InsLemmas.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val make_instr_t_args (args: list instr_operand) : Type0 | [
"recursion"
] | Vale.X64.InsLemmas.make_instr_t_args | {
"file_name": "vale/code/arch/x64/Vale.X64.InsLemmas.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | args: Prims.list Vale.X64.Instruction_s.instr_operand -> Type0 | {
"end_col": 45,
"end_line": 33,
"start_col": 2,
"start_line": 30
} |
Prims.Tot | val make_instr_t (outs: list instr_out) (args: list instr_operand) : Type0 | [
{
"abbrev": false,
"full_module": "Vale.X64.Memory_Sems",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"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": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Bytes_Code_s",
"short_module": "BC"
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Instruction_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec make_instr_t (outs:list instr_out) (args:list instr_operand) : Type0 =
match normal outs with
| [] -> make_instr_t_args args
| (_, IOpEx i)::outs -> arrow (instr_operand_t i) (make_instr_t outs args)
| (_, IOpIm _)::outs -> make_instr_t outs args | val make_instr_t (outs: list instr_out) (args: list instr_operand) : Type0
let rec make_instr_t (outs: list instr_out) (args: list instr_operand) : Type0 = | false | null | false | match normal outs with
| [] -> make_instr_t_args args
| (_, IOpEx i) :: outs -> arrow (instr_operand_t i) (make_instr_t outs args)
| (_, IOpIm _) :: outs -> make_instr_t outs args | {
"checked_file": "Vale.X64.InsLemmas.fsti.checked",
"dependencies": [
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.State.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Instruction_s.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.Bytes_Code_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.InsLemmas.fsti"
} | [
"total"
] | [
"Prims.list",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.normal",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.Instruction_s.instr_operand_inout",
"Vale.X64.InsLemmas.make_instr_t_args",
"Vale.X64.Instruction_s.instr_operand_explicit",
"Vale.X64.Instruction_s.arrow",
"Vale.X64.Instruction_s.instr_operand_t",
"Vale.X64.InsLemmas.make_instr_t",
"Vale.X64.Instruction_s.instr_operand_implicit"
] | [] | module Vale.X64.InsLemmas
open FStar.Mul
open Vale.Arch.HeapImpl
open Vale.X64.Machine_s
open Vale.X64.Instruction_s
open Vale.X64.State
open Vale.X64.StateLemmas
open Vale.X64.Decls
open Vale.X64.Memory
module BC = Vale.X64.Bytes_Code_s
module S = Vale.X64.Machine_Semantics_s
let has_taint128 (o:operand128) (t:taint) : bool =
match o with
| OMem (_, t') | OStack (_, t') -> t = t'
| _ -> true
val lemma_valid_src_operand64_and_taint (o:operand64) (s:vale_state) : Lemma
(requires valid_operand o s)
(ensures S.valid_src_operand64_and_taint o (state_to_S s))
[SMTPat (S.valid_src_operand64_and_taint o (state_to_S s))]
val lemma_valid_src_operand128_and_taint (o:operand128) (s:vale_state) : Lemma
(requires valid_operand128 o s)
(ensures S.valid_src_operand128_and_taint o (state_to_S s))
[SMTPat (S.valid_src_operand128_and_taint o (state_to_S s))]
[@instr_attr]
let rec make_instr_t_args (args:list instr_operand) : Type0 =
match normal args with
| [] -> S.ins
| (IOpEx i)::args -> arrow (instr_operand_t i) (make_instr_t_args args)
| (IOpIm _)::args -> make_instr_t_args args
[@instr_attr] | false | true | Vale.X64.InsLemmas.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val make_instr_t (outs: list instr_out) (args: list instr_operand) : Type0 | [
"recursion"
] | Vale.X64.InsLemmas.make_instr_t | {
"file_name": "vale/code/arch/x64/Vale.X64.InsLemmas.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
outs: Prims.list Vale.X64.Instruction_s.instr_out ->
args: Prims.list Vale.X64.Instruction_s.instr_operand
-> Type0 | {
"end_col": 48,
"end_line": 40,
"start_col": 2,
"start_line": 37
} |
Prims.Tot | val make_instr_outs
(outs: list instr_out)
(args: list instr_operand)
(k: arrow (instr_operands_t outs args) S.ins)
: make_instr_t outs args | [
{
"abbrev": false,
"full_module": "Vale.X64.Memory_Sems",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"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": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Bytes_Code_s",
"short_module": "BC"
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Instruction_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec make_instr_outs
(outs:list instr_out) (args:list instr_operand) (k:arrow (instr_operands_t outs args) S.ins)
: make_instr_t outs args =
match outs with
| [] -> make_instr_args args k
| (b, IOpEx i)::outs -> fun (o:instr_operand_t i) ->
let k = coerce #(arrow (instr_operand_t i & instr_operands_t outs args) S.ins) k in // REVIEW: workaround for F* -> OCaml bug
let k (oprs:instr_operands_t outs args) = k (o, oprs) in
make_instr_outs outs args k
| (_, IOpIm i)::outs -> coerce (make_instr_outs outs args (coerce #(arrow (instr_operands_t outs args) S.ins) k)) | val make_instr_outs
(outs: list instr_out)
(args: list instr_operand)
(k: arrow (instr_operands_t outs args) S.ins)
: make_instr_t outs args
let rec make_instr_outs
(outs: list instr_out)
(args: list instr_operand)
(k: arrow (instr_operands_t outs args) S.ins)
: make_instr_t outs args = | false | null | false | match outs with
| [] -> make_instr_args args k
| (b, IOpEx i) :: outs ->
fun (o: instr_operand_t i) ->
let k = coerce #(arrow (instr_operand_t i & instr_operands_t outs args) S.ins) k in
let k (oprs: instr_operands_t outs args) = k (o, oprs) in
make_instr_outs outs args k
| (_, IOpIm i) :: outs ->
coerce (make_instr_outs outs args (coerce #(arrow (instr_operands_t outs args) S.ins) k)) | {
"checked_file": "Vale.X64.InsLemmas.fsti.checked",
"dependencies": [
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.State.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Instruction_s.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.Bytes_Code_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.InsLemmas.fsti"
} | [
"total"
] | [
"Prims.list",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.arrow",
"Vale.X64.Instruction_s.instr_operands_t",
"Vale.X64.Machine_Semantics_s.ins",
"Vale.X64.InsLemmas.make_instr_args",
"Vale.X64.Instruction_s.instr_operand_inout",
"Vale.X64.Instruction_s.instr_operand_explicit",
"Vale.X64.Instruction_s.instr_operand_t",
"Vale.X64.InsLemmas.make_instr_outs",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.StateLemmas.coerce",
"Vale.X64.InsLemmas.make_instr_t",
"Vale.X64.Instruction_s.instr_operand_implicit"
] | [] | module Vale.X64.InsLemmas
open FStar.Mul
open Vale.Arch.HeapImpl
open Vale.X64.Machine_s
open Vale.X64.Instruction_s
open Vale.X64.State
open Vale.X64.StateLemmas
open Vale.X64.Decls
open Vale.X64.Memory
module BC = Vale.X64.Bytes_Code_s
module S = Vale.X64.Machine_Semantics_s
let has_taint128 (o:operand128) (t:taint) : bool =
match o with
| OMem (_, t') | OStack (_, t') -> t = t'
| _ -> true
val lemma_valid_src_operand64_and_taint (o:operand64) (s:vale_state) : Lemma
(requires valid_operand o s)
(ensures S.valid_src_operand64_and_taint o (state_to_S s))
[SMTPat (S.valid_src_operand64_and_taint o (state_to_S s))]
val lemma_valid_src_operand128_and_taint (o:operand128) (s:vale_state) : Lemma
(requires valid_operand128 o s)
(ensures S.valid_src_operand128_and_taint o (state_to_S s))
[SMTPat (S.valid_src_operand128_and_taint o (state_to_S s))]
[@instr_attr]
let rec make_instr_t_args (args:list instr_operand) : Type0 =
match normal args with
| [] -> S.ins
| (IOpEx i)::args -> arrow (instr_operand_t i) (make_instr_t_args args)
| (IOpIm _)::args -> make_instr_t_args args
[@instr_attr]
let rec make_instr_t (outs:list instr_out) (args:list instr_operand) : Type0 =
match normal outs with
| [] -> make_instr_t_args args
| (_, IOpEx i)::outs -> arrow (instr_operand_t i) (make_instr_t outs args)
| (_, IOpIm _)::outs -> make_instr_t outs args
[@instr_attr]
let rec make_instr_args
(args:list instr_operand) (k:arrow (instr_operands_t_args args) S.ins)
: make_instr_t_args args =
match args with
| [] -> k ()
| (IOpEx i)::args -> fun (o:instr_operand_t i) ->
let k = coerce #(arrow (instr_operand_t i & instr_operands_t_args args) S.ins) k in // REVIEW: workaround for F* -> OCaml bug
let k (oprs:instr_operands_t_args args) : S.ins = k (o, oprs) in
make_instr_args args k
| (IOpIm i)::args -> coerce (make_instr_args args (coerce #(arrow (instr_operands_t_args args) S.ins) k))
[@instr_attr]
let rec make_instr_outs
(outs:list instr_out) (args:list instr_operand) (k:arrow (instr_operands_t outs args) S.ins) | false | false | Vale.X64.InsLemmas.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val make_instr_outs
(outs: list instr_out)
(args: list instr_operand)
(k: arrow (instr_operands_t outs args) S.ins)
: make_instr_t outs args | [
"recursion"
] | Vale.X64.InsLemmas.make_instr_outs | {
"file_name": "vale/code/arch/x64/Vale.X64.InsLemmas.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
outs: Prims.list Vale.X64.Instruction_s.instr_out ->
args: Prims.list Vale.X64.Instruction_s.instr_operand ->
k:
Vale.X64.Instruction_s.arrow (Vale.X64.Instruction_s.instr_operands_t outs args)
Vale.X64.Machine_Semantics_s.ins
-> Vale.X64.InsLemmas.make_instr_t outs args | {
"end_col": 115,
"end_line": 64,
"start_col": 2,
"start_line": 58
} |
Prims.Tot | val make_instr_args (args: list instr_operand) (k: arrow (instr_operands_t_args args) S.ins)
: make_instr_t_args args | [
{
"abbrev": false,
"full_module": "Vale.X64.Memory_Sems",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"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": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Bytes_Code_s",
"short_module": "BC"
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Instruction_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec make_instr_args
(args:list instr_operand) (k:arrow (instr_operands_t_args args) S.ins)
: make_instr_t_args args =
match args with
| [] -> k ()
| (IOpEx i)::args -> fun (o:instr_operand_t i) ->
let k = coerce #(arrow (instr_operand_t i & instr_operands_t_args args) S.ins) k in // REVIEW: workaround for F* -> OCaml bug
let k (oprs:instr_operands_t_args args) : S.ins = k (o, oprs) in
make_instr_args args k
| (IOpIm i)::args -> coerce (make_instr_args args (coerce #(arrow (instr_operands_t_args args) S.ins) k)) | val make_instr_args (args: list instr_operand) (k: arrow (instr_operands_t_args args) S.ins)
: make_instr_t_args args
let rec make_instr_args (args: list instr_operand) (k: arrow (instr_operands_t_args args) S.ins)
: make_instr_t_args args = | false | null | false | match args with
| [] -> k ()
| IOpEx i :: args ->
fun (o: instr_operand_t i) ->
let k = coerce #(arrow (instr_operand_t i & instr_operands_t_args args) S.ins) k in
let k (oprs: instr_operands_t_args args) : S.ins = k (o, oprs) in
make_instr_args args k
| IOpIm i :: args ->
coerce (make_instr_args args (coerce #(arrow (instr_operands_t_args args) S.ins) k)) | {
"checked_file": "Vale.X64.InsLemmas.fsti.checked",
"dependencies": [
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.State.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Instruction_s.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.Bytes_Code_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.InsLemmas.fsti"
} | [
"total"
] | [
"Prims.list",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.arrow",
"Vale.X64.Instruction_s.instr_operands_t_args",
"Vale.X64.Machine_Semantics_s.ins",
"Vale.X64.Instruction_s.instr_operand_explicit",
"Vale.X64.Instruction_s.instr_operand_t",
"Vale.X64.InsLemmas.make_instr_args",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.StateLemmas.coerce",
"Vale.X64.InsLemmas.make_instr_t_args",
"Vale.X64.Instruction_s.instr_operand_implicit"
] | [] | module Vale.X64.InsLemmas
open FStar.Mul
open Vale.Arch.HeapImpl
open Vale.X64.Machine_s
open Vale.X64.Instruction_s
open Vale.X64.State
open Vale.X64.StateLemmas
open Vale.X64.Decls
open Vale.X64.Memory
module BC = Vale.X64.Bytes_Code_s
module S = Vale.X64.Machine_Semantics_s
let has_taint128 (o:operand128) (t:taint) : bool =
match o with
| OMem (_, t') | OStack (_, t') -> t = t'
| _ -> true
val lemma_valid_src_operand64_and_taint (o:operand64) (s:vale_state) : Lemma
(requires valid_operand o s)
(ensures S.valid_src_operand64_and_taint o (state_to_S s))
[SMTPat (S.valid_src_operand64_and_taint o (state_to_S s))]
val lemma_valid_src_operand128_and_taint (o:operand128) (s:vale_state) : Lemma
(requires valid_operand128 o s)
(ensures S.valid_src_operand128_and_taint o (state_to_S s))
[SMTPat (S.valid_src_operand128_and_taint o (state_to_S s))]
[@instr_attr]
let rec make_instr_t_args (args:list instr_operand) : Type0 =
match normal args with
| [] -> S.ins
| (IOpEx i)::args -> arrow (instr_operand_t i) (make_instr_t_args args)
| (IOpIm _)::args -> make_instr_t_args args
[@instr_attr]
let rec make_instr_t (outs:list instr_out) (args:list instr_operand) : Type0 =
match normal outs with
| [] -> make_instr_t_args args
| (_, IOpEx i)::outs -> arrow (instr_operand_t i) (make_instr_t outs args)
| (_, IOpIm _)::outs -> make_instr_t outs args
[@instr_attr]
let rec make_instr_args
(args:list instr_operand) (k:arrow (instr_operands_t_args args) S.ins) | false | false | Vale.X64.InsLemmas.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val make_instr_args (args: list instr_operand) (k: arrow (instr_operands_t_args args) S.ins)
: make_instr_t_args args | [
"recursion"
] | Vale.X64.InsLemmas.make_instr_args | {
"file_name": "vale/code/arch/x64/Vale.X64.InsLemmas.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
args: Prims.list Vale.X64.Instruction_s.instr_operand ->
k:
Vale.X64.Instruction_s.arrow (Vale.X64.Instruction_s.instr_operands_t_args args)
Vale.X64.Machine_Semantics_s.ins
-> Vale.X64.InsLemmas.make_instr_t_args args | {
"end_col": 107,
"end_line": 52,
"start_col": 2,
"start_line": 46
} |
Prims.Tot | val implies_elim: p: Type -> q: Type -> squash (p ==> q) -> f: (unit -> Tot (squash p)) -> squash q | [
{
"abbrev": false,
"full_module": "FStar.Classical",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Classical",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let implies_elim
(p:Type)
(q:Type)
(_:squash (p ==> q))
(f:unit -> Tot (squash p))
: squash q
= f() | val implies_elim: p: Type -> q: Type -> squash (p ==> q) -> f: (unit -> Tot (squash p)) -> squash q
let implies_elim (p: Type) (q: Type) (_: squash (p ==> q)) (f: (unit -> Tot (squash p))) : squash q = | false | null | true | f () | {
"checked_file": "FStar.Classical.Sugar.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Classical.Sugar.fsti"
} | [
"total"
] | [
"Prims.squash",
"Prims.l_imp",
"Prims.unit"
] | [] | (*
Copyright 2021 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.Classical.Sugar
/// This module provides a few combinators that are targeted
/// by the desugaring phase of the F* front end
///
/// The combinators it provides are fairly standard, except for one
/// subtlety. In F*, the typechecking of terms formed using the
/// logical connectives is biased from left to right. That is:
///
/// * In [p /\ q] and [p ==> q], the well-typedness of [q] is in a
/// context assuming [squash p]
///
/// * In [p \/ q], the well-typedness of [q] is in a context assuming
/// [squash (~p)]
///
/// So, many of these combinators reflect that bias by taking as
/// instantiations for [q] functions that depend on [squash p] or
/// [squash (~p)].
///
/// The other subtlety is that the when using these combinators, we
/// encapsulate any proof terms provided by the caller within a
/// thunk. This is to ensure that if, for instance, the caller simply
/// admits a goal, that they do not inadvertently discard any proof
/// obligations in the remainder of their programs.
///
/// For example, consider the difference between
///
/// 1. exists_intro a p v (admit()); rest
///
/// and
///
/// 2. exists_intro a p v (fun _ -> admit()); rest
///
/// In (1) the proof of rest is admitted also.
(** Eliminate a universal quantifier by providing an instantiation *)
val forall_elim
(#a:Type)
(#p:a -> Type)
(v:a)
(f:squash (forall (x:a). p x))
: Tot (squash (p v))
(** Eliminate an existential quantifier into a proof of a goal [q] *)
val exists_elim
(#t:Type)
(#p:t -> Type)
(#q:Type)
($s_ex_p: squash (exists (x:t). p x))
(f: (x:t -> squash (p x) -> Tot (squash q)))
: Tot (squash q)
(** Eliminate an implication, by providing a proof of the hypothesis
Note, the proof is thunked *)
let implies_elim
(p:Type)
(q:Type)
(_:squash (p ==> q))
(f:unit -> Tot (squash p)) | false | false | FStar.Classical.Sugar.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val implies_elim: p: Type -> q: Type -> squash (p ==> q) -> f: (unit -> Tot (squash p)) -> squash q | [] | FStar.Classical.Sugar.implies_elim | {
"file_name": "ulib/FStar.Classical.Sugar.fsti",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | p: Type0 -> q: Type0 -> _: Prims.squash (p ==> q) -> f: (_: Prims.unit -> Prims.squash p)
-> Prims.squash q | {
"end_col": 7,
"end_line": 78,
"start_col": 4,
"start_line": 78
} |
FStar.HyperStack.ST.Stack | val crypto_box_beforenm:
k:lbuffer uint8 32ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h -> live h k /\ live h pk /\ live h sk /\
disjoint k pk /\ disjoint k sk)
(ensures fun h0 r h1 -> modifies1 k h0 h1 /\
(let key = SB.box_beforenm (as_seq h0 pk) (as_seq h0 sk) in
match r with
| 0ul -> Some? key /\ as_seq h1 k == Some?.v key
| _ -> None? key)) | [
{
"abbrev": true,
"full_module": "Spec.SecretBox",
"short_module": "SS"
},
{
"abbrev": true,
"full_module": "Spec.Box",
"short_module": "SB"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let crypto_box_beforenm k pk sk =
Hacl.Impl.Box.box_beforenm k pk sk | val crypto_box_beforenm:
k:lbuffer uint8 32ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h -> live h k /\ live h pk /\ live h sk /\
disjoint k pk /\ disjoint k sk)
(ensures fun h0 r h1 -> modifies1 k h0 h1 /\
(let key = SB.box_beforenm (as_seq h0 pk) (as_seq h0 sk) in
match r with
| 0ul -> Some? key /\ as_seq h1 k == Some?.v key
| _ -> None? key))
let crypto_box_beforenm k pk sk = | true | null | false | Hacl.Impl.Box.box_beforenm k pk sk | {
"checked_file": "Hacl.NaCl.fst.checked",
"dependencies": [
"Spec.SecretBox.fst.checked",
"Spec.Box.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Impl.SecretBox.fst.checked",
"Hacl.Impl.Box.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.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.NaCl.fst"
} | [] | [
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint8",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.Box.box_beforenm",
"Lib.IntTypes.size_t"
] | [] | module Hacl.NaCl
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module SB = Spec.Box
module SS = Spec.SecretBox
#set-options "--max_fuel 50 --max_fuel 0 --max_ifuel 0"
[@@ Comment "Encrypt a message with a key and nonce.
Note: `c` and `m` can point to the same memory for in-place encryption.
@param c Pointer to `mlen` bytes where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_detached c tag m mlen n k =
Hacl.Impl.SecretBox.secretbox_detached mlen c tag k n m;
0ul
[@@ Comment "Verify and decrypt a ciphertext produced with `Hacl_NaCl_crypto_secretbox_detached`.
Note: `m` and `c` can point to the same memory for in-place decryption.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `mlen` bytes where the ciphertext is read from.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is read from.
@param mlen Length of message (and ciphertext).
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_detached m c tag mlen n k =
Hacl.Impl.SecretBox.secretbox_open_detached mlen m k n c tag
[@@ Comment "Encrypt a message with a key and nonce.
@param c Pointer to 16 (tag length) + `mlen` bytes where the ciphertext is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SS.secretbox_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_easy c m mlen n k =
Hacl.Impl.SecretBox.secretbox_easy mlen c k n m;
0ul
#set-options "--z3rlimit 100"
[@@ Comment "Verify and decrypt a ciphertext produced with `crypto_secretbox_easy`.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `clen` bytes where the ciphertext is read from. The authentication tag must be included.
@param clen Length of ciphertext.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_easy m c clen n k =
Hacl.Impl.SecretBox.secretbox_open_easy (clen -! 16ul) m k n c
[@@ Comment "Compute a shared secret key given a public key and secret key.
@param k Pointer to 32 (`crypto_box_BEFORENMBYTES`) bytes of memory where the shared secret is written to.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_beforenm:
k:lbuffer uint8 32ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h -> live h k /\ live h pk /\ live h sk /\
disjoint k pk /\ disjoint k sk)
(ensures fun h0 r h1 -> modifies1 k h0 h1 /\
(let key = SB.box_beforenm (as_seq h0 pk) (as_seq h0 sk) in
match r with
| 0ul -> Some? key /\ as_seq h1 k == Some?.v key
| _ -> None? key)) | false | false | Hacl.NaCl.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val crypto_box_beforenm:
k:lbuffer uint8 32ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h -> live h k /\ live h pk /\ live h sk /\
disjoint k pk /\ disjoint k sk)
(ensures fun h0 r h1 -> modifies1 k h0 h1 /\
(let key = SB.box_beforenm (as_seq h0 pk) (as_seq h0 sk) in
match r with
| 0ul -> Some? key /\ as_seq h1 k == Some?.v key
| _ -> None? key)) | [] | Hacl.NaCl.crypto_box_beforenm | {
"file_name": "code/nacl-box/Hacl.NaCl.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
k: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul ->
pk: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul ->
sk: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul
-> FStar.HyperStack.ST.Stack Lib.IntTypes.size_t | {
"end_col": 36,
"end_line": 155,
"start_col": 2,
"start_line": 155
} |
FStar.HyperStack.ST.Stack | val crypto_box_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h pk /\ live h sk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached (as_seq h0 pk) (as_seq h0 sk) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg)) | [
{
"abbrev": true,
"full_module": "Spec.SecretBox",
"short_module": "SS"
},
{
"abbrev": true,
"full_module": "Spec.Box",
"short_module": "SB"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let crypto_box_open_detached m c tag mlen n pk sk =
Hacl.Impl.Box.box_open_detached mlen m pk sk n c tag | val crypto_box_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h pk /\ live h sk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached (as_seq h0 pk) (as_seq h0 sk) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_box_open_detached m c tag mlen n pk sk = | true | null | false | Hacl.Impl.Box.box_open_detached mlen m pk sk n c tag | {
"checked_file": "Hacl.NaCl.fst.checked",
"dependencies": [
"Spec.SecretBox.fst.checked",
"Spec.Box.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Impl.SecretBox.fst.checked",
"Hacl.Impl.Box.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.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.NaCl.fst"
} | [] | [
"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.Box.box_open_detached"
] | [] | module Hacl.NaCl
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module SB = Spec.Box
module SS = Spec.SecretBox
#set-options "--max_fuel 50 --max_fuel 0 --max_ifuel 0"
[@@ Comment "Encrypt a message with a key and nonce.
Note: `c` and `m` can point to the same memory for in-place encryption.
@param c Pointer to `mlen` bytes where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_detached c tag m mlen n k =
Hacl.Impl.SecretBox.secretbox_detached mlen c tag k n m;
0ul
[@@ Comment "Verify and decrypt a ciphertext produced with `Hacl_NaCl_crypto_secretbox_detached`.
Note: `m` and `c` can point to the same memory for in-place decryption.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `mlen` bytes where the ciphertext is read from.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is read from.
@param mlen Length of message (and ciphertext).
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_detached m c tag mlen n k =
Hacl.Impl.SecretBox.secretbox_open_detached mlen m k n c tag
[@@ Comment "Encrypt a message with a key and nonce.
@param c Pointer to 16 (tag length) + `mlen` bytes where the ciphertext is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SS.secretbox_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_easy c m mlen n k =
Hacl.Impl.SecretBox.secretbox_easy mlen c k n m;
0ul
#set-options "--z3rlimit 100"
[@@ Comment "Verify and decrypt a ciphertext produced with `crypto_secretbox_easy`.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `clen` bytes where the ciphertext is read from. The authentication tag must be included.
@param clen Length of ciphertext.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_easy m c clen n k =
Hacl.Impl.SecretBox.secretbox_open_easy (clen -! 16ul) m k n c
[@@ Comment "Compute a shared secret key given a public key and secret key.
@param k Pointer to 32 (`crypto_box_BEFORENMBYTES`) bytes of memory where the shared secret is written to.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_beforenm:
k:lbuffer uint8 32ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h -> live h k /\ live h pk /\ live h sk /\
disjoint k pk /\ disjoint k sk)
(ensures fun h0 r h1 -> modifies1 k h0 h1 /\
(let key = SB.box_beforenm (as_seq h0 pk) (as_seq h0 sk) in
match r with
| 0ul -> Some? key /\ as_seq h1 k == Some?.v key
| _ -> None? key))
let crypto_box_beforenm k pk sk =
Hacl.Impl.Box.box_beforenm k pk sk
[@@ Comment "See `crypto_box_detached`."]
val crypto_box_detached_afternm:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SB.box_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_box_detached_afternm c tag m mlen n k =
Hacl.Impl.Box.box_detached_afternm mlen c tag k n m
[@@ Comment "Encrypt a message using the recipient's public key, the sender's secret key, and a nonce.
@param c Pointer to `mlen` bytes of memory where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes of memory where the authentication tag is written to.
@param m Pointer to `mlen` bytes of memory where the message is read from.
@param mlen Length of the message.
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(let tag_cipher = SB.box_detached (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? tag_cipher /\ (let (tag_s, cipher_s) = Some?.v tag_cipher in (as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == (tag_s, cipher_s))
| _ -> None? tag_cipher))
let crypto_box_detached c tag m mlen n pk sk =
Hacl.Impl.Box.box_detached mlen c tag sk pk n m
[@@ Comment "See `crypto_box_open_detached`."]
val crypto_box_open_detached_afternm:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_box_open_detached_afternm m c tag mlen n k =
Hacl.Impl.Box.box_open_detached_afternm mlen m k n c tag
[@@ Comment "Verify and decrypt a ciphertext produced by `crypto_box_detached`.
@param m Pointer to `mlen` bytes of memory where the decrypted message is written to.
@param c Pointer to `mlen` bytes of memory where the ciphertext is read from. Note: the ciphertext must include the tag.
@param tag Pointer to 16 (tag length) bytes of memory where the authentication tag is read from.
@param mlen Length of the message (and ciphertext).
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where the public key of the sender is read from.
@param sk Pointer to 32 bytes of memory where the secret key of the recipient is read from."]
val crypto_box_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h pk /\ live h sk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached (as_seq h0 pk) (as_seq h0 sk) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg)) | false | false | Hacl.NaCl.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val crypto_box_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h pk /\ live h sk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached (as_seq h0 pk) (as_seq h0 sk) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg)) | [] | Hacl.NaCl.crypto_box_open_detached | {
"file_name": "code/nacl-box/Hacl.NaCl.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
m: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
c: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
tag: Lib.Buffer.lbuffer Lib.IntTypes.uint8 16ul ->
mlen:
Lib.IntTypes.size_t
{Lib.Buffer.length c = Lib.IntTypes.v mlen /\ Lib.Buffer.length m = Lib.IntTypes.v mlen} ->
n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 24ul ->
pk: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul ->
sk: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul
-> FStar.HyperStack.ST.Stack Lib.IntTypes.size_t | {
"end_col": 54,
"end_line": 262,
"start_col": 2,
"start_line": 262
} |
FStar.HyperStack.ST.Stack | val crypto_box_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(let tag_cipher = SB.box_detached (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? tag_cipher /\ (let (tag_s, cipher_s) = Some?.v tag_cipher in (as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == (tag_s, cipher_s))
| _ -> None? tag_cipher)) | [
{
"abbrev": true,
"full_module": "Spec.SecretBox",
"short_module": "SS"
},
{
"abbrev": true,
"full_module": "Spec.Box",
"short_module": "SB"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let crypto_box_detached c tag m mlen n pk sk =
Hacl.Impl.Box.box_detached mlen c tag sk pk n m | val crypto_box_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(let tag_cipher = SB.box_detached (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? tag_cipher /\ (let (tag_s, cipher_s) = Some?.v tag_cipher in (as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == (tag_s, cipher_s))
| _ -> None? tag_cipher))
let crypto_box_detached c tag m mlen n pk sk = | true | null | false | Hacl.Impl.Box.box_detached mlen c tag sk pk n m | {
"checked_file": "Hacl.NaCl.fst.checked",
"dependencies": [
"Spec.SecretBox.fst.checked",
"Spec.Box.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Impl.SecretBox.fst.checked",
"Hacl.Impl.Box.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.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.NaCl.fst"
} | [] | [
"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.Box.box_detached"
] | [] | module Hacl.NaCl
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module SB = Spec.Box
module SS = Spec.SecretBox
#set-options "--max_fuel 50 --max_fuel 0 --max_ifuel 0"
[@@ Comment "Encrypt a message with a key and nonce.
Note: `c` and `m` can point to the same memory for in-place encryption.
@param c Pointer to `mlen` bytes where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_detached c tag m mlen n k =
Hacl.Impl.SecretBox.secretbox_detached mlen c tag k n m;
0ul
[@@ Comment "Verify and decrypt a ciphertext produced with `Hacl_NaCl_crypto_secretbox_detached`.
Note: `m` and `c` can point to the same memory for in-place decryption.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `mlen` bytes where the ciphertext is read from.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is read from.
@param mlen Length of message (and ciphertext).
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_detached m c tag mlen n k =
Hacl.Impl.SecretBox.secretbox_open_detached mlen m k n c tag
[@@ Comment "Encrypt a message with a key and nonce.
@param c Pointer to 16 (tag length) + `mlen` bytes where the ciphertext is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SS.secretbox_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_easy c m mlen n k =
Hacl.Impl.SecretBox.secretbox_easy mlen c k n m;
0ul
#set-options "--z3rlimit 100"
[@@ Comment "Verify and decrypt a ciphertext produced with `crypto_secretbox_easy`.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `clen` bytes where the ciphertext is read from. The authentication tag must be included.
@param clen Length of ciphertext.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_easy m c clen n k =
Hacl.Impl.SecretBox.secretbox_open_easy (clen -! 16ul) m k n c
[@@ Comment "Compute a shared secret key given a public key and secret key.
@param k Pointer to 32 (`crypto_box_BEFORENMBYTES`) bytes of memory where the shared secret is written to.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_beforenm:
k:lbuffer uint8 32ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h -> live h k /\ live h pk /\ live h sk /\
disjoint k pk /\ disjoint k sk)
(ensures fun h0 r h1 -> modifies1 k h0 h1 /\
(let key = SB.box_beforenm (as_seq h0 pk) (as_seq h0 sk) in
match r with
| 0ul -> Some? key /\ as_seq h1 k == Some?.v key
| _ -> None? key))
let crypto_box_beforenm k pk sk =
Hacl.Impl.Box.box_beforenm k pk sk
[@@ Comment "See `crypto_box_detached`."]
val crypto_box_detached_afternm:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SB.box_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_box_detached_afternm c tag m mlen n k =
Hacl.Impl.Box.box_detached_afternm mlen c tag k n m
[@@ Comment "Encrypt a message using the recipient's public key, the sender's secret key, and a nonce.
@param c Pointer to `mlen` bytes of memory where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes of memory where the authentication tag is written to.
@param m Pointer to `mlen` bytes of memory where the message is read from.
@param mlen Length of the message.
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(let tag_cipher = SB.box_detached (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? tag_cipher /\ (let (tag_s, cipher_s) = Some?.v tag_cipher in (as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == (tag_s, cipher_s))
| _ -> None? tag_cipher)) | false | false | Hacl.NaCl.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val crypto_box_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(let tag_cipher = SB.box_detached (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? tag_cipher /\ (let (tag_s, cipher_s) = Some?.v tag_cipher in (as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == (tag_s, cipher_s))
| _ -> None? tag_cipher)) | [] | Hacl.NaCl.crypto_box_detached | {
"file_name": "code/nacl-box/Hacl.NaCl.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
c: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
tag: Lib.Buffer.lbuffer Lib.IntTypes.uint8 16ul ->
m: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
mlen:
Lib.IntTypes.size_t
{Lib.Buffer.length c = Lib.IntTypes.v mlen /\ Lib.Buffer.length m = Lib.IntTypes.v mlen} ->
n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 24ul ->
pk: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul ->
sk: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul
-> FStar.HyperStack.ST.Stack Lib.IntTypes.size_t | {
"end_col": 49,
"end_line": 207,
"start_col": 2,
"start_line": 207
} |
FStar.HyperStack.ST.Stack | val crypto_box_open_detached_afternm:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg)) | [
{
"abbrev": true,
"full_module": "Spec.SecretBox",
"short_module": "SS"
},
{
"abbrev": true,
"full_module": "Spec.Box",
"short_module": "SB"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let crypto_box_open_detached_afternm m c tag mlen n k =
Hacl.Impl.Box.box_open_detached_afternm mlen m k n c tag | val crypto_box_open_detached_afternm:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_box_open_detached_afternm m c tag mlen n k = | true | null | false | Hacl.Impl.Box.box_open_detached_afternm mlen m k n c tag | {
"checked_file": "Hacl.NaCl.fst.checked",
"dependencies": [
"Spec.SecretBox.fst.checked",
"Spec.Box.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Impl.SecretBox.fst.checked",
"Hacl.Impl.Box.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.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.NaCl.fst"
} | [] | [
"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.Box.box_open_detached_afternm"
] | [] | module Hacl.NaCl
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module SB = Spec.Box
module SS = Spec.SecretBox
#set-options "--max_fuel 50 --max_fuel 0 --max_ifuel 0"
[@@ Comment "Encrypt a message with a key and nonce.
Note: `c` and `m` can point to the same memory for in-place encryption.
@param c Pointer to `mlen` bytes where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_detached c tag m mlen n k =
Hacl.Impl.SecretBox.secretbox_detached mlen c tag k n m;
0ul
[@@ Comment "Verify and decrypt a ciphertext produced with `Hacl_NaCl_crypto_secretbox_detached`.
Note: `m` and `c` can point to the same memory for in-place decryption.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `mlen` bytes where the ciphertext is read from.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is read from.
@param mlen Length of message (and ciphertext).
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_detached m c tag mlen n k =
Hacl.Impl.SecretBox.secretbox_open_detached mlen m k n c tag
[@@ Comment "Encrypt a message with a key and nonce.
@param c Pointer to 16 (tag length) + `mlen` bytes where the ciphertext is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SS.secretbox_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_easy c m mlen n k =
Hacl.Impl.SecretBox.secretbox_easy mlen c k n m;
0ul
#set-options "--z3rlimit 100"
[@@ Comment "Verify and decrypt a ciphertext produced with `crypto_secretbox_easy`.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `clen` bytes where the ciphertext is read from. The authentication tag must be included.
@param clen Length of ciphertext.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_easy m c clen n k =
Hacl.Impl.SecretBox.secretbox_open_easy (clen -! 16ul) m k n c
[@@ Comment "Compute a shared secret key given a public key and secret key.
@param k Pointer to 32 (`crypto_box_BEFORENMBYTES`) bytes of memory where the shared secret is written to.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_beforenm:
k:lbuffer uint8 32ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h -> live h k /\ live h pk /\ live h sk /\
disjoint k pk /\ disjoint k sk)
(ensures fun h0 r h1 -> modifies1 k h0 h1 /\
(let key = SB.box_beforenm (as_seq h0 pk) (as_seq h0 sk) in
match r with
| 0ul -> Some? key /\ as_seq h1 k == Some?.v key
| _ -> None? key))
let crypto_box_beforenm k pk sk =
Hacl.Impl.Box.box_beforenm k pk sk
[@@ Comment "See `crypto_box_detached`."]
val crypto_box_detached_afternm:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SB.box_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_box_detached_afternm c tag m mlen n k =
Hacl.Impl.Box.box_detached_afternm mlen c tag k n m
[@@ Comment "Encrypt a message using the recipient's public key, the sender's secret key, and a nonce.
@param c Pointer to `mlen` bytes of memory where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes of memory where the authentication tag is written to.
@param m Pointer to `mlen` bytes of memory where the message is read from.
@param mlen Length of the message.
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(let tag_cipher = SB.box_detached (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? tag_cipher /\ (let (tag_s, cipher_s) = Some?.v tag_cipher in (as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == (tag_s, cipher_s))
| _ -> None? tag_cipher))
let crypto_box_detached c tag m mlen n pk sk =
Hacl.Impl.Box.box_detached mlen c tag sk pk n m
[@@ Comment "See `crypto_box_open_detached`."]
val crypto_box_open_detached_afternm:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg)) | false | false | Hacl.NaCl.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val crypto_box_open_detached_afternm:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg)) | [] | Hacl.NaCl.crypto_box_open_detached_afternm | {
"file_name": "code/nacl-box/Hacl.NaCl.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
m: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
c: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
tag: Lib.Buffer.lbuffer Lib.IntTypes.uint8 16ul ->
mlen:
Lib.IntTypes.size_t
{Lib.Buffer.length c = Lib.IntTypes.v mlen /\ Lib.Buffer.length m = Lib.IntTypes.v mlen} ->
n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 24ul ->
k: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul
-> FStar.HyperStack.ST.Stack Lib.IntTypes.size_t | {
"end_col": 58,
"end_line": 230,
"start_col": 2,
"start_line": 230
} |
FStar.HyperStack.ST.Stack | val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg)) | [
{
"abbrev": true,
"full_module": "Spec.SecretBox",
"short_module": "SS"
},
{
"abbrev": true,
"full_module": "Spec.Box",
"short_module": "SB"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let crypto_secretbox_open_detached m c tag mlen n k =
Hacl.Impl.SecretBox.secretbox_open_detached mlen m k n c tag | val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_detached m c tag mlen n k = | true | null | false | Hacl.Impl.SecretBox.secretbox_open_detached mlen m k n c tag | {
"checked_file": "Hacl.NaCl.fst.checked",
"dependencies": [
"Spec.SecretBox.fst.checked",
"Spec.Box.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Impl.SecretBox.fst.checked",
"Hacl.Impl.Box.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.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.NaCl.fst"
} | [] | [
"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.SecretBox.secretbox_open_detached"
] | [] | module Hacl.NaCl
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module SB = Spec.Box
module SS = Spec.SecretBox
#set-options "--max_fuel 50 --max_fuel 0 --max_ifuel 0"
[@@ Comment "Encrypt a message with a key and nonce.
Note: `c` and `m` can point to the same memory for in-place encryption.
@param c Pointer to `mlen` bytes where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_detached c tag m mlen n k =
Hacl.Impl.SecretBox.secretbox_detached mlen c tag k n m;
0ul
[@@ Comment "Verify and decrypt a ciphertext produced with `Hacl_NaCl_crypto_secretbox_detached`.
Note: `m` and `c` can point to the same memory for in-place decryption.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `mlen` bytes where the ciphertext is read from.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is read from.
@param mlen Length of message (and ciphertext).
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg)) | false | false | Hacl.NaCl.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg)) | [] | Hacl.NaCl.crypto_secretbox_open_detached | {
"file_name": "code/nacl-box/Hacl.NaCl.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
m: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
c: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
tag: Lib.Buffer.lbuffer Lib.IntTypes.uint8 16ul ->
mlen:
Lib.IntTypes.size_t
{Lib.Buffer.length c = Lib.IntTypes.v mlen /\ Lib.Buffer.length m = Lib.IntTypes.v mlen} ->
n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 24ul ->
k: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul
-> FStar.HyperStack.ST.Stack Lib.IntTypes.size_t | {
"end_col": 62,
"end_line": 78,
"start_col": 2,
"start_line": 78
} |
FStar.HyperStack.ST.Stack | val crypto_box_easy_afternm:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SB.box_easy_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m)) | [
{
"abbrev": true,
"full_module": "Spec.SecretBox",
"short_module": "SS"
},
{
"abbrev": true,
"full_module": "Spec.Box",
"short_module": "SB"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let crypto_box_easy_afternm c m mlen n k =
Hacl.Impl.Box.box_easy_afternm mlen c k n m | val crypto_box_easy_afternm:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SB.box_easy_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_box_easy_afternm c m mlen n k = | true | null | false | Hacl.Impl.Box.box_easy_afternm mlen c k n m | {
"checked_file": "Hacl.NaCl.fst.checked",
"dependencies": [
"Spec.SecretBox.fst.checked",
"Spec.Box.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Impl.SecretBox.fst.checked",
"Hacl.Impl.Box.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.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.NaCl.fst"
} | [] | [
"Lib.Buffer.buffer",
"Lib.IntTypes.uint8",
"Lib.IntTypes.size_t",
"Prims.l_and",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Lib.Buffer.length",
"Lib.Buffer.MUT",
"Prims.op_Addition",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Prims.l_or",
"Lib.IntTypes.range",
"Prims.op_GreaterThanOrEqual",
"Lib.Buffer.lbuffer",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.Box.box_easy_afternm"
] | [] | module Hacl.NaCl
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module SB = Spec.Box
module SS = Spec.SecretBox
#set-options "--max_fuel 50 --max_fuel 0 --max_ifuel 0"
[@@ Comment "Encrypt a message with a key and nonce.
Note: `c` and `m` can point to the same memory for in-place encryption.
@param c Pointer to `mlen` bytes where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_detached c tag m mlen n k =
Hacl.Impl.SecretBox.secretbox_detached mlen c tag k n m;
0ul
[@@ Comment "Verify and decrypt a ciphertext produced with `Hacl_NaCl_crypto_secretbox_detached`.
Note: `m` and `c` can point to the same memory for in-place decryption.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `mlen` bytes where the ciphertext is read from.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is read from.
@param mlen Length of message (and ciphertext).
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_detached m c tag mlen n k =
Hacl.Impl.SecretBox.secretbox_open_detached mlen m k n c tag
[@@ Comment "Encrypt a message with a key and nonce.
@param c Pointer to 16 (tag length) + `mlen` bytes where the ciphertext is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SS.secretbox_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_easy c m mlen n k =
Hacl.Impl.SecretBox.secretbox_easy mlen c k n m;
0ul
#set-options "--z3rlimit 100"
[@@ Comment "Verify and decrypt a ciphertext produced with `crypto_secretbox_easy`.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `clen` bytes where the ciphertext is read from. The authentication tag must be included.
@param clen Length of ciphertext.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_easy m c clen n k =
Hacl.Impl.SecretBox.secretbox_open_easy (clen -! 16ul) m k n c
[@@ Comment "Compute a shared secret key given a public key and secret key.
@param k Pointer to 32 (`crypto_box_BEFORENMBYTES`) bytes of memory where the shared secret is written to.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_beforenm:
k:lbuffer uint8 32ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h -> live h k /\ live h pk /\ live h sk /\
disjoint k pk /\ disjoint k sk)
(ensures fun h0 r h1 -> modifies1 k h0 h1 /\
(let key = SB.box_beforenm (as_seq h0 pk) (as_seq h0 sk) in
match r with
| 0ul -> Some? key /\ as_seq h1 k == Some?.v key
| _ -> None? key))
let crypto_box_beforenm k pk sk =
Hacl.Impl.Box.box_beforenm k pk sk
[@@ Comment "See `crypto_box_detached`."]
val crypto_box_detached_afternm:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SB.box_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_box_detached_afternm c tag m mlen n k =
Hacl.Impl.Box.box_detached_afternm mlen c tag k n m
[@@ Comment "Encrypt a message using the recipient's public key, the sender's secret key, and a nonce.
@param c Pointer to `mlen` bytes of memory where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes of memory where the authentication tag is written to.
@param m Pointer to `mlen` bytes of memory where the message is read from.
@param mlen Length of the message.
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(let tag_cipher = SB.box_detached (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? tag_cipher /\ (let (tag_s, cipher_s) = Some?.v tag_cipher in (as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == (tag_s, cipher_s))
| _ -> None? tag_cipher))
let crypto_box_detached c tag m mlen n pk sk =
Hacl.Impl.Box.box_detached mlen c tag sk pk n m
[@@ Comment "See `crypto_box_open_detached`."]
val crypto_box_open_detached_afternm:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_box_open_detached_afternm m c tag mlen n k =
Hacl.Impl.Box.box_open_detached_afternm mlen m k n c tag
[@@ Comment "Verify and decrypt a ciphertext produced by `crypto_box_detached`.
@param m Pointer to `mlen` bytes of memory where the decrypted message is written to.
@param c Pointer to `mlen` bytes of memory where the ciphertext is read from. Note: the ciphertext must include the tag.
@param tag Pointer to 16 (tag length) bytes of memory where the authentication tag is read from.
@param mlen Length of the message (and ciphertext).
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where the public key of the sender is read from.
@param sk Pointer to 32 bytes of memory where the secret key of the recipient is read from."]
val crypto_box_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h pk /\ live h sk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached (as_seq h0 pk) (as_seq h0 sk) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_box_open_detached m c tag mlen n pk sk =
Hacl.Impl.Box.box_open_detached mlen m pk sk n c tag
[@@ Comment "See `crypto_box_easy`."]
val crypto_box_easy_afternm:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SB.box_easy_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m)) | false | false | Hacl.NaCl.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val crypto_box_easy_afternm:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SB.box_easy_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m)) | [] | Hacl.NaCl.crypto_box_easy_afternm | {
"file_name": "code/nacl-box/Hacl.NaCl.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
c: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
m: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
mlen:
Lib.IntTypes.size_t
{ Lib.Buffer.length c = Lib.IntTypes.v mlen + 16 /\
Lib.Buffer.length m = Lib.IntTypes.v mlen } ->
n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 24ul ->
k: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul
-> FStar.HyperStack.ST.Stack Lib.IntTypes.size_t | {
"end_col": 45,
"end_line": 281,
"start_col": 2,
"start_line": 281
} |
FStar.HyperStack.ST.Stack | val crypto_box_detached_afternm:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SB.box_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m)) | [
{
"abbrev": true,
"full_module": "Spec.SecretBox",
"short_module": "SS"
},
{
"abbrev": true,
"full_module": "Spec.Box",
"short_module": "SB"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let crypto_box_detached_afternm c tag m mlen n k =
Hacl.Impl.Box.box_detached_afternm mlen c tag k n m | val crypto_box_detached_afternm:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SB.box_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_box_detached_afternm c tag m mlen n k = | true | null | false | Hacl.Impl.Box.box_detached_afternm mlen c tag k n m | {
"checked_file": "Hacl.NaCl.fst.checked",
"dependencies": [
"Spec.SecretBox.fst.checked",
"Spec.Box.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Impl.SecretBox.fst.checked",
"Hacl.Impl.Box.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.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.NaCl.fst"
} | [] | [
"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.Box.box_detached_afternm"
] | [] | module Hacl.NaCl
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module SB = Spec.Box
module SS = Spec.SecretBox
#set-options "--max_fuel 50 --max_fuel 0 --max_ifuel 0"
[@@ Comment "Encrypt a message with a key and nonce.
Note: `c` and `m` can point to the same memory for in-place encryption.
@param c Pointer to `mlen` bytes where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_detached c tag m mlen n k =
Hacl.Impl.SecretBox.secretbox_detached mlen c tag k n m;
0ul
[@@ Comment "Verify and decrypt a ciphertext produced with `Hacl_NaCl_crypto_secretbox_detached`.
Note: `m` and `c` can point to the same memory for in-place decryption.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `mlen` bytes where the ciphertext is read from.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is read from.
@param mlen Length of message (and ciphertext).
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_detached m c tag mlen n k =
Hacl.Impl.SecretBox.secretbox_open_detached mlen m k n c tag
[@@ Comment "Encrypt a message with a key and nonce.
@param c Pointer to 16 (tag length) + `mlen` bytes where the ciphertext is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SS.secretbox_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_easy c m mlen n k =
Hacl.Impl.SecretBox.secretbox_easy mlen c k n m;
0ul
#set-options "--z3rlimit 100"
[@@ Comment "Verify and decrypt a ciphertext produced with `crypto_secretbox_easy`.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `clen` bytes where the ciphertext is read from. The authentication tag must be included.
@param clen Length of ciphertext.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_easy m c clen n k =
Hacl.Impl.SecretBox.secretbox_open_easy (clen -! 16ul) m k n c
[@@ Comment "Compute a shared secret key given a public key and secret key.
@param k Pointer to 32 (`crypto_box_BEFORENMBYTES`) bytes of memory where the shared secret is written to.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_beforenm:
k:lbuffer uint8 32ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h -> live h k /\ live h pk /\ live h sk /\
disjoint k pk /\ disjoint k sk)
(ensures fun h0 r h1 -> modifies1 k h0 h1 /\
(let key = SB.box_beforenm (as_seq h0 pk) (as_seq h0 sk) in
match r with
| 0ul -> Some? key /\ as_seq h1 k == Some?.v key
| _ -> None? key))
let crypto_box_beforenm k pk sk =
Hacl.Impl.Box.box_beforenm k pk sk
[@@ Comment "See `crypto_box_detached`."]
val crypto_box_detached_afternm:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SB.box_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m)) | false | false | Hacl.NaCl.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val crypto_box_detached_afternm:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SB.box_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m)) | [] | Hacl.NaCl.crypto_box_detached_afternm | {
"file_name": "code/nacl-box/Hacl.NaCl.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
c: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
tag: Lib.Buffer.lbuffer Lib.IntTypes.uint8 16ul ->
m: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
mlen:
Lib.IntTypes.size_t
{Lib.Buffer.length c = Lib.IntTypes.v mlen /\ Lib.Buffer.length m = Lib.IntTypes.v mlen} ->
n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 24ul ->
k: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul
-> FStar.HyperStack.ST.Stack Lib.IntTypes.size_t | {
"end_col": 53,
"end_line": 175,
"start_col": 2,
"start_line": 175
} |
FStar.HyperStack.ST.Stack | val crypto_secretbox_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SS.secretbox_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m)) | [
{
"abbrev": true,
"full_module": "Spec.SecretBox",
"short_module": "SS"
},
{
"abbrev": true,
"full_module": "Spec.Box",
"short_module": "SB"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let crypto_secretbox_easy c m mlen n k =
Hacl.Impl.SecretBox.secretbox_easy mlen c k n m;
0ul | val crypto_secretbox_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SS.secretbox_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_easy c m mlen n k = | true | null | false | Hacl.Impl.SecretBox.secretbox_easy mlen c k n m;
0ul | {
"checked_file": "Hacl.NaCl.fst.checked",
"dependencies": [
"Spec.SecretBox.fst.checked",
"Spec.Box.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Impl.SecretBox.fst.checked",
"Hacl.Impl.Box.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.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.NaCl.fst"
} | [] | [
"Lib.Buffer.buffer",
"Lib.IntTypes.uint8",
"Lib.IntTypes.size_t",
"Prims.l_and",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Lib.Buffer.length",
"Lib.Buffer.MUT",
"Prims.op_Addition",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Prims.l_or",
"Lib.IntTypes.range",
"Prims.op_GreaterThanOrEqual",
"Lib.Buffer.lbuffer",
"FStar.UInt32.__uint_to_t",
"Prims.unit",
"Hacl.Impl.SecretBox.secretbox_easy"
] | [] | module Hacl.NaCl
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module SB = Spec.Box
module SS = Spec.SecretBox
#set-options "--max_fuel 50 --max_fuel 0 --max_ifuel 0"
[@@ Comment "Encrypt a message with a key and nonce.
Note: `c` and `m` can point to the same memory for in-place encryption.
@param c Pointer to `mlen` bytes where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_detached c tag m mlen n k =
Hacl.Impl.SecretBox.secretbox_detached mlen c tag k n m;
0ul
[@@ Comment "Verify and decrypt a ciphertext produced with `Hacl_NaCl_crypto_secretbox_detached`.
Note: `m` and `c` can point to the same memory for in-place decryption.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `mlen` bytes where the ciphertext is read from.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is read from.
@param mlen Length of message (and ciphertext).
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_detached m c tag mlen n k =
Hacl.Impl.SecretBox.secretbox_open_detached mlen m k n c tag
[@@ Comment "Encrypt a message with a key and nonce.
@param c Pointer to 16 (tag length) + `mlen` bytes where the ciphertext is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SS.secretbox_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m)) | false | false | Hacl.NaCl.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val crypto_secretbox_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SS.secretbox_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m)) | [] | Hacl.NaCl.crypto_secretbox_easy | {
"file_name": "code/nacl-box/Hacl.NaCl.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
c: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
m: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
mlen:
Lib.IntTypes.size_t
{ Lib.Buffer.length c = Lib.IntTypes.v mlen + 16 /\
Lib.Buffer.length m = Lib.IntTypes.v mlen } ->
n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 24ul ->
k: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul
-> FStar.HyperStack.ST.Stack Lib.IntTypes.size_t | {
"end_col": 5,
"end_line": 104,
"start_col": 2,
"start_line": 103
} |
FStar.HyperStack.ST.Stack | val crypto_box_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
(let cipher = SB.box_easy (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? cipher /\ as_seq #MUT #uint8 #(mlen +! 16ul) h1 c == Some?.v cipher
| _ -> None? cipher)) | [
{
"abbrev": true,
"full_module": "Spec.SecretBox",
"short_module": "SS"
},
{
"abbrev": true,
"full_module": "Spec.Box",
"short_module": "SB"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let crypto_box_easy c m mlen n pk sk =
Hacl.Impl.Box.box_easy mlen c sk pk n m | val crypto_box_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
(let cipher = SB.box_easy (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? cipher /\ as_seq #MUT #uint8 #(mlen +! 16ul) h1 c == Some?.v cipher
| _ -> None? cipher))
let crypto_box_easy c m mlen n pk sk = | true | null | false | Hacl.Impl.Box.box_easy mlen c sk pk n m | {
"checked_file": "Hacl.NaCl.fst.checked",
"dependencies": [
"Spec.SecretBox.fst.checked",
"Spec.Box.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Impl.SecretBox.fst.checked",
"Hacl.Impl.Box.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.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.NaCl.fst"
} | [] | [
"Lib.Buffer.buffer",
"Lib.IntTypes.uint8",
"Lib.IntTypes.size_t",
"Prims.l_and",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Lib.Buffer.length",
"Lib.Buffer.MUT",
"Prims.op_Addition",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Prims.l_or",
"Lib.IntTypes.range",
"Prims.op_GreaterThanOrEqual",
"Lib.Buffer.lbuffer",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.Box.box_easy"
] | [] | module Hacl.NaCl
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module SB = Spec.Box
module SS = Spec.SecretBox
#set-options "--max_fuel 50 --max_fuel 0 --max_ifuel 0"
[@@ Comment "Encrypt a message with a key and nonce.
Note: `c` and `m` can point to the same memory for in-place encryption.
@param c Pointer to `mlen` bytes where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_detached c tag m mlen n k =
Hacl.Impl.SecretBox.secretbox_detached mlen c tag k n m;
0ul
[@@ Comment "Verify and decrypt a ciphertext produced with `Hacl_NaCl_crypto_secretbox_detached`.
Note: `m` and `c` can point to the same memory for in-place decryption.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `mlen` bytes where the ciphertext is read from.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is read from.
@param mlen Length of message (and ciphertext).
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_detached m c tag mlen n k =
Hacl.Impl.SecretBox.secretbox_open_detached mlen m k n c tag
[@@ Comment "Encrypt a message with a key and nonce.
@param c Pointer to 16 (tag length) + `mlen` bytes where the ciphertext is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SS.secretbox_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_easy c m mlen n k =
Hacl.Impl.SecretBox.secretbox_easy mlen c k n m;
0ul
#set-options "--z3rlimit 100"
[@@ Comment "Verify and decrypt a ciphertext produced with `crypto_secretbox_easy`.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `clen` bytes where the ciphertext is read from. The authentication tag must be included.
@param clen Length of ciphertext.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_easy m c clen n k =
Hacl.Impl.SecretBox.secretbox_open_easy (clen -! 16ul) m k n c
[@@ Comment "Compute a shared secret key given a public key and secret key.
@param k Pointer to 32 (`crypto_box_BEFORENMBYTES`) bytes of memory where the shared secret is written to.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_beforenm:
k:lbuffer uint8 32ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h -> live h k /\ live h pk /\ live h sk /\
disjoint k pk /\ disjoint k sk)
(ensures fun h0 r h1 -> modifies1 k h0 h1 /\
(let key = SB.box_beforenm (as_seq h0 pk) (as_seq h0 sk) in
match r with
| 0ul -> Some? key /\ as_seq h1 k == Some?.v key
| _ -> None? key))
let crypto_box_beforenm k pk sk =
Hacl.Impl.Box.box_beforenm k pk sk
[@@ Comment "See `crypto_box_detached`."]
val crypto_box_detached_afternm:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SB.box_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_box_detached_afternm c tag m mlen n k =
Hacl.Impl.Box.box_detached_afternm mlen c tag k n m
[@@ Comment "Encrypt a message using the recipient's public key, the sender's secret key, and a nonce.
@param c Pointer to `mlen` bytes of memory where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes of memory where the authentication tag is written to.
@param m Pointer to `mlen` bytes of memory where the message is read from.
@param mlen Length of the message.
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(let tag_cipher = SB.box_detached (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? tag_cipher /\ (let (tag_s, cipher_s) = Some?.v tag_cipher in (as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == (tag_s, cipher_s))
| _ -> None? tag_cipher))
let crypto_box_detached c tag m mlen n pk sk =
Hacl.Impl.Box.box_detached mlen c tag sk pk n m
[@@ Comment "See `crypto_box_open_detached`."]
val crypto_box_open_detached_afternm:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_box_open_detached_afternm m c tag mlen n k =
Hacl.Impl.Box.box_open_detached_afternm mlen m k n c tag
[@@ Comment "Verify and decrypt a ciphertext produced by `crypto_box_detached`.
@param m Pointer to `mlen` bytes of memory where the decrypted message is written to.
@param c Pointer to `mlen` bytes of memory where the ciphertext is read from. Note: the ciphertext must include the tag.
@param tag Pointer to 16 (tag length) bytes of memory where the authentication tag is read from.
@param mlen Length of the message (and ciphertext).
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where the public key of the sender is read from.
@param sk Pointer to 32 bytes of memory where the secret key of the recipient is read from."]
val crypto_box_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h pk /\ live h sk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached (as_seq h0 pk) (as_seq h0 sk) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_box_open_detached m c tag mlen n pk sk =
Hacl.Impl.Box.box_open_detached mlen m pk sk n c tag
[@@ Comment "See `crypto_box_easy`."]
val crypto_box_easy_afternm:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SB.box_easy_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_box_easy_afternm c m mlen n k =
Hacl.Impl.Box.box_easy_afternm mlen c k n m
[@@ Comment "Encrypt a message using the recipient's public key, the sender's secret key, and a nonce.
@param c Pointer to 16 (tag length) + `mlen` bytes of memory where the authentication tag and ciphertext is written to.
@param m Pointer to `mlen` bytes of memory where the message is read from.
@param mlen Length of the message.
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where the public key of the recipient is read from.
@param sk Pointer to 32 bytes of memory where the secret key of the sender is read from."]
val crypto_box_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
(let cipher = SB.box_easy (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? cipher /\ as_seq #MUT #uint8 #(mlen +! 16ul) h1 c == Some?.v cipher
| _ -> None? cipher)) | false | false | Hacl.NaCl.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val crypto_box_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
(let cipher = SB.box_easy (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? cipher /\ as_seq #MUT #uint8 #(mlen +! 16ul) h1 c == Some?.v cipher
| _ -> None? cipher)) | [] | Hacl.NaCl.crypto_box_easy | {
"file_name": "code/nacl-box/Hacl.NaCl.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
c: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
m: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
mlen:
Lib.IntTypes.size_t
{ Lib.Buffer.length c = Lib.IntTypes.v mlen + 16 /\
Lib.Buffer.length m = Lib.IntTypes.v mlen } ->
n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 24ul ->
pk: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul ->
sk: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul
-> FStar.HyperStack.ST.Stack Lib.IntTypes.size_t | {
"end_col": 41,
"end_line": 310,
"start_col": 2,
"start_line": 310
} |
FStar.HyperStack.ST.Stack | val crypto_box_open_easy_afternm:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_easy_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg)) | [
{
"abbrev": true,
"full_module": "Spec.SecretBox",
"short_module": "SS"
},
{
"abbrev": true,
"full_module": "Spec.Box",
"short_module": "SB"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let crypto_box_open_easy_afternm m c clen n k =
Hacl.Impl.Box.box_open_easy_afternm (clen -! 16ul) m k n c | val crypto_box_open_easy_afternm:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_easy_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg))
let crypto_box_open_easy_afternm m c clen n k = | true | null | false | Hacl.Impl.Box.box_open_easy_afternm (clen -! 16ul) m k n c | {
"checked_file": "Hacl.NaCl.fst.checked",
"dependencies": [
"Spec.SecretBox.fst.checked",
"Spec.Box.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Impl.SecretBox.fst.checked",
"Hacl.Impl.Box.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.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.NaCl.fst"
} | [] | [
"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",
"Prims.op_Addition",
"Lib.Buffer.lbuffer",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.Box.box_open_easy_afternm",
"Lib.IntTypes.op_Subtraction_Bang"
] | [] | module Hacl.NaCl
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module SB = Spec.Box
module SS = Spec.SecretBox
#set-options "--max_fuel 50 --max_fuel 0 --max_ifuel 0"
[@@ Comment "Encrypt a message with a key and nonce.
Note: `c` and `m` can point to the same memory for in-place encryption.
@param c Pointer to `mlen` bytes where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_detached c tag m mlen n k =
Hacl.Impl.SecretBox.secretbox_detached mlen c tag k n m;
0ul
[@@ Comment "Verify and decrypt a ciphertext produced with `Hacl_NaCl_crypto_secretbox_detached`.
Note: `m` and `c` can point to the same memory for in-place decryption.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `mlen` bytes where the ciphertext is read from.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is read from.
@param mlen Length of message (and ciphertext).
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_detached m c tag mlen n k =
Hacl.Impl.SecretBox.secretbox_open_detached mlen m k n c tag
[@@ Comment "Encrypt a message with a key and nonce.
@param c Pointer to 16 (tag length) + `mlen` bytes where the ciphertext is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SS.secretbox_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_easy c m mlen n k =
Hacl.Impl.SecretBox.secretbox_easy mlen c k n m;
0ul
#set-options "--z3rlimit 100"
[@@ Comment "Verify and decrypt a ciphertext produced with `crypto_secretbox_easy`.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `clen` bytes where the ciphertext is read from. The authentication tag must be included.
@param clen Length of ciphertext.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_easy m c clen n k =
Hacl.Impl.SecretBox.secretbox_open_easy (clen -! 16ul) m k n c
[@@ Comment "Compute a shared secret key given a public key and secret key.
@param k Pointer to 32 (`crypto_box_BEFORENMBYTES`) bytes of memory where the shared secret is written to.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_beforenm:
k:lbuffer uint8 32ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h -> live h k /\ live h pk /\ live h sk /\
disjoint k pk /\ disjoint k sk)
(ensures fun h0 r h1 -> modifies1 k h0 h1 /\
(let key = SB.box_beforenm (as_seq h0 pk) (as_seq h0 sk) in
match r with
| 0ul -> Some? key /\ as_seq h1 k == Some?.v key
| _ -> None? key))
let crypto_box_beforenm k pk sk =
Hacl.Impl.Box.box_beforenm k pk sk
[@@ Comment "See `crypto_box_detached`."]
val crypto_box_detached_afternm:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SB.box_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_box_detached_afternm c tag m mlen n k =
Hacl.Impl.Box.box_detached_afternm mlen c tag k n m
[@@ Comment "Encrypt a message using the recipient's public key, the sender's secret key, and a nonce.
@param c Pointer to `mlen` bytes of memory where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes of memory where the authentication tag is written to.
@param m Pointer to `mlen` bytes of memory where the message is read from.
@param mlen Length of the message.
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(let tag_cipher = SB.box_detached (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? tag_cipher /\ (let (tag_s, cipher_s) = Some?.v tag_cipher in (as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == (tag_s, cipher_s))
| _ -> None? tag_cipher))
let crypto_box_detached c tag m mlen n pk sk =
Hacl.Impl.Box.box_detached mlen c tag sk pk n m
[@@ Comment "See `crypto_box_open_detached`."]
val crypto_box_open_detached_afternm:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_box_open_detached_afternm m c tag mlen n k =
Hacl.Impl.Box.box_open_detached_afternm mlen m k n c tag
[@@ Comment "Verify and decrypt a ciphertext produced by `crypto_box_detached`.
@param m Pointer to `mlen` bytes of memory where the decrypted message is written to.
@param c Pointer to `mlen` bytes of memory where the ciphertext is read from. Note: the ciphertext must include the tag.
@param tag Pointer to 16 (tag length) bytes of memory where the authentication tag is read from.
@param mlen Length of the message (and ciphertext).
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where the public key of the sender is read from.
@param sk Pointer to 32 bytes of memory where the secret key of the recipient is read from."]
val crypto_box_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h pk /\ live h sk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached (as_seq h0 pk) (as_seq h0 sk) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_box_open_detached m c tag mlen n pk sk =
Hacl.Impl.Box.box_open_detached mlen m pk sk n c tag
[@@ Comment "See `crypto_box_easy`."]
val crypto_box_easy_afternm:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SB.box_easy_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_box_easy_afternm c m mlen n k =
Hacl.Impl.Box.box_easy_afternm mlen c k n m
[@@ Comment "Encrypt a message using the recipient's public key, the sender's secret key, and a nonce.
@param c Pointer to 16 (tag length) + `mlen` bytes of memory where the authentication tag and ciphertext is written to.
@param m Pointer to `mlen` bytes of memory where the message is read from.
@param mlen Length of the message.
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where the public key of the recipient is read from.
@param sk Pointer to 32 bytes of memory where the secret key of the sender is read from."]
val crypto_box_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
(let cipher = SB.box_easy (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? cipher /\ as_seq #MUT #uint8 #(mlen +! 16ul) h1 c == Some?.v cipher
| _ -> None? cipher))
let crypto_box_easy c m mlen n pk sk =
Hacl.Impl.Box.box_easy mlen c sk pk n m
[@@ Comment "See `crypto_box_open_easy`."]
val crypto_box_open_easy_afternm:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_easy_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg)) | false | false | Hacl.NaCl.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val crypto_box_open_easy_afternm:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_easy_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg)) | [] | Hacl.NaCl.crypto_box_open_easy_afternm | {
"file_name": "code/nacl-box/Hacl.NaCl.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
m: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
c: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
clen:
Lib.IntTypes.size_t
{ Lib.Buffer.length c = Lib.IntTypes.v clen /\
Lib.IntTypes.v clen = Lib.Buffer.length m + 16 } ->
n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 24ul ->
k: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul
-> FStar.HyperStack.ST.Stack Lib.IntTypes.size_t | {
"end_col": 60,
"end_line": 331,
"start_col": 2,
"start_line": 331
} |
FStar.HyperStack.ST.Stack | val crypto_box_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h pk /\ live h sk /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_easy (as_seq h0 pk) (as_seq h0 sk) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg)) | [
{
"abbrev": true,
"full_module": "Spec.SecretBox",
"short_module": "SS"
},
{
"abbrev": true,
"full_module": "Spec.Box",
"short_module": "SB"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let crypto_box_open_easy m c clen n pk sk =
Hacl.Impl.Box.box_open_easy (clen -! 16ul) m pk sk n c | val crypto_box_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h pk /\ live h sk /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_easy (as_seq h0 pk) (as_seq h0 sk) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg))
let crypto_box_open_easy m c clen n pk sk = | true | null | false | Hacl.Impl.Box.box_open_easy (clen -! 16ul) m pk sk n c | {
"checked_file": "Hacl.NaCl.fst.checked",
"dependencies": [
"Spec.SecretBox.fst.checked",
"Spec.Box.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Impl.SecretBox.fst.checked",
"Hacl.Impl.Box.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.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.NaCl.fst"
} | [] | [
"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",
"Prims.op_Addition",
"Lib.Buffer.lbuffer",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.Box.box_open_easy",
"Lib.IntTypes.op_Subtraction_Bang"
] | [] | module Hacl.NaCl
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module SB = Spec.Box
module SS = Spec.SecretBox
#set-options "--max_fuel 50 --max_fuel 0 --max_ifuel 0"
[@@ Comment "Encrypt a message with a key and nonce.
Note: `c` and `m` can point to the same memory for in-place encryption.
@param c Pointer to `mlen` bytes where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_detached c tag m mlen n k =
Hacl.Impl.SecretBox.secretbox_detached mlen c tag k n m;
0ul
[@@ Comment "Verify and decrypt a ciphertext produced with `Hacl_NaCl_crypto_secretbox_detached`.
Note: `m` and `c` can point to the same memory for in-place decryption.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `mlen` bytes where the ciphertext is read from.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is read from.
@param mlen Length of message (and ciphertext).
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_detached m c tag mlen n k =
Hacl.Impl.SecretBox.secretbox_open_detached mlen m k n c tag
[@@ Comment "Encrypt a message with a key and nonce.
@param c Pointer to 16 (tag length) + `mlen` bytes where the ciphertext is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SS.secretbox_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_easy c m mlen n k =
Hacl.Impl.SecretBox.secretbox_easy mlen c k n m;
0ul
#set-options "--z3rlimit 100"
[@@ Comment "Verify and decrypt a ciphertext produced with `crypto_secretbox_easy`.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `clen` bytes where the ciphertext is read from. The authentication tag must be included.
@param clen Length of ciphertext.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_easy m c clen n k =
Hacl.Impl.SecretBox.secretbox_open_easy (clen -! 16ul) m k n c
[@@ Comment "Compute a shared secret key given a public key and secret key.
@param k Pointer to 32 (`crypto_box_BEFORENMBYTES`) bytes of memory where the shared secret is written to.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_beforenm:
k:lbuffer uint8 32ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h -> live h k /\ live h pk /\ live h sk /\
disjoint k pk /\ disjoint k sk)
(ensures fun h0 r h1 -> modifies1 k h0 h1 /\
(let key = SB.box_beforenm (as_seq h0 pk) (as_seq h0 sk) in
match r with
| 0ul -> Some? key /\ as_seq h1 k == Some?.v key
| _ -> None? key))
let crypto_box_beforenm k pk sk =
Hacl.Impl.Box.box_beforenm k pk sk
[@@ Comment "See `crypto_box_detached`."]
val crypto_box_detached_afternm:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SB.box_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_box_detached_afternm c tag m mlen n k =
Hacl.Impl.Box.box_detached_afternm mlen c tag k n m
[@@ Comment "Encrypt a message using the recipient's public key, the sender's secret key, and a nonce.
@param c Pointer to `mlen` bytes of memory where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes of memory where the authentication tag is written to.
@param m Pointer to `mlen` bytes of memory where the message is read from.
@param mlen Length of the message.
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where **their** public key is read from.
@param sk Pointer to 32 bytes of memory where **my** secret key is read from."]
val crypto_box_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(let tag_cipher = SB.box_detached (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? tag_cipher /\ (let (tag_s, cipher_s) = Some?.v tag_cipher in (as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == (tag_s, cipher_s))
| _ -> None? tag_cipher))
let crypto_box_detached c tag m mlen n pk sk =
Hacl.Impl.Box.box_detached mlen c tag sk pk n m
[@@ Comment "See `crypto_box_open_detached`."]
val crypto_box_open_detached_afternm:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached_afternm (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_box_open_detached_afternm m c tag mlen n k =
Hacl.Impl.Box.box_open_detached_afternm mlen m k n c tag
[@@ Comment "Verify and decrypt a ciphertext produced by `crypto_box_detached`.
@param m Pointer to `mlen` bytes of memory where the decrypted message is written to.
@param c Pointer to `mlen` bytes of memory where the ciphertext is read from. Note: the ciphertext must include the tag.
@param tag Pointer to 16 (tag length) bytes of memory where the authentication tag is read from.
@param mlen Length of the message (and ciphertext).
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where the public key of the sender is read from.
@param sk Pointer to 32 bytes of memory where the secret key of the recipient is read from."]
val crypto_box_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h pk /\ live h sk /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_detached (as_seq h0 pk) (as_seq h0 sk) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_box_open_detached m c tag mlen n pk sk =
Hacl.Impl.Box.box_open_detached mlen m pk sk n c tag
[@@ Comment "See `crypto_box_easy`."]
val crypto_box_easy_afternm:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SB.box_easy_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_box_easy_afternm c m mlen n k =
Hacl.Impl.Box.box_easy_afternm mlen c k n m
[@@ Comment "Encrypt a message using the recipient's public key, the sender's secret key, and a nonce.
@param c Pointer to 16 (tag length) + `mlen` bytes of memory where the authentication tag and ciphertext is written to.
@param m Pointer to `mlen` bytes of memory where the message is read from.
@param mlen Length of the message.
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where the public key of the recipient is read from.
@param sk Pointer to 32 bytes of memory where the secret key of the sender is read from."]
val crypto_box_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h sk /\ live h pk /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
(let cipher = SB.box_easy (as_seq h0 sk) (as_seq h0 pk) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m) in
match r with
| 0ul -> Some? cipher /\ as_seq #MUT #uint8 #(mlen +! 16ul) h1 c == Some?.v cipher
| _ -> None? cipher))
let crypto_box_easy c m mlen n pk sk =
Hacl.Impl.Box.box_easy mlen c sk pk n m
[@@ Comment "See `crypto_box_open_easy`."]
val crypto_box_open_easy_afternm:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_easy_afternm (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg))
let crypto_box_open_easy_afternm m c clen n k =
Hacl.Impl.Box.box_open_easy_afternm (clen -! 16ul) m k n c
[@@ Comment "Verify and decrypt a ciphertext produced by `crypto_box_easy`.
@param m Pointer to `clen` - 16 (tag length) bytes of memory where the decrypted message is written to.
@param c Pointer to `clen` bytes of memory where the ciphertext is read from. Note: the ciphertext must include the tag.
@param clen Length of the ciphertext.
@param n Pointer to 24 (`crypto_box_NONCEBYTES`) bytes of memory where the nonce is read from.
@param pk Pointer to 32 bytes of memory where the public key of the sender is read from.
@param sk Pointer to 32 bytes of memory where the secret key of the recipient is read from."]
val crypto_box_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h pk /\ live h sk /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_easy (as_seq h0 pk) (as_seq h0 sk) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg)) | false | false | Hacl.NaCl.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val crypto_box_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> pk:lbuffer uint8 32ul
-> sk:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h pk /\ live h sk /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SB.box_open_easy (as_seq h0 pk) (as_seq h0 sk) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg)) | [] | Hacl.NaCl.crypto_box_open_easy | {
"file_name": "code/nacl-box/Hacl.NaCl.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
m: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
c: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
clen:
Lib.IntTypes.size_t
{ Lib.Buffer.length c = Lib.IntTypes.v clen /\
Lib.IntTypes.v clen = Lib.Buffer.length m + 16 } ->
n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 24ul ->
pk: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul ->
sk: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul
-> FStar.HyperStack.ST.Stack Lib.IntTypes.size_t | {
"end_col": 56,
"end_line": 360,
"start_col": 2,
"start_line": 360
} |
FStar.HyperStack.ST.Stack | val crypto_secretbox_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg)) | [
{
"abbrev": true,
"full_module": "Spec.SecretBox",
"short_module": "SS"
},
{
"abbrev": true,
"full_module": "Spec.Box",
"short_module": "SB"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let crypto_secretbox_open_easy m c clen n k =
Hacl.Impl.SecretBox.secretbox_open_easy (clen -! 16ul) m k n c | val crypto_secretbox_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_easy m c clen n k = | true | null | false | Hacl.Impl.SecretBox.secretbox_open_easy (clen -! 16ul) m k n c | {
"checked_file": "Hacl.NaCl.fst.checked",
"dependencies": [
"Spec.SecretBox.fst.checked",
"Spec.Box.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Impl.SecretBox.fst.checked",
"Hacl.Impl.Box.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.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.NaCl.fst"
} | [] | [
"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",
"Prims.op_Addition",
"Lib.Buffer.lbuffer",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.SecretBox.secretbox_open_easy",
"Lib.IntTypes.op_Subtraction_Bang"
] | [] | module Hacl.NaCl
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module SB = Spec.Box
module SS = Spec.SecretBox
#set-options "--max_fuel 50 --max_fuel 0 --max_ifuel 0"
[@@ Comment "Encrypt a message with a key and nonce.
Note: `c` and `m` can point to the same memory for in-place encryption.
@param c Pointer to `mlen` bytes where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_detached c tag m mlen n k =
Hacl.Impl.SecretBox.secretbox_detached mlen c tag k n m;
0ul
[@@ Comment "Verify and decrypt a ciphertext produced with `Hacl_NaCl_crypto_secretbox_detached`.
Note: `m` and `c` can point to the same memory for in-place decryption.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `mlen` bytes where the ciphertext is read from.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is read from.
@param mlen Length of message (and ciphertext).
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_detached:
m:buffer uint8
-> c:buffer uint8
-> tag:lbuffer uint8 16ul
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_detached (as_seq h0 k) (as_seq h0 n) (as_seq h0 tag) (as_seq #MUT #uint8 #mlen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #mlen h1 m == Some?.v msg
| _ -> None? msg))
let crypto_secretbox_open_detached m c tag mlen n k =
Hacl.Impl.SecretBox.secretbox_open_detached mlen m k n c tag
[@@ Comment "Encrypt a message with a key and nonce.
@param c Pointer to 16 (tag length) + `mlen` bytes where the ciphertext is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_easy:
c:buffer uint8
-> m:buffer uint8
-> mlen:size_t{length c = v mlen + 16 /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies1 c h0 h1 /\
as_seq #MUT #uint8 #(mlen +! 16ul) h1 c ==
SS.secretbox_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_easy c m mlen n k =
Hacl.Impl.SecretBox.secretbox_easy mlen c k n m;
0ul
#set-options "--z3rlimit 100"
[@@ Comment "Verify and decrypt a ciphertext produced with `crypto_secretbox_easy`.
@param m Pointer to `mlen` bytes where the message is written to.
@param c Pointer to `clen` bytes where the ciphertext is read from. The authentication tag must be included.
@param clen Length of ciphertext.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg)) | false | false | Hacl.NaCl.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val crypto_secretbox_open_easy:
m:buffer uint8
-> c:buffer uint8
-> clen:size_t{length c = v clen /\ v clen = length m + 16}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\
disjoint m c /\ disjoint m n /\ disjoint c n)
(ensures fun h0 r h1 -> modifies1 m h0 h1 /\
(let msg = SS.secretbox_open_easy (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #clen h0 c) in
match r with
| 0ul -> Some? msg /\ as_seq #MUT #uint8 #(clen -! 16ul) h1 m == Some?.v msg
| _ -> None? msg)) | [] | Hacl.NaCl.crypto_secretbox_open_easy | {
"file_name": "code/nacl-box/Hacl.NaCl.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
m: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
c: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
clen:
Lib.IntTypes.size_t
{ Lib.Buffer.length c = Lib.IntTypes.v clen /\
Lib.IntTypes.v clen = Lib.Buffer.length m + 16 } ->
n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 24ul ->
k: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul
-> FStar.HyperStack.ST.Stack Lib.IntTypes.size_t | {
"end_col": 64,
"end_line": 133,
"start_col": 2,
"start_line": 133
} |
FStar.HyperStack.ST.Stack | val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m)) | [
{
"abbrev": true,
"full_module": "Spec.SecretBox",
"short_module": "SS"
},
{
"abbrev": true,
"full_module": "Spec.Box",
"short_module": "SB"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"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",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let crypto_secretbox_detached c tag m mlen n k =
Hacl.Impl.SecretBox.secretbox_detached mlen c tag k n m;
0ul | val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m))
let crypto_secretbox_detached c tag m mlen n k = | true | null | false | Hacl.Impl.SecretBox.secretbox_detached mlen c tag k n m;
0ul | {
"checked_file": "Hacl.NaCl.fst.checked",
"dependencies": [
"Spec.SecretBox.fst.checked",
"Spec.Box.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Impl.SecretBox.fst.checked",
"Hacl.Impl.Box.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.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.NaCl.fst"
} | [] | [
"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",
"Hacl.Impl.SecretBox.secretbox_detached"
] | [] | module Hacl.NaCl
open FStar.HyperStack.All
open FStar.HyperStack
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module SB = Spec.Box
module SS = Spec.SecretBox
#set-options "--max_fuel 50 --max_fuel 0 --max_ifuel 0"
[@@ Comment "Encrypt a message with a key and nonce.
Note: `c` and `m` can point to the same memory for in-place encryption.
@param c Pointer to `mlen` bytes where the ciphertext is written to.
@param tag Pointer to 16 (tag length) bytes where the authentication tag is written to.
@param m Pointer to `mlen` bytes where the message is read from.
@param mlen Length of message.
@param n Pointer to 24 (`crypto_secretbox_NONCEBYTES`) bytes where the nonce is read from.
@param k Pointer to 32 (`crypto_secretbox_KEYBYTES`) bytes where the key is read from."]
val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m)) | false | false | Hacl.NaCl.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val crypto_secretbox_detached:
c:buffer uint8
-> tag:lbuffer uint8 16ul
-> m:buffer uint8
-> mlen:size_t{length c = v mlen /\ length m = v mlen}
-> n:lbuffer uint8 24ul
-> k:lbuffer uint8 32ul ->
Stack size_t
(requires fun h ->
live h c /\ live h m /\ live h k /\ live h n /\ live h tag /\
disjoint tag c /\ eq_or_disjoint (m <: lbuffer uint8 mlen) (c <: lbuffer uint8 mlen) /\
disjoint tag m /\ disjoint n m /\ disjoint n c)
(ensures fun h0 r h1 -> modifies2 c tag h0 h1 /\
(as_seq h1 tag, as_seq #MUT #uint8 #mlen h1 c) == SS.secretbox_detached (as_seq h0 k) (as_seq h0 n) (as_seq #MUT #uint8 #mlen h0 m)) | [] | Hacl.NaCl.crypto_secretbox_detached | {
"file_name": "code/nacl-box/Hacl.NaCl.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
c: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
tag: Lib.Buffer.lbuffer Lib.IntTypes.uint8 16ul ->
m: Lib.Buffer.buffer Lib.IntTypes.uint8 ->
mlen:
Lib.IntTypes.size_t
{Lib.Buffer.length c = Lib.IntTypes.v mlen /\ Lib.Buffer.length m = Lib.IntTypes.v mlen} ->
n: Lib.Buffer.lbuffer Lib.IntTypes.uint8 24ul ->
k: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul
-> FStar.HyperStack.ST.Stack Lib.IntTypes.size_t | {
"end_col": 5,
"end_line": 46,
"start_col": 2,
"start_line": 45
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.GLV",
"short_module": "SG"
},
{
"abbrev": true,
"full_module": "Spec.K256",
"short_module": "S"
},
{
"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": "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.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.K256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.K256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let qelem = lbuffer uint64 qnlimb | let qelem = | false | null | false | lbuffer uint64 qnlimb | {
"checked_file": "Hacl.K256.Scalar.fsti.checked",
"dependencies": [
"Spec.K256.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.K256.GLV.fst.checked",
"Hacl.Bignum.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.K256.Scalar.fsti"
} | [
"total"
] | [
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint64",
"Hacl.K256.Scalar.qnlimb"
] | [] | module Hacl.K256.Scalar
open FStar.HyperStack
open FStar.HyperStack.ST
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module S = Spec.K256
module SG = Hacl.Spec.K256.GLV
module BD = Hacl.Bignum.Definitions
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let qnlimb = 4ul | false | true | Hacl.K256.Scalar.fsti | {
"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"
} | null | val qelem : Type0 | [] | Hacl.K256.Scalar.qelem | {
"file_name": "code/k256/Hacl.K256.Scalar.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 33,
"end_line": 26,
"start_col": 12,
"start_line": 26
} |
|
Prims.GTot | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.GLV",
"short_module": "SG"
},
{
"abbrev": true,
"full_module": "Spec.K256",
"short_module": "S"
},
{
"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": "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.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.K256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.K256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let qe_lt_q (h:mem) (e:qelem) = qas_nat h e < S.q | let qe_lt_q (h: mem) (e: qelem) = | false | null | false | qas_nat h e < S.q | {
"checked_file": "Hacl.K256.Scalar.fsti.checked",
"dependencies": [
"Spec.K256.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.K256.GLV.fst.checked",
"Hacl.Bignum.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.K256.Scalar.fsti"
} | [
"sometrivial"
] | [
"FStar.Monotonic.HyperStack.mem",
"Hacl.K256.Scalar.qelem",
"Prims.op_LessThan",
"Hacl.K256.Scalar.qas_nat",
"Spec.K256.PointOps.q",
"Prims.bool"
] | [] | module Hacl.K256.Scalar
open FStar.HyperStack
open FStar.HyperStack.ST
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module S = Spec.K256
module SG = Hacl.Spec.K256.GLV
module BD = Hacl.Bignum.Definitions
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let qnlimb = 4ul
inline_for_extraction noextract
let qelem = lbuffer uint64 qnlimb
noextract
let qas_nat (h:mem) (e:qelem) : GTot nat = BD.bn_v #U64 #qnlimb h e
noextract
let qeval (h:mem) (e:qelem) : GTot S.qelem = qas_nat h e % S.q | false | false | Hacl.K256.Scalar.fsti | {
"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"
} | null | val qe_lt_q : h: FStar.Monotonic.HyperStack.mem -> e: Hacl.K256.Scalar.qelem -> Prims.GTot Prims.bool | [] | Hacl.K256.Scalar.qe_lt_q | {
"file_name": "code/k256/Hacl.K256.Scalar.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | h: FStar.Monotonic.HyperStack.mem -> e: Hacl.K256.Scalar.qelem -> Prims.GTot Prims.bool | {
"end_col": 49,
"end_line": 35,
"start_col": 32,
"start_line": 35
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.GLV",
"short_module": "SG"
},
{
"abbrev": true,
"full_module": "Spec.K256",
"short_module": "S"
},
{
"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": "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.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.K256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.K256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let qelem4 = uint64 & uint64 & uint64 & uint64 | let qelem4 = | false | null | false | uint64 & uint64 & uint64 & uint64 | {
"checked_file": "Hacl.K256.Scalar.fsti.checked",
"dependencies": [
"Spec.K256.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.K256.GLV.fst.checked",
"Hacl.Bignum.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.K256.Scalar.fsti"
} | [
"total"
] | [
"FStar.Pervasives.Native.tuple4",
"Lib.IntTypes.uint64"
] | [] | module Hacl.K256.Scalar
open FStar.HyperStack
open FStar.HyperStack.ST
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module S = Spec.K256
module SG = Hacl.Spec.K256.GLV
module BD = Hacl.Bignum.Definitions
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let qnlimb = 4ul
inline_for_extraction noextract
let qelem = lbuffer uint64 qnlimb
noextract
let qas_nat (h:mem) (e:qelem) : GTot nat = BD.bn_v #U64 #qnlimb h e
noextract
let qeval (h:mem) (e:qelem) : GTot S.qelem = qas_nat h e % S.q
noextract
let qe_lt_q (h:mem) (e:qelem) = qas_nat h e < S.q | false | true | Hacl.K256.Scalar.fsti | {
"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"
} | null | val qelem4 : Type0 | [] | Hacl.K256.Scalar.qelem4 | {
"file_name": "code/k256/Hacl.K256.Scalar.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 46,
"end_line": 39,
"start_col": 13,
"start_line": 39
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.GLV",
"short_module": "SG"
},
{
"abbrev": true,
"full_module": "Spec.K256",
"short_module": "S"
},
{
"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": "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.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.K256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.K256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let qas_nat4 (f:qelem4) =
let (f0, f1, f2, f3) = f in
v f0 + v f1 * pow2 64 + v f2 * pow2 128 + v f3 * pow2 192 | let qas_nat4 (f: qelem4) = | false | null | false | let f0, f1, f2, f3 = f in
v f0 + v f1 * pow2 64 + v f2 * pow2 128 + v f3 * pow2 192 | {
"checked_file": "Hacl.K256.Scalar.fsti.checked",
"dependencies": [
"Spec.K256.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.K256.GLV.fst.checked",
"Hacl.Bignum.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.K256.Scalar.fsti"
} | [
"total"
] | [
"Hacl.K256.Scalar.qelem4",
"Lib.IntTypes.uint64",
"Prims.op_Addition",
"Lib.IntTypes.v",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"FStar.Mul.op_Star",
"Prims.pow2",
"Prims.int"
] | [] | module Hacl.K256.Scalar
open FStar.HyperStack
open FStar.HyperStack.ST
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module S = Spec.K256
module SG = Hacl.Spec.K256.GLV
module BD = Hacl.Bignum.Definitions
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let qnlimb = 4ul
inline_for_extraction noextract
let qelem = lbuffer uint64 qnlimb
noextract
let qas_nat (h:mem) (e:qelem) : GTot nat = BD.bn_v #U64 #qnlimb h e
noextract
let qeval (h:mem) (e:qelem) : GTot S.qelem = qas_nat h e % S.q
noextract
let qe_lt_q (h:mem) (e:qelem) = qas_nat h e < S.q
inline_for_extraction noextract
let qelem4 = uint64 & uint64 & uint64 & uint64 | false | true | Hacl.K256.Scalar.fsti | {
"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"
} | null | val qas_nat4 : f: Hacl.K256.Scalar.qelem4 -> Prims.int | [] | Hacl.K256.Scalar.qas_nat4 | {
"file_name": "code/k256/Hacl.K256.Scalar.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: Hacl.K256.Scalar.qelem4 -> Prims.int | {
"end_col": 59,
"end_line": 44,
"start_col": 25,
"start_line": 42
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.GLV",
"short_module": "SG"
},
{
"abbrev": true,
"full_module": "Spec.K256",
"short_module": "S"
},
{
"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": "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.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.K256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.K256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let qnlimb = 4ul | let qnlimb = | false | null | false | 4ul | {
"checked_file": "Hacl.K256.Scalar.fsti.checked",
"dependencies": [
"Spec.K256.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.K256.GLV.fst.checked",
"Hacl.Bignum.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.K256.Scalar.fsti"
} | [
"total"
] | [
"FStar.UInt32.__uint_to_t"
] | [] | module Hacl.K256.Scalar
open FStar.HyperStack
open FStar.HyperStack.ST
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module S = Spec.K256
module SG = Hacl.Spec.K256.GLV
module BD = Hacl.Bignum.Definitions
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0" | false | true | Hacl.K256.Scalar.fsti | {
"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"
} | null | val qnlimb : FStar.UInt32.t | [] | Hacl.K256.Scalar.qnlimb | {
"file_name": "code/k256/Hacl.K256.Scalar.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | FStar.UInt32.t | {
"end_col": 16,
"end_line": 23,
"start_col": 13,
"start_line": 23
} |
|
Prims.GTot | val qas_nat (h: mem) (e: qelem) : GTot nat | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.GLV",
"short_module": "SG"
},
{
"abbrev": true,
"full_module": "Spec.K256",
"short_module": "S"
},
{
"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": "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.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.K256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.K256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let qas_nat (h:mem) (e:qelem) : GTot nat = BD.bn_v #U64 #qnlimb h e | val qas_nat (h: mem) (e: qelem) : GTot nat
let qas_nat (h: mem) (e: qelem) : GTot nat = | false | null | false | BD.bn_v #U64 #qnlimb h e | {
"checked_file": "Hacl.K256.Scalar.fsti.checked",
"dependencies": [
"Spec.K256.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.K256.GLV.fst.checked",
"Hacl.Bignum.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.K256.Scalar.fsti"
} | [
"sometrivial"
] | [
"FStar.Monotonic.HyperStack.mem",
"Hacl.K256.Scalar.qelem",
"Hacl.Bignum.Definitions.bn_v",
"Lib.IntTypes.U64",
"Hacl.K256.Scalar.qnlimb",
"Prims.nat"
] | [] | module Hacl.K256.Scalar
open FStar.HyperStack
open FStar.HyperStack.ST
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module S = Spec.K256
module SG = Hacl.Spec.K256.GLV
module BD = Hacl.Bignum.Definitions
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let qnlimb = 4ul
inline_for_extraction noextract
let qelem = lbuffer uint64 qnlimb | false | false | Hacl.K256.Scalar.fsti | {
"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"
} | null | val qas_nat (h: mem) (e: qelem) : GTot nat | [] | Hacl.K256.Scalar.qas_nat | {
"file_name": "code/k256/Hacl.K256.Scalar.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | h: FStar.Monotonic.HyperStack.mem -> e: Hacl.K256.Scalar.qelem -> Prims.GTot Prims.nat | {
"end_col": 67,
"end_line": 29,
"start_col": 43,
"start_line": 29
} |
Prims.GTot | val qeval (h: mem) (e: qelem) : GTot S.qelem | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.K256.GLV",
"short_module": "SG"
},
{
"abbrev": true,
"full_module": "Spec.K256",
"short_module": "S"
},
{
"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": "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.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.K256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.K256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let qeval (h:mem) (e:qelem) : GTot S.qelem = qas_nat h e % S.q | val qeval (h: mem) (e: qelem) : GTot S.qelem
let qeval (h: mem) (e: qelem) : GTot S.qelem = | false | null | false | qas_nat h e % S.q | {
"checked_file": "Hacl.K256.Scalar.fsti.checked",
"dependencies": [
"Spec.K256.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.K256.GLV.fst.checked",
"Hacl.Bignum.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.K256.Scalar.fsti"
} | [
"sometrivial"
] | [
"FStar.Monotonic.HyperStack.mem",
"Hacl.K256.Scalar.qelem",
"Prims.op_Modulus",
"Hacl.K256.Scalar.qas_nat",
"Spec.K256.PointOps.q",
"Spec.K256.PointOps.qelem"
] | [] | module Hacl.K256.Scalar
open FStar.HyperStack
open FStar.HyperStack.ST
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module S = Spec.K256
module SG = Hacl.Spec.K256.GLV
module BD = Hacl.Bignum.Definitions
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let qnlimb = 4ul
inline_for_extraction noextract
let qelem = lbuffer uint64 qnlimb
noextract
let qas_nat (h:mem) (e:qelem) : GTot nat = BD.bn_v #U64 #qnlimb h e | false | false | Hacl.K256.Scalar.fsti | {
"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"
} | null | val qeval (h: mem) (e: qelem) : GTot S.qelem | [] | Hacl.K256.Scalar.qeval | {
"file_name": "code/k256/Hacl.K256.Scalar.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | h: FStar.Monotonic.HyperStack.mem -> e: Hacl.K256.Scalar.qelem
-> Prims.GTot Spec.K256.PointOps.qelem | {
"end_col": 62,
"end_line": 32,
"start_col": 45,
"start_line": 32
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let abcd_idx = (n: nat { n < 4 } ) | let abcd_idx = | false | null | false | (n: nat{n < 4}) | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val abcd_idx : Type0 | [] | Spec.MD5.abcd_idx | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 34,
"end_line": 117,
"start_col": 15,
"start_line": 117
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let x_t = Seq.lseq uint32 16 | let x_t = | false | null | false | Seq.lseq uint32 16 | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"FStar.Seq.Properties.lseq",
"Lib.IntTypes.uint32"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4 | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val x_t : Type0 | [] | Spec.MD5.x_t | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 28,
"end_line": 122,
"start_col": 10,
"start_line": 122
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let x_idx = (n: nat { n < 16 } ) | let x_idx = | false | null | false | (n: nat{n < 16}) | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4 | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val x_idx : Type0 | [] | Spec.MD5.x_idx | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 32,
"end_line": 121,
"start_col": 12,
"start_line": 121
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let t_idx = (n: nat { 1 <= n /\ n <= 64 } ) | let t_idx = | false | null | false | (n: nat{1 <= n /\ n <= 64}) | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16 | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val t_idx : Type0 | [] | Spec.MD5.t_idx | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 43,
"end_line": 124,
"start_col": 12,
"start_line": 124
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let round4_op = round_op_gen i | let round4_op = | false | null | false | round_op_gen i | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.round_op_gen",
"Spec.MD5.i"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd
[@"opaque_to_smt"]
let round1 = round1_aux
let round2_op = round_op_gen g
let round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round2_op abcd x ia ib ic id 1 5ul 17 in
let abcd = round2_op abcd x id ia ib ic 6 9ul 18 in
let abcd = round2_op abcd x ic id ia ib 11 14ul 19 in
let abcd = round2_op abcd x ib ic id ia 0 20ul 20 in
let abcd = round2_op abcd x ia ib ic id 5 5ul 21 in
let abcd = round2_op abcd x id ia ib ic 10 9ul 22 in
let abcd = round2_op abcd x ic id ia ib 15 14ul 23 in
let abcd = round2_op abcd x ib ic id ia 4 20ul 24 in
let abcd = round2_op abcd x ia ib ic id 9 5ul 25 in
let abcd = round2_op abcd x id ia ib ic 14 9ul 26 in
let abcd = round2_op abcd x ic id ia ib 3 14ul 27 in
let abcd = round2_op abcd x ib ic id ia 8 20ul 28 in
let abcd = round2_op abcd x ia ib ic id 13 5ul 29 in
let abcd = round2_op abcd x id ia ib ic 2 9ul 30 in
let abcd = round2_op abcd x ic id ia ib 7 14ul 31 in
let abcd = round2_op abcd x ib ic id ia 12 20ul 32 in
abcd
[@"opaque_to_smt"]
let round2 = round2_aux
let round3_op = round_op_gen h
let round3_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round3_op abcd x ia ib ic id 5 4ul 33 in
let abcd = round3_op abcd x id ia ib ic 8 11ul 34 in
let abcd = round3_op abcd x ic id ia ib 11 16ul 35 in
let abcd = round3_op abcd x ib ic id ia 14 23ul 36 in
let abcd = round3_op abcd x ia ib ic id 1 4ul 37 in
let abcd = round3_op abcd x id ia ib ic 4 11ul 38 in
let abcd = round3_op abcd x ic id ia ib 7 16ul 39 in
let abcd = round3_op abcd x ib ic id ia 10 23ul 40 in
let abcd = round3_op abcd x ia ib ic id 13 4ul 41 in
let abcd = round3_op abcd x id ia ib ic 0 11ul 42 in
let abcd = round3_op abcd x ic id ia ib 3 16ul 43 in
let abcd = round3_op abcd x ib ic id ia 6 23ul 44 in
let abcd = round3_op abcd x ia ib ic id 9 4ul 45 in
let abcd = round3_op abcd x id ia ib ic 12 11ul 46 in
let abcd = round3_op abcd x ic id ia ib 15 16ul 47 in
let abcd = round3_op abcd x ib ic id ia 2 23ul 48 in
abcd
[@"opaque_to_smt"]
let round3 = round3_aux | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val round4_op : abcd: Spec.MD5.abcd_t ->
x: Spec.MD5.x_t ->
a: Spec.MD5.abcd_idx ->
b: Spec.MD5.abcd_idx ->
c: Spec.MD5.abcd_idx ->
d: Spec.MD5.abcd_idx ->
k: Spec.MD5.x_idx ->
s: Spec.MD5.rotate_idx ->
i: Spec.MD5.t_idx
-> Spec.MD5.abcd_t | [] | Spec.MD5.round4_op | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
abcd: Spec.MD5.abcd_t ->
x: Spec.MD5.x_t ->
a: Spec.MD5.abcd_idx ->
b: Spec.MD5.abcd_idx ->
c: Spec.MD5.abcd_idx ->
d: Spec.MD5.abcd_idx ->
k: Spec.MD5.x_idx ->
s: Spec.MD5.rotate_idx ->
i: Spec.MD5.t_idx
-> Spec.MD5.abcd_t | {
"end_col": 30,
"end_line": 230,
"start_col": 16,
"start_line": 230
} |
|
Prims.Tot | val i (x y z: uint32) : Tot uint32 | [
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z) | val i (x y z: uint32) : Tot uint32
let i (x y z: uint32) : Tot uint32 = | false | null | false | y ^. (x |. ~.z) | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Lib.IntTypes.uint32",
"Lib.IntTypes.op_Hat_Dot",
"Lib.IntTypes.U32",
"Lib.IntTypes.SEC",
"Lib.IntTypes.op_Bar_Dot",
"Lib.IntTypes.op_Tilde_Dot"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val i (x y z: uint32) : Tot uint32 | [] | Spec.MD5.i | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Lib.IntTypes.uint32 -> y: Lib.IntTypes.uint32 -> z: Lib.IntTypes.uint32 -> Lib.IntTypes.uint32 | {
"end_col": 18,
"end_line": 36,
"start_col": 2,
"start_line": 36
} |
Prims.Tot | val f (x y z: uint32) : Tot uint32 | [
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z) | val f (x y z: uint32) : Tot uint32
let f (x y z: uint32) : Tot uint32 = | false | null | false | (x &. y) |. ((~.x) &. z) | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Lib.IntTypes.uint32",
"Lib.IntTypes.op_Bar_Dot",
"Lib.IntTypes.U32",
"Lib.IntTypes.SEC",
"Lib.IntTypes.op_Amp_Dot",
"Lib.IntTypes.op_Tilde_Dot"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val f (x y z: uint32) : Tot uint32 | [] | Spec.MD5.f | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Lib.IntTypes.uint32 -> y: Lib.IntTypes.uint32 -> z: Lib.IntTypes.uint32 -> Lib.IntTypes.uint32 | {
"end_col": 27,
"end_line": 24,
"start_col": 2,
"start_line": 24
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rotate_idx = rotval U32 | let rotate_idx = | false | null | false | rotval U32 | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Lib.IntTypes.rotval",
"Lib.IntTypes.U32"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } ) | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val rotate_idx : Type0 | [] | Spec.MD5.rotate_idx | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 27,
"end_line": 127,
"start_col": 17,
"start_line": 127
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let round4 = round4_aux | let round4 = | false | null | false | round4_aux | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.round4_aux"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd
[@"opaque_to_smt"]
let round1 = round1_aux
let round2_op = round_op_gen g
let round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round2_op abcd x ia ib ic id 1 5ul 17 in
let abcd = round2_op abcd x id ia ib ic 6 9ul 18 in
let abcd = round2_op abcd x ic id ia ib 11 14ul 19 in
let abcd = round2_op abcd x ib ic id ia 0 20ul 20 in
let abcd = round2_op abcd x ia ib ic id 5 5ul 21 in
let abcd = round2_op abcd x id ia ib ic 10 9ul 22 in
let abcd = round2_op abcd x ic id ia ib 15 14ul 23 in
let abcd = round2_op abcd x ib ic id ia 4 20ul 24 in
let abcd = round2_op abcd x ia ib ic id 9 5ul 25 in
let abcd = round2_op abcd x id ia ib ic 14 9ul 26 in
let abcd = round2_op abcd x ic id ia ib 3 14ul 27 in
let abcd = round2_op abcd x ib ic id ia 8 20ul 28 in
let abcd = round2_op abcd x ia ib ic id 13 5ul 29 in
let abcd = round2_op abcd x id ia ib ic 2 9ul 30 in
let abcd = round2_op abcd x ic id ia ib 7 14ul 31 in
let abcd = round2_op abcd x ib ic id ia 12 20ul 32 in
abcd
[@"opaque_to_smt"]
let round2 = round2_aux
let round3_op = round_op_gen h
let round3_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round3_op abcd x ia ib ic id 5 4ul 33 in
let abcd = round3_op abcd x id ia ib ic 8 11ul 34 in
let abcd = round3_op abcd x ic id ia ib 11 16ul 35 in
let abcd = round3_op abcd x ib ic id ia 14 23ul 36 in
let abcd = round3_op abcd x ia ib ic id 1 4ul 37 in
let abcd = round3_op abcd x id ia ib ic 4 11ul 38 in
let abcd = round3_op abcd x ic id ia ib 7 16ul 39 in
let abcd = round3_op abcd x ib ic id ia 10 23ul 40 in
let abcd = round3_op abcd x ia ib ic id 13 4ul 41 in
let abcd = round3_op abcd x id ia ib ic 0 11ul 42 in
let abcd = round3_op abcd x ic id ia ib 3 16ul 43 in
let abcd = round3_op abcd x ib ic id ia 6 23ul 44 in
let abcd = round3_op abcd x ia ib ic id 9 4ul 45 in
let abcd = round3_op abcd x id ia ib ic 12 11ul 46 in
let abcd = round3_op abcd x ic id ia ib 15 16ul 47 in
let abcd = round3_op abcd x ib ic id ia 2 23ul 48 in
abcd
[@"opaque_to_smt"]
let round3 = round3_aux
let round4_op = round_op_gen i
let round4_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round4_op abcd x ia ib ic id 0 6ul 49 in
let abcd = round4_op abcd x id ia ib ic 7 10ul 50 in
let abcd = round4_op abcd x ic id ia ib 14 15ul 51 in
let abcd = round4_op abcd x ib ic id ia 5 21ul 52 in
let abcd = round4_op abcd x ia ib ic id 12 6ul 53 in
let abcd = round4_op abcd x id ia ib ic 3 10ul 54 in
let abcd = round4_op abcd x ic id ia ib 10 15ul 55 in
let abcd = round4_op abcd x ib ic id ia 1 21ul 56 in
let abcd = round4_op abcd x ia ib ic id 8 6ul 57 in
let abcd = round4_op abcd x id ia ib ic 15 10ul 58 in
let abcd = round4_op abcd x ic id ia ib 6 15ul 59 in
let abcd = round4_op abcd x ib ic id ia 13 21ul 60 in
let abcd = round4_op abcd x ia ib ic id 4 6ul 61 in
let abcd = round4_op abcd x id ia ib ic 11 10ul 62 in
let abcd = round4_op abcd x ic id ia ib 2 15ul 63 in
let abcd = round4_op abcd x ib ic id ia 9 21ul 64 in
abcd | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val round4 : abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | [] | Spec.MD5.round4 | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | {
"end_col": 23,
"end_line": 256,
"start_col": 13,
"start_line": 256
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let round3_op = round_op_gen h | let round3_op = | false | null | false | round_op_gen h | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.round_op_gen",
"Spec.MD5.h"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd
[@"opaque_to_smt"]
let round1 = round1_aux
let round2_op = round_op_gen g
let round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round2_op abcd x ia ib ic id 1 5ul 17 in
let abcd = round2_op abcd x id ia ib ic 6 9ul 18 in
let abcd = round2_op abcd x ic id ia ib 11 14ul 19 in
let abcd = round2_op abcd x ib ic id ia 0 20ul 20 in
let abcd = round2_op abcd x ia ib ic id 5 5ul 21 in
let abcd = round2_op abcd x id ia ib ic 10 9ul 22 in
let abcd = round2_op abcd x ic id ia ib 15 14ul 23 in
let abcd = round2_op abcd x ib ic id ia 4 20ul 24 in
let abcd = round2_op abcd x ia ib ic id 9 5ul 25 in
let abcd = round2_op abcd x id ia ib ic 14 9ul 26 in
let abcd = round2_op abcd x ic id ia ib 3 14ul 27 in
let abcd = round2_op abcd x ib ic id ia 8 20ul 28 in
let abcd = round2_op abcd x ia ib ic id 13 5ul 29 in
let abcd = round2_op abcd x id ia ib ic 2 9ul 30 in
let abcd = round2_op abcd x ic id ia ib 7 14ul 31 in
let abcd = round2_op abcd x ib ic id ia 12 20ul 32 in
abcd
[@"opaque_to_smt"]
let round2 = round2_aux | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val round3_op : abcd: Spec.MD5.abcd_t ->
x: Spec.MD5.x_t ->
a: Spec.MD5.abcd_idx ->
b: Spec.MD5.abcd_idx ->
c: Spec.MD5.abcd_idx ->
d: Spec.MD5.abcd_idx ->
k: Spec.MD5.x_idx ->
s: Spec.MD5.rotate_idx ->
i: Spec.MD5.t_idx
-> Spec.MD5.abcd_t | [] | Spec.MD5.round3_op | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
abcd: Spec.MD5.abcd_t ->
x: Spec.MD5.x_t ->
a: Spec.MD5.abcd_idx ->
b: Spec.MD5.abcd_idx ->
c: Spec.MD5.abcd_idx ->
d: Spec.MD5.abcd_idx ->
k: Spec.MD5.x_idx ->
s: Spec.MD5.rotate_idx ->
i: Spec.MD5.t_idx
-> Spec.MD5.abcd_t | {
"end_col": 30,
"end_line": 202,
"start_col": 16,
"start_line": 202
} |
|
Prims.Tot | val ib:abcd_idx | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let ib : abcd_idx = 1 | val ib:abcd_idx
let ib:abcd_idx = | false | null | false | 1 | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val ib:abcd_idx | [] | Spec.MD5.ib | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Spec.MD5.abcd_idx | {
"end_col": 21,
"end_line": 144,
"start_col": 20,
"start_line": 144
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let round1 = round1_aux | let round1 = | false | null | false | round1_aux | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.round1_aux"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val round1 : abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | [] | Spec.MD5.round1 | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | {
"end_col": 23,
"end_line": 172,
"start_col": 13,
"start_line": 172
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let round2 = round2_aux | let round2 = | false | null | false | round2_aux | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.round2_aux"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd
[@"opaque_to_smt"]
let round1 = round1_aux
let round2_op = round_op_gen g
let round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round2_op abcd x ia ib ic id 1 5ul 17 in
let abcd = round2_op abcd x id ia ib ic 6 9ul 18 in
let abcd = round2_op abcd x ic id ia ib 11 14ul 19 in
let abcd = round2_op abcd x ib ic id ia 0 20ul 20 in
let abcd = round2_op abcd x ia ib ic id 5 5ul 21 in
let abcd = round2_op abcd x id ia ib ic 10 9ul 22 in
let abcd = round2_op abcd x ic id ia ib 15 14ul 23 in
let abcd = round2_op abcd x ib ic id ia 4 20ul 24 in
let abcd = round2_op abcd x ia ib ic id 9 5ul 25 in
let abcd = round2_op abcd x id ia ib ic 14 9ul 26 in
let abcd = round2_op abcd x ic id ia ib 3 14ul 27 in
let abcd = round2_op abcd x ib ic id ia 8 20ul 28 in
let abcd = round2_op abcd x ia ib ic id 13 5ul 29 in
let abcd = round2_op abcd x id ia ib ic 2 9ul 30 in
let abcd = round2_op abcd x ic id ia ib 7 14ul 31 in
let abcd = round2_op abcd x ib ic id ia 12 20ul 32 in
abcd | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val round2 : abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | [] | Spec.MD5.round2 | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | {
"end_col": 23,
"end_line": 200,
"start_col": 13,
"start_line": 200
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let round1_op = round_op_gen f | let round1_op = | false | null | false | round_op_gen f | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.round_op_gen",
"Spec.MD5.f"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *) | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val round1_op : abcd: Spec.MD5.abcd_t ->
x: Spec.MD5.x_t ->
a: Spec.MD5.abcd_idx ->
b: Spec.MD5.abcd_idx ->
c: Spec.MD5.abcd_idx ->
d: Spec.MD5.abcd_idx ->
k: Spec.MD5.x_idx ->
s: Spec.MD5.rotate_idx ->
i: Spec.MD5.t_idx
-> Spec.MD5.abcd_t | [] | Spec.MD5.round1_op | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
abcd: Spec.MD5.abcd_t ->
x: Spec.MD5.x_t ->
a: Spec.MD5.abcd_idx ->
b: Spec.MD5.abcd_idx ->
c: Spec.MD5.abcd_idx ->
d: Spec.MD5.abcd_idx ->
k: Spec.MD5.x_idx ->
s: Spec.MD5.rotate_idx ->
i: Spec.MD5.t_idx
-> Spec.MD5.abcd_t | {
"end_col": 30,
"end_line": 141,
"start_col": 16,
"start_line": 141
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let overwrite = overwrite_aux | let overwrite = | false | null | false | overwrite_aux | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.overwrite_aux"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd
[@"opaque_to_smt"]
let round1 = round1_aux
let round2_op = round_op_gen g
let round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round2_op abcd x ia ib ic id 1 5ul 17 in
let abcd = round2_op abcd x id ia ib ic 6 9ul 18 in
let abcd = round2_op abcd x ic id ia ib 11 14ul 19 in
let abcd = round2_op abcd x ib ic id ia 0 20ul 20 in
let abcd = round2_op abcd x ia ib ic id 5 5ul 21 in
let abcd = round2_op abcd x id ia ib ic 10 9ul 22 in
let abcd = round2_op abcd x ic id ia ib 15 14ul 23 in
let abcd = round2_op abcd x ib ic id ia 4 20ul 24 in
let abcd = round2_op abcd x ia ib ic id 9 5ul 25 in
let abcd = round2_op abcd x id ia ib ic 14 9ul 26 in
let abcd = round2_op abcd x ic id ia ib 3 14ul 27 in
let abcd = round2_op abcd x ib ic id ia 8 20ul 28 in
let abcd = round2_op abcd x ia ib ic id 13 5ul 29 in
let abcd = round2_op abcd x id ia ib ic 2 9ul 30 in
let abcd = round2_op abcd x ic id ia ib 7 14ul 31 in
let abcd = round2_op abcd x ib ic id ia 12 20ul 32 in
abcd
[@"opaque_to_smt"]
let round2 = round2_aux
let round3_op = round_op_gen h
let round3_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round3_op abcd x ia ib ic id 5 4ul 33 in
let abcd = round3_op abcd x id ia ib ic 8 11ul 34 in
let abcd = round3_op abcd x ic id ia ib 11 16ul 35 in
let abcd = round3_op abcd x ib ic id ia 14 23ul 36 in
let abcd = round3_op abcd x ia ib ic id 1 4ul 37 in
let abcd = round3_op abcd x id ia ib ic 4 11ul 38 in
let abcd = round3_op abcd x ic id ia ib 7 16ul 39 in
let abcd = round3_op abcd x ib ic id ia 10 23ul 40 in
let abcd = round3_op abcd x ia ib ic id 13 4ul 41 in
let abcd = round3_op abcd x id ia ib ic 0 11ul 42 in
let abcd = round3_op abcd x ic id ia ib 3 16ul 43 in
let abcd = round3_op abcd x ib ic id ia 6 23ul 44 in
let abcd = round3_op abcd x ia ib ic id 9 4ul 45 in
let abcd = round3_op abcd x id ia ib ic 12 11ul 46 in
let abcd = round3_op abcd x ic id ia ib 15 16ul 47 in
let abcd = round3_op abcd x ib ic id ia 2 23ul 48 in
abcd
[@"opaque_to_smt"]
let round3 = round3_aux
let round4_op = round_op_gen i
let round4_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round4_op abcd x ia ib ic id 0 6ul 49 in
let abcd = round4_op abcd x id ia ib ic 7 10ul 50 in
let abcd = round4_op abcd x ic id ia ib 14 15ul 51 in
let abcd = round4_op abcd x ib ic id ia 5 21ul 52 in
let abcd = round4_op abcd x ia ib ic id 12 6ul 53 in
let abcd = round4_op abcd x id ia ib ic 3 10ul 54 in
let abcd = round4_op abcd x ic id ia ib 10 15ul 55 in
let abcd = round4_op abcd x ib ic id ia 1 21ul 56 in
let abcd = round4_op abcd x ia ib ic id 8 6ul 57 in
let abcd = round4_op abcd x id ia ib ic 15 10ul 58 in
let abcd = round4_op abcd x ic id ia ib 6 15ul 59 in
let abcd = round4_op abcd x ib ic id ia 13 21ul 60 in
let abcd = round4_op abcd x ia ib ic id 4 6ul 61 in
let abcd = round4_op abcd x id ia ib ic 11 10ul 62 in
let abcd = round4_op abcd x ic id ia ib 2 15ul 63 in
let abcd = round4_op abcd x ib ic id ia 9 21ul 64 in
abcd
[@"opaque_to_smt"]
let round4 = round4_aux
let rounds_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1 abcd x in
let abcd = round2 abcd x in
let abcd = round3 abcd x in
let abcd = round4 abcd x in
abcd
[@"opaque_to_smt"]
let rounds = rounds_aux
let overwrite_aux (abcd: abcd_t) (a' b' c' d' : uint32) : Tot abcd_t =
let abcd : abcd_t = Seq.upd abcd ia a' in
let abcd : abcd_t = Seq.upd abcd ib b' in
let abcd : abcd_t = Seq.upd abcd ic c' in
let abcd : abcd_t = Seq.upd abcd id d' in
abcd | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val overwrite : abcd: Spec.MD5.abcd_t ->
a': Lib.IntTypes.uint32 ->
b': Lib.IntTypes.uint32 ->
c': Lib.IntTypes.uint32 ->
d': Lib.IntTypes.uint32
-> Spec.MD5.abcd_t | [] | Spec.MD5.overwrite | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
abcd: Spec.MD5.abcd_t ->
a': Lib.IntTypes.uint32 ->
b': Lib.IntTypes.uint32 ->
c': Lib.IntTypes.uint32 ->
d': Lib.IntTypes.uint32
-> Spec.MD5.abcd_t | {
"end_col": 29,
"end_line": 276,
"start_col": 16,
"start_line": 276
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let abcd_t = Seq.lseq uint32 4 | let abcd_t = | false | null | false | Seq.lseq uint32 4 | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"FStar.Seq.Properties.lseq",
"Lib.IntTypes.uint32"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } ) | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val abcd_t : Type0 | [] | Spec.MD5.abcd_t | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 30,
"end_line": 119,
"start_col": 13,
"start_line": 119
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let round_op_gen = round_op_gen_aux | let round_op_gen = | false | null | false | round_op_gen_aux | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.round_op_gen_aux"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s)) | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val round_op_gen : f:
(_: Lib.IntTypes.uint32 -> _: Lib.IntTypes.uint32 -> _: Lib.IntTypes.uint32
-> Lib.IntTypes.uint32) ->
abcd: Spec.MD5.abcd_t ->
x: Spec.MD5.x_t ->
a: Spec.MD5.abcd_idx ->
b: Spec.MD5.abcd_idx ->
c: Spec.MD5.abcd_idx ->
d: Spec.MD5.abcd_idx ->
k: Spec.MD5.x_idx ->
s: Spec.MD5.rotate_idx ->
i: Spec.MD5.t_idx
-> Spec.MD5.abcd_t | [] | Spec.MD5.round_op_gen | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
f:
(_: Lib.IntTypes.uint32 -> _: Lib.IntTypes.uint32 -> _: Lib.IntTypes.uint32
-> Lib.IntTypes.uint32) ->
abcd: Spec.MD5.abcd_t ->
x: Spec.MD5.x_t ->
a: Spec.MD5.abcd_idx ->
b: Spec.MD5.abcd_idx ->
c: Spec.MD5.abcd_idx ->
d: Spec.MD5.abcd_idx ->
k: Spec.MD5.x_idx ->
s: Spec.MD5.rotate_idx ->
i: Spec.MD5.t_idx
-> Spec.MD5.abcd_t | {
"end_col": 35,
"end_line": 137,
"start_col": 19,
"start_line": 137
} |
|
Prims.Tot | val h (x y z: uint32) : Tot uint32 | [
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z | val h (x y z: uint32) : Tot uint32
let h (x y z: uint32) : Tot uint32 = | false | null | false | x ^. y ^. z | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Lib.IntTypes.uint32",
"Lib.IntTypes.op_Hat_Dot",
"Lib.IntTypes.U32",
"Lib.IntTypes.SEC"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val h (x y z: uint32) : Tot uint32 | [] | Spec.MD5.h | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Lib.IntTypes.uint32 -> y: Lib.IntTypes.uint32 -> z: Lib.IntTypes.uint32 -> Lib.IntTypes.uint32 | {
"end_col": 13,
"end_line": 32,
"start_col": 2,
"start_line": 32
} |
Prims.Tot | val id:abcd_idx | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let id : abcd_idx = 3 | val id:abcd_idx
let id:abcd_idx = | false | null | false | 3 | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1 | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val id:abcd_idx | [] | Spec.MD5.id | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Spec.MD5.abcd_idx | {
"end_col": 21,
"end_line": 146,
"start_col": 20,
"start_line": 146
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let round3 = round3_aux | let round3 = | false | null | false | round3_aux | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.round3_aux"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd
[@"opaque_to_smt"]
let round1 = round1_aux
let round2_op = round_op_gen g
let round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round2_op abcd x ia ib ic id 1 5ul 17 in
let abcd = round2_op abcd x id ia ib ic 6 9ul 18 in
let abcd = round2_op abcd x ic id ia ib 11 14ul 19 in
let abcd = round2_op abcd x ib ic id ia 0 20ul 20 in
let abcd = round2_op abcd x ia ib ic id 5 5ul 21 in
let abcd = round2_op abcd x id ia ib ic 10 9ul 22 in
let abcd = round2_op abcd x ic id ia ib 15 14ul 23 in
let abcd = round2_op abcd x ib ic id ia 4 20ul 24 in
let abcd = round2_op abcd x ia ib ic id 9 5ul 25 in
let abcd = round2_op abcd x id ia ib ic 14 9ul 26 in
let abcd = round2_op abcd x ic id ia ib 3 14ul 27 in
let abcd = round2_op abcd x ib ic id ia 8 20ul 28 in
let abcd = round2_op abcd x ia ib ic id 13 5ul 29 in
let abcd = round2_op abcd x id ia ib ic 2 9ul 30 in
let abcd = round2_op abcd x ic id ia ib 7 14ul 31 in
let abcd = round2_op abcd x ib ic id ia 12 20ul 32 in
abcd
[@"opaque_to_smt"]
let round2 = round2_aux
let round3_op = round_op_gen h
let round3_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round3_op abcd x ia ib ic id 5 4ul 33 in
let abcd = round3_op abcd x id ia ib ic 8 11ul 34 in
let abcd = round3_op abcd x ic id ia ib 11 16ul 35 in
let abcd = round3_op abcd x ib ic id ia 14 23ul 36 in
let abcd = round3_op abcd x ia ib ic id 1 4ul 37 in
let abcd = round3_op abcd x id ia ib ic 4 11ul 38 in
let abcd = round3_op abcd x ic id ia ib 7 16ul 39 in
let abcd = round3_op abcd x ib ic id ia 10 23ul 40 in
let abcd = round3_op abcd x ia ib ic id 13 4ul 41 in
let abcd = round3_op abcd x id ia ib ic 0 11ul 42 in
let abcd = round3_op abcd x ic id ia ib 3 16ul 43 in
let abcd = round3_op abcd x ib ic id ia 6 23ul 44 in
let abcd = round3_op abcd x ia ib ic id 9 4ul 45 in
let abcd = round3_op abcd x id ia ib ic 12 11ul 46 in
let abcd = round3_op abcd x ic id ia ib 15 16ul 47 in
let abcd = round3_op abcd x ib ic id ia 2 23ul 48 in
abcd | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val round3 : abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | [] | Spec.MD5.round3 | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | {
"end_col": 23,
"end_line": 228,
"start_col": 13,
"start_line": 228
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let round2_op = round_op_gen g | let round2_op = | false | null | false | round_op_gen g | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.round_op_gen",
"Spec.MD5.g"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd
[@"opaque_to_smt"]
let round1 = round1_aux | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val round2_op : abcd: Spec.MD5.abcd_t ->
x: Spec.MD5.x_t ->
a: Spec.MD5.abcd_idx ->
b: Spec.MD5.abcd_idx ->
c: Spec.MD5.abcd_idx ->
d: Spec.MD5.abcd_idx ->
k: Spec.MD5.x_idx ->
s: Spec.MD5.rotate_idx ->
i: Spec.MD5.t_idx
-> Spec.MD5.abcd_t | [] | Spec.MD5.round2_op | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
abcd: Spec.MD5.abcd_t ->
x: Spec.MD5.x_t ->
a: Spec.MD5.abcd_idx ->
b: Spec.MD5.abcd_idx ->
c: Spec.MD5.abcd_idx ->
d: Spec.MD5.abcd_idx ->
k: Spec.MD5.x_idx ->
s: Spec.MD5.rotate_idx ->
i: Spec.MD5.t_idx
-> Spec.MD5.abcd_t | {
"end_col": 30,
"end_line": 174,
"start_col": 16,
"start_line": 174
} |
|
Prims.Tot | val rounds_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rounds_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1 abcd x in
let abcd = round2 abcd x in
let abcd = round3 abcd x in
let abcd = round4 abcd x in
abcd | val rounds_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t
let rounds_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t = | false | null | false | let abcd = round1 abcd x in
let abcd = round2 abcd x in
let abcd = round3 abcd x in
let abcd = round4 abcd x in
abcd | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.abcd_t",
"Spec.MD5.x_t",
"Spec.MD5.round4",
"Spec.MD5.round3",
"Spec.MD5.round2",
"Spec.MD5.round1"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd
[@"opaque_to_smt"]
let round1 = round1_aux
let round2_op = round_op_gen g
let round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round2_op abcd x ia ib ic id 1 5ul 17 in
let abcd = round2_op abcd x id ia ib ic 6 9ul 18 in
let abcd = round2_op abcd x ic id ia ib 11 14ul 19 in
let abcd = round2_op abcd x ib ic id ia 0 20ul 20 in
let abcd = round2_op abcd x ia ib ic id 5 5ul 21 in
let abcd = round2_op abcd x id ia ib ic 10 9ul 22 in
let abcd = round2_op abcd x ic id ia ib 15 14ul 23 in
let abcd = round2_op abcd x ib ic id ia 4 20ul 24 in
let abcd = round2_op abcd x ia ib ic id 9 5ul 25 in
let abcd = round2_op abcd x id ia ib ic 14 9ul 26 in
let abcd = round2_op abcd x ic id ia ib 3 14ul 27 in
let abcd = round2_op abcd x ib ic id ia 8 20ul 28 in
let abcd = round2_op abcd x ia ib ic id 13 5ul 29 in
let abcd = round2_op abcd x id ia ib ic 2 9ul 30 in
let abcd = round2_op abcd x ic id ia ib 7 14ul 31 in
let abcd = round2_op abcd x ib ic id ia 12 20ul 32 in
abcd
[@"opaque_to_smt"]
let round2 = round2_aux
let round3_op = round_op_gen h
let round3_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round3_op abcd x ia ib ic id 5 4ul 33 in
let abcd = round3_op abcd x id ia ib ic 8 11ul 34 in
let abcd = round3_op abcd x ic id ia ib 11 16ul 35 in
let abcd = round3_op abcd x ib ic id ia 14 23ul 36 in
let abcd = round3_op abcd x ia ib ic id 1 4ul 37 in
let abcd = round3_op abcd x id ia ib ic 4 11ul 38 in
let abcd = round3_op abcd x ic id ia ib 7 16ul 39 in
let abcd = round3_op abcd x ib ic id ia 10 23ul 40 in
let abcd = round3_op abcd x ia ib ic id 13 4ul 41 in
let abcd = round3_op abcd x id ia ib ic 0 11ul 42 in
let abcd = round3_op abcd x ic id ia ib 3 16ul 43 in
let abcd = round3_op abcd x ib ic id ia 6 23ul 44 in
let abcd = round3_op abcd x ia ib ic id 9 4ul 45 in
let abcd = round3_op abcd x id ia ib ic 12 11ul 46 in
let abcd = round3_op abcd x ic id ia ib 15 16ul 47 in
let abcd = round3_op abcd x ib ic id ia 2 23ul 48 in
abcd
[@"opaque_to_smt"]
let round3 = round3_aux
let round4_op = round_op_gen i
let round4_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round4_op abcd x ia ib ic id 0 6ul 49 in
let abcd = round4_op abcd x id ia ib ic 7 10ul 50 in
let abcd = round4_op abcd x ic id ia ib 14 15ul 51 in
let abcd = round4_op abcd x ib ic id ia 5 21ul 52 in
let abcd = round4_op abcd x ia ib ic id 12 6ul 53 in
let abcd = round4_op abcd x id ia ib ic 3 10ul 54 in
let abcd = round4_op abcd x ic id ia ib 10 15ul 55 in
let abcd = round4_op abcd x ib ic id ia 1 21ul 56 in
let abcd = round4_op abcd x ia ib ic id 8 6ul 57 in
let abcd = round4_op abcd x id ia ib ic 15 10ul 58 in
let abcd = round4_op abcd x ic id ia ib 6 15ul 59 in
let abcd = round4_op abcd x ib ic id ia 13 21ul 60 in
let abcd = round4_op abcd x ia ib ic id 4 6ul 61 in
let abcd = round4_op abcd x id ia ib ic 11 10ul 62 in
let abcd = round4_op abcd x ic id ia ib 2 15ul 63 in
let abcd = round4_op abcd x ib ic id ia 9 21ul 64 in
abcd
[@"opaque_to_smt"]
let round4 = round4_aux | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val rounds_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t | [] | Spec.MD5.rounds_aux | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | {
"end_col": 6,
"end_line": 263,
"start_col": 53,
"start_line": 258
} |
Prims.Tot | val ic:abcd_idx | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let ic : abcd_idx = 2 | val ic:abcd_idx
let ic:abcd_idx = | false | null | false | 2 | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0 | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val ic:abcd_idx | [] | Spec.MD5.ic | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Spec.MD5.abcd_idx | {
"end_col": 21,
"end_line": 145,
"start_col": 20,
"start_line": 145
} |
Prims.Tot | val ia:abcd_idx | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let ia : abcd_idx = 0 | val ia:abcd_idx
let ia:abcd_idx = | false | null | false | 0 | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val ia:abcd_idx | [] | Spec.MD5.ia | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Spec.MD5.abcd_idx | {
"end_col": 21,
"end_line": 143,
"start_col": 20,
"start_line": 143
} |
Prims.Tot | val g (x y z: uint32) : Tot uint32 | [
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z)) | val g (x y z: uint32) : Tot uint32
let g (x y z: uint32) : Tot uint32 = | false | null | false | (x &. z) |. (y &. (~.z)) | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Lib.IntTypes.uint32",
"Lib.IntTypes.op_Bar_Dot",
"Lib.IntTypes.U32",
"Lib.IntTypes.SEC",
"Lib.IntTypes.op_Amp_Dot",
"Lib.IntTypes.op_Tilde_Dot"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val g (x y z: uint32) : Tot uint32 | [] | Spec.MD5.g | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Lib.IntTypes.uint32 -> y: Lib.IntTypes.uint32 -> z: Lib.IntTypes.uint32 -> Lib.IntTypes.uint32 | {
"end_col": 27,
"end_line": 28,
"start_col": 2,
"start_line": 28
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rounds = rounds_aux | let rounds = | false | null | false | rounds_aux | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.rounds_aux"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd
[@"opaque_to_smt"]
let round1 = round1_aux
let round2_op = round_op_gen g
let round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round2_op abcd x ia ib ic id 1 5ul 17 in
let abcd = round2_op abcd x id ia ib ic 6 9ul 18 in
let abcd = round2_op abcd x ic id ia ib 11 14ul 19 in
let abcd = round2_op abcd x ib ic id ia 0 20ul 20 in
let abcd = round2_op abcd x ia ib ic id 5 5ul 21 in
let abcd = round2_op abcd x id ia ib ic 10 9ul 22 in
let abcd = round2_op abcd x ic id ia ib 15 14ul 23 in
let abcd = round2_op abcd x ib ic id ia 4 20ul 24 in
let abcd = round2_op abcd x ia ib ic id 9 5ul 25 in
let abcd = round2_op abcd x id ia ib ic 14 9ul 26 in
let abcd = round2_op abcd x ic id ia ib 3 14ul 27 in
let abcd = round2_op abcd x ib ic id ia 8 20ul 28 in
let abcd = round2_op abcd x ia ib ic id 13 5ul 29 in
let abcd = round2_op abcd x id ia ib ic 2 9ul 30 in
let abcd = round2_op abcd x ic id ia ib 7 14ul 31 in
let abcd = round2_op abcd x ib ic id ia 12 20ul 32 in
abcd
[@"opaque_to_smt"]
let round2 = round2_aux
let round3_op = round_op_gen h
let round3_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round3_op abcd x ia ib ic id 5 4ul 33 in
let abcd = round3_op abcd x id ia ib ic 8 11ul 34 in
let abcd = round3_op abcd x ic id ia ib 11 16ul 35 in
let abcd = round3_op abcd x ib ic id ia 14 23ul 36 in
let abcd = round3_op abcd x ia ib ic id 1 4ul 37 in
let abcd = round3_op abcd x id ia ib ic 4 11ul 38 in
let abcd = round3_op abcd x ic id ia ib 7 16ul 39 in
let abcd = round3_op abcd x ib ic id ia 10 23ul 40 in
let abcd = round3_op abcd x ia ib ic id 13 4ul 41 in
let abcd = round3_op abcd x id ia ib ic 0 11ul 42 in
let abcd = round3_op abcd x ic id ia ib 3 16ul 43 in
let abcd = round3_op abcd x ib ic id ia 6 23ul 44 in
let abcd = round3_op abcd x ia ib ic id 9 4ul 45 in
let abcd = round3_op abcd x id ia ib ic 12 11ul 46 in
let abcd = round3_op abcd x ic id ia ib 15 16ul 47 in
let abcd = round3_op abcd x ib ic id ia 2 23ul 48 in
abcd
[@"opaque_to_smt"]
let round3 = round3_aux
let round4_op = round_op_gen i
let round4_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round4_op abcd x ia ib ic id 0 6ul 49 in
let abcd = round4_op abcd x id ia ib ic 7 10ul 50 in
let abcd = round4_op abcd x ic id ia ib 14 15ul 51 in
let abcd = round4_op abcd x ib ic id ia 5 21ul 52 in
let abcd = round4_op abcd x ia ib ic id 12 6ul 53 in
let abcd = round4_op abcd x id ia ib ic 3 10ul 54 in
let abcd = round4_op abcd x ic id ia ib 10 15ul 55 in
let abcd = round4_op abcd x ib ic id ia 1 21ul 56 in
let abcd = round4_op abcd x ia ib ic id 8 6ul 57 in
let abcd = round4_op abcd x id ia ib ic 15 10ul 58 in
let abcd = round4_op abcd x ic id ia ib 6 15ul 59 in
let abcd = round4_op abcd x ib ic id ia 13 21ul 60 in
let abcd = round4_op abcd x ia ib ic id 4 6ul 61 in
let abcd = round4_op abcd x id ia ib ic 11 10ul 62 in
let abcd = round4_op abcd x ic id ia ib 2 15ul 63 in
let abcd = round4_op abcd x ib ic id ia 9 21ul 64 in
abcd
[@"opaque_to_smt"]
let round4 = round4_aux
let rounds_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1 abcd x in
let abcd = round2 abcd x in
let abcd = round3 abcd x in
let abcd = round4 abcd x in
abcd | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val rounds : abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | [] | Spec.MD5.rounds | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | {
"end_col": 23,
"end_line": 266,
"start_col": 13,
"start_line": 266
} |
|
Prims.Tot | val t:Seq.lseq uint32 64 | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list | val t:Seq.lseq uint32 64
let t:Seq.lseq uint32 64 = | false | null | false | assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"FStar.Seq.Properties.seq_of_list",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U32",
"Lib.IntTypes.SEC",
"Spec.MD5.t_as_list",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.int",
"FStar.List.Tot.Base.length"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot | false | false | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val t:Seq.lseq uint32 64 | [] | Spec.MD5.t | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | FStar.Seq.Properties.lseq (Lib.IntTypes.int_t Lib.IntTypes.U32 Lib.IntTypes.SEC) 64 | {
"end_col": 27,
"end_line": 115,
"start_col": 2,
"start_line": 114
} |
Prims.Tot | val overwrite_aux (abcd: abcd_t) (a' b' c' d': uint32) : Tot abcd_t | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let overwrite_aux (abcd: abcd_t) (a' b' c' d' : uint32) : Tot abcd_t =
let abcd : abcd_t = Seq.upd abcd ia a' in
let abcd : abcd_t = Seq.upd abcd ib b' in
let abcd : abcd_t = Seq.upd abcd ic c' in
let abcd : abcd_t = Seq.upd abcd id d' in
abcd | val overwrite_aux (abcd: abcd_t) (a' b' c' d': uint32) : Tot abcd_t
let overwrite_aux (abcd: abcd_t) (a' b' c' d': uint32) : Tot abcd_t = | false | null | false | let abcd:abcd_t = Seq.upd abcd ia a' in
let abcd:abcd_t = Seq.upd abcd ib b' in
let abcd:abcd_t = Seq.upd abcd ic c' in
let abcd:abcd_t = Seq.upd abcd id d' in
abcd | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.abcd_t",
"Lib.IntTypes.uint32",
"FStar.Seq.Base.upd",
"Spec.MD5.id",
"Spec.MD5.ic",
"Spec.MD5.ib",
"Spec.MD5.ia"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd
[@"opaque_to_smt"]
let round1 = round1_aux
let round2_op = round_op_gen g
let round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round2_op abcd x ia ib ic id 1 5ul 17 in
let abcd = round2_op abcd x id ia ib ic 6 9ul 18 in
let abcd = round2_op abcd x ic id ia ib 11 14ul 19 in
let abcd = round2_op abcd x ib ic id ia 0 20ul 20 in
let abcd = round2_op abcd x ia ib ic id 5 5ul 21 in
let abcd = round2_op abcd x id ia ib ic 10 9ul 22 in
let abcd = round2_op abcd x ic id ia ib 15 14ul 23 in
let abcd = round2_op abcd x ib ic id ia 4 20ul 24 in
let abcd = round2_op abcd x ia ib ic id 9 5ul 25 in
let abcd = round2_op abcd x id ia ib ic 14 9ul 26 in
let abcd = round2_op abcd x ic id ia ib 3 14ul 27 in
let abcd = round2_op abcd x ib ic id ia 8 20ul 28 in
let abcd = round2_op abcd x ia ib ic id 13 5ul 29 in
let abcd = round2_op abcd x id ia ib ic 2 9ul 30 in
let abcd = round2_op abcd x ic id ia ib 7 14ul 31 in
let abcd = round2_op abcd x ib ic id ia 12 20ul 32 in
abcd
[@"opaque_to_smt"]
let round2 = round2_aux
let round3_op = round_op_gen h
let round3_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round3_op abcd x ia ib ic id 5 4ul 33 in
let abcd = round3_op abcd x id ia ib ic 8 11ul 34 in
let abcd = round3_op abcd x ic id ia ib 11 16ul 35 in
let abcd = round3_op abcd x ib ic id ia 14 23ul 36 in
let abcd = round3_op abcd x ia ib ic id 1 4ul 37 in
let abcd = round3_op abcd x id ia ib ic 4 11ul 38 in
let abcd = round3_op abcd x ic id ia ib 7 16ul 39 in
let abcd = round3_op abcd x ib ic id ia 10 23ul 40 in
let abcd = round3_op abcd x ia ib ic id 13 4ul 41 in
let abcd = round3_op abcd x id ia ib ic 0 11ul 42 in
let abcd = round3_op abcd x ic id ia ib 3 16ul 43 in
let abcd = round3_op abcd x ib ic id ia 6 23ul 44 in
let abcd = round3_op abcd x ia ib ic id 9 4ul 45 in
let abcd = round3_op abcd x id ia ib ic 12 11ul 46 in
let abcd = round3_op abcd x ic id ia ib 15 16ul 47 in
let abcd = round3_op abcd x ib ic id ia 2 23ul 48 in
abcd
[@"opaque_to_smt"]
let round3 = round3_aux
let round4_op = round_op_gen i
let round4_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round4_op abcd x ia ib ic id 0 6ul 49 in
let abcd = round4_op abcd x id ia ib ic 7 10ul 50 in
let abcd = round4_op abcd x ic id ia ib 14 15ul 51 in
let abcd = round4_op abcd x ib ic id ia 5 21ul 52 in
let abcd = round4_op abcd x ia ib ic id 12 6ul 53 in
let abcd = round4_op abcd x id ia ib ic 3 10ul 54 in
let abcd = round4_op abcd x ic id ia ib 10 15ul 55 in
let abcd = round4_op abcd x ib ic id ia 1 21ul 56 in
let abcd = round4_op abcd x ia ib ic id 8 6ul 57 in
let abcd = round4_op abcd x id ia ib ic 15 10ul 58 in
let abcd = round4_op abcd x ic id ia ib 6 15ul 59 in
let abcd = round4_op abcd x ib ic id ia 13 21ul 60 in
let abcd = round4_op abcd x ia ib ic id 4 6ul 61 in
let abcd = round4_op abcd x id ia ib ic 11 10ul 62 in
let abcd = round4_op abcd x ic id ia ib 2 15ul 63 in
let abcd = round4_op abcd x ib ic id ia 9 21ul 64 in
abcd
[@"opaque_to_smt"]
let round4 = round4_aux
let rounds_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1 abcd x in
let abcd = round2 abcd x in
let abcd = round3 abcd x in
let abcd = round4 abcd x in
abcd
[@"opaque_to_smt"]
let rounds = rounds_aux | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val overwrite_aux (abcd: abcd_t) (a' b' c' d': uint32) : Tot abcd_t | [] | Spec.MD5.overwrite_aux | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
abcd: Spec.MD5.abcd_t ->
a': Lib.IntTypes.uint32 ->
b': Lib.IntTypes.uint32 ->
c': Lib.IntTypes.uint32 ->
d': Lib.IntTypes.uint32
-> Spec.MD5.abcd_t | {
"end_col": 6,
"end_line": 273,
"start_col": 70,
"start_line": 268
} |
Prims.Tot | val init_as_list:list uint32 | [
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
] | val init_as_list:list uint32
let init_as_list:list uint32 = | false | null | false | [u32 0x67452301; u32 0xefcdab89; u32 0x98badcfe; u32 0x10325476] | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Prims.Cons",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U32",
"Lib.IntTypes.SEC",
"Lib.IntTypes.u32",
"Prims.Nil"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *) | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val init_as_list:list uint32 | [] | Spec.MD5.init_as_list | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Prims.list (Lib.IntTypes.int_t Lib.IntTypes.U32 Lib.IntTypes.SEC) | {
"end_col": 1,
"end_line": 16,
"start_col": 33,
"start_line": 11
} |
Prims.Tot | val round_op_gen_aux
(f: (uint32 -> uint32 -> uint32 -> Tot uint32))
(abcd: abcd_t)
(x: x_t)
(a b c d: abcd_idx)
(k: x_idx)
(s: rotate_idx)
(i: t_idx)
: Tot abcd_t | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s)) | val round_op_gen_aux
(f: (uint32 -> uint32 -> uint32 -> Tot uint32))
(abcd: abcd_t)
(x: x_t)
(a b c d: abcd_idx)
(k: x_idx)
(s: rotate_idx)
(i: t_idx)
: Tot abcd_t
let round_op_gen_aux
(f: (uint32 -> uint32 -> uint32 -> Tot uint32))
(abcd: abcd_t)
(x: x_t)
(a b c d: abcd_idx)
(k: x_idx)
(s: rotate_idx)
(i: t_idx)
: Tot abcd_t = | false | null | false | let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s)) | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Lib.IntTypes.uint32",
"Spec.MD5.abcd_t",
"Spec.MD5.x_t",
"Spec.MD5.abcd_idx",
"Spec.MD5.x_idx",
"Spec.MD5.rotate_idx",
"Spec.MD5.t_idx",
"FStar.Seq.Base.upd",
"Lib.IntTypes.op_Plus_Dot",
"Lib.IntTypes.U32",
"Lib.IntTypes.SEC",
"Lib.IntTypes.op_Less_Less_Less_Dot",
"FStar.Seq.Base.index",
"Lib.IntTypes.int_t",
"Spec.MD5.t",
"Prims.op_Subtraction"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32 | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val round_op_gen_aux
(f: (uint32 -> uint32 -> uint32 -> Tot uint32))
(abcd: abcd_t)
(x: x_t)
(a b c d: abcd_idx)
(k: x_idx)
(s: rotate_idx)
(i: t_idx)
: Tot abcd_t | [] | Spec.MD5.round_op_gen_aux | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
f:
(_: Lib.IntTypes.uint32 -> _: Lib.IntTypes.uint32 -> _: Lib.IntTypes.uint32
-> Lib.IntTypes.uint32) ->
abcd: Spec.MD5.abcd_t ->
x: Spec.MD5.x_t ->
a: Spec.MD5.abcd_idx ->
b: Spec.MD5.abcd_idx ->
c: Spec.MD5.abcd_idx ->
d: Spec.MD5.abcd_idx ->
k: Spec.MD5.x_idx ->
s: Spec.MD5.rotate_idx ->
i: Spec.MD5.t_idx
-> Spec.MD5.abcd_t | {
"end_col": 92,
"end_line": 134,
"start_col": 165,
"start_line": 129
} |
Prims.Tot | val round3_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let round3_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round3_op abcd x ia ib ic id 5 4ul 33 in
let abcd = round3_op abcd x id ia ib ic 8 11ul 34 in
let abcd = round3_op abcd x ic id ia ib 11 16ul 35 in
let abcd = round3_op abcd x ib ic id ia 14 23ul 36 in
let abcd = round3_op abcd x ia ib ic id 1 4ul 37 in
let abcd = round3_op abcd x id ia ib ic 4 11ul 38 in
let abcd = round3_op abcd x ic id ia ib 7 16ul 39 in
let abcd = round3_op abcd x ib ic id ia 10 23ul 40 in
let abcd = round3_op abcd x ia ib ic id 13 4ul 41 in
let abcd = round3_op abcd x id ia ib ic 0 11ul 42 in
let abcd = round3_op abcd x ic id ia ib 3 16ul 43 in
let abcd = round3_op abcd x ib ic id ia 6 23ul 44 in
let abcd = round3_op abcd x ia ib ic id 9 4ul 45 in
let abcd = round3_op abcd x id ia ib ic 12 11ul 46 in
let abcd = round3_op abcd x ic id ia ib 15 16ul 47 in
let abcd = round3_op abcd x ib ic id ia 2 23ul 48 in
abcd | val round3_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t
let round3_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t = | false | null | false | let abcd = round3_op abcd x ia ib ic id 5 4ul 33 in
let abcd = round3_op abcd x id ia ib ic 8 11ul 34 in
let abcd = round3_op abcd x ic id ia ib 11 16ul 35 in
let abcd = round3_op abcd x ib ic id ia 14 23ul 36 in
let abcd = round3_op abcd x ia ib ic id 1 4ul 37 in
let abcd = round3_op abcd x id ia ib ic 4 11ul 38 in
let abcd = round3_op abcd x ic id ia ib 7 16ul 39 in
let abcd = round3_op abcd x ib ic id ia 10 23ul 40 in
let abcd = round3_op abcd x ia ib ic id 13 4ul 41 in
let abcd = round3_op abcd x id ia ib ic 0 11ul 42 in
let abcd = round3_op abcd x ic id ia ib 3 16ul 43 in
let abcd = round3_op abcd x ib ic id ia 6 23ul 44 in
let abcd = round3_op abcd x ia ib ic id 9 4ul 45 in
let abcd = round3_op abcd x id ia ib ic 12 11ul 46 in
let abcd = round3_op abcd x ic id ia ib 15 16ul 47 in
let abcd = round3_op abcd x ib ic id ia 2 23ul 48 in
abcd | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.abcd_t",
"Spec.MD5.x_t",
"Spec.MD5.round3_op",
"Spec.MD5.ib",
"Spec.MD5.ic",
"Spec.MD5.id",
"Spec.MD5.ia",
"FStar.UInt32.__uint_to_t"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd
[@"opaque_to_smt"]
let round1 = round1_aux
let round2_op = round_op_gen g
let round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round2_op abcd x ia ib ic id 1 5ul 17 in
let abcd = round2_op abcd x id ia ib ic 6 9ul 18 in
let abcd = round2_op abcd x ic id ia ib 11 14ul 19 in
let abcd = round2_op abcd x ib ic id ia 0 20ul 20 in
let abcd = round2_op abcd x ia ib ic id 5 5ul 21 in
let abcd = round2_op abcd x id ia ib ic 10 9ul 22 in
let abcd = round2_op abcd x ic id ia ib 15 14ul 23 in
let abcd = round2_op abcd x ib ic id ia 4 20ul 24 in
let abcd = round2_op abcd x ia ib ic id 9 5ul 25 in
let abcd = round2_op abcd x id ia ib ic 14 9ul 26 in
let abcd = round2_op abcd x ic id ia ib 3 14ul 27 in
let abcd = round2_op abcd x ib ic id ia 8 20ul 28 in
let abcd = round2_op abcd x ia ib ic id 13 5ul 29 in
let abcd = round2_op abcd x id ia ib ic 2 9ul 30 in
let abcd = round2_op abcd x ic id ia ib 7 14ul 31 in
let abcd = round2_op abcd x ib ic id ia 12 20ul 32 in
abcd
[@"opaque_to_smt"]
let round2 = round2_aux
let round3_op = round_op_gen h | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val round3_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t | [] | Spec.MD5.round3_aux | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | {
"end_col": 6,
"end_line": 225,
"start_col": 53,
"start_line": 204
} |
Prims.Tot | val round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round2_op abcd x ia ib ic id 1 5ul 17 in
let abcd = round2_op abcd x id ia ib ic 6 9ul 18 in
let abcd = round2_op abcd x ic id ia ib 11 14ul 19 in
let abcd = round2_op abcd x ib ic id ia 0 20ul 20 in
let abcd = round2_op abcd x ia ib ic id 5 5ul 21 in
let abcd = round2_op abcd x id ia ib ic 10 9ul 22 in
let abcd = round2_op abcd x ic id ia ib 15 14ul 23 in
let abcd = round2_op abcd x ib ic id ia 4 20ul 24 in
let abcd = round2_op abcd x ia ib ic id 9 5ul 25 in
let abcd = round2_op abcd x id ia ib ic 14 9ul 26 in
let abcd = round2_op abcd x ic id ia ib 3 14ul 27 in
let abcd = round2_op abcd x ib ic id ia 8 20ul 28 in
let abcd = round2_op abcd x ia ib ic id 13 5ul 29 in
let abcd = round2_op abcd x id ia ib ic 2 9ul 30 in
let abcd = round2_op abcd x ic id ia ib 7 14ul 31 in
let abcd = round2_op abcd x ib ic id ia 12 20ul 32 in
abcd | val round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t
let round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t = | false | null | false | let abcd = round2_op abcd x ia ib ic id 1 5ul 17 in
let abcd = round2_op abcd x id ia ib ic 6 9ul 18 in
let abcd = round2_op abcd x ic id ia ib 11 14ul 19 in
let abcd = round2_op abcd x ib ic id ia 0 20ul 20 in
let abcd = round2_op abcd x ia ib ic id 5 5ul 21 in
let abcd = round2_op abcd x id ia ib ic 10 9ul 22 in
let abcd = round2_op abcd x ic id ia ib 15 14ul 23 in
let abcd = round2_op abcd x ib ic id ia 4 20ul 24 in
let abcd = round2_op abcd x ia ib ic id 9 5ul 25 in
let abcd = round2_op abcd x id ia ib ic 14 9ul 26 in
let abcd = round2_op abcd x ic id ia ib 3 14ul 27 in
let abcd = round2_op abcd x ib ic id ia 8 20ul 28 in
let abcd = round2_op abcd x ia ib ic id 13 5ul 29 in
let abcd = round2_op abcd x id ia ib ic 2 9ul 30 in
let abcd = round2_op abcd x ic id ia ib 7 14ul 31 in
let abcd = round2_op abcd x ib ic id ia 12 20ul 32 in
abcd | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.abcd_t",
"Spec.MD5.x_t",
"Spec.MD5.round2_op",
"Spec.MD5.ib",
"Spec.MD5.ic",
"Spec.MD5.id",
"Spec.MD5.ia",
"FStar.UInt32.__uint_to_t"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd
[@"opaque_to_smt"]
let round1 = round1_aux
let round2_op = round_op_gen g | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t | [] | Spec.MD5.round2_aux | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | {
"end_col": 6,
"end_line": 197,
"start_col": 53,
"start_line": 176
} |
Prims.Tot | val round4_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let round4_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round4_op abcd x ia ib ic id 0 6ul 49 in
let abcd = round4_op abcd x id ia ib ic 7 10ul 50 in
let abcd = round4_op abcd x ic id ia ib 14 15ul 51 in
let abcd = round4_op abcd x ib ic id ia 5 21ul 52 in
let abcd = round4_op abcd x ia ib ic id 12 6ul 53 in
let abcd = round4_op abcd x id ia ib ic 3 10ul 54 in
let abcd = round4_op abcd x ic id ia ib 10 15ul 55 in
let abcd = round4_op abcd x ib ic id ia 1 21ul 56 in
let abcd = round4_op abcd x ia ib ic id 8 6ul 57 in
let abcd = round4_op abcd x id ia ib ic 15 10ul 58 in
let abcd = round4_op abcd x ic id ia ib 6 15ul 59 in
let abcd = round4_op abcd x ib ic id ia 13 21ul 60 in
let abcd = round4_op abcd x ia ib ic id 4 6ul 61 in
let abcd = round4_op abcd x id ia ib ic 11 10ul 62 in
let abcd = round4_op abcd x ic id ia ib 2 15ul 63 in
let abcd = round4_op abcd x ib ic id ia 9 21ul 64 in
abcd | val round4_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t
let round4_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t = | false | null | false | let abcd = round4_op abcd x ia ib ic id 0 6ul 49 in
let abcd = round4_op abcd x id ia ib ic 7 10ul 50 in
let abcd = round4_op abcd x ic id ia ib 14 15ul 51 in
let abcd = round4_op abcd x ib ic id ia 5 21ul 52 in
let abcd = round4_op abcd x ia ib ic id 12 6ul 53 in
let abcd = round4_op abcd x id ia ib ic 3 10ul 54 in
let abcd = round4_op abcd x ic id ia ib 10 15ul 55 in
let abcd = round4_op abcd x ib ic id ia 1 21ul 56 in
let abcd = round4_op abcd x ia ib ic id 8 6ul 57 in
let abcd = round4_op abcd x id ia ib ic 15 10ul 58 in
let abcd = round4_op abcd x ic id ia ib 6 15ul 59 in
let abcd = round4_op abcd x ib ic id ia 13 21ul 60 in
let abcd = round4_op abcd x ia ib ic id 4 6ul 61 in
let abcd = round4_op abcd x id ia ib ic 11 10ul 62 in
let abcd = round4_op abcd x ic id ia ib 2 15ul 63 in
let abcd = round4_op abcd x ib ic id ia 9 21ul 64 in
abcd | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.abcd_t",
"Spec.MD5.x_t",
"Spec.MD5.round4_op",
"Spec.MD5.ib",
"Spec.MD5.ic",
"Spec.MD5.id",
"Spec.MD5.ia",
"FStar.UInt32.__uint_to_t"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd
[@"opaque_to_smt"]
let round1 = round1_aux
let round2_op = round_op_gen g
let round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round2_op abcd x ia ib ic id 1 5ul 17 in
let abcd = round2_op abcd x id ia ib ic 6 9ul 18 in
let abcd = round2_op abcd x ic id ia ib 11 14ul 19 in
let abcd = round2_op abcd x ib ic id ia 0 20ul 20 in
let abcd = round2_op abcd x ia ib ic id 5 5ul 21 in
let abcd = round2_op abcd x id ia ib ic 10 9ul 22 in
let abcd = round2_op abcd x ic id ia ib 15 14ul 23 in
let abcd = round2_op abcd x ib ic id ia 4 20ul 24 in
let abcd = round2_op abcd x ia ib ic id 9 5ul 25 in
let abcd = round2_op abcd x id ia ib ic 14 9ul 26 in
let abcd = round2_op abcd x ic id ia ib 3 14ul 27 in
let abcd = round2_op abcd x ib ic id ia 8 20ul 28 in
let abcd = round2_op abcd x ia ib ic id 13 5ul 29 in
let abcd = round2_op abcd x id ia ib ic 2 9ul 30 in
let abcd = round2_op abcd x ic id ia ib 7 14ul 31 in
let abcd = round2_op abcd x ib ic id ia 12 20ul 32 in
abcd
[@"opaque_to_smt"]
let round2 = round2_aux
let round3_op = round_op_gen h
let round3_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round3_op abcd x ia ib ic id 5 4ul 33 in
let abcd = round3_op abcd x id ia ib ic 8 11ul 34 in
let abcd = round3_op abcd x ic id ia ib 11 16ul 35 in
let abcd = round3_op abcd x ib ic id ia 14 23ul 36 in
let abcd = round3_op abcd x ia ib ic id 1 4ul 37 in
let abcd = round3_op abcd x id ia ib ic 4 11ul 38 in
let abcd = round3_op abcd x ic id ia ib 7 16ul 39 in
let abcd = round3_op abcd x ib ic id ia 10 23ul 40 in
let abcd = round3_op abcd x ia ib ic id 13 4ul 41 in
let abcd = round3_op abcd x id ia ib ic 0 11ul 42 in
let abcd = round3_op abcd x ic id ia ib 3 16ul 43 in
let abcd = round3_op abcd x ib ic id ia 6 23ul 44 in
let abcd = round3_op abcd x ia ib ic id 9 4ul 45 in
let abcd = round3_op abcd x id ia ib ic 12 11ul 46 in
let abcd = round3_op abcd x ic id ia ib 15 16ul 47 in
let abcd = round3_op abcd x ib ic id ia 2 23ul 48 in
abcd
[@"opaque_to_smt"]
let round3 = round3_aux
let round4_op = round_op_gen i | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val round4_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t | [] | Spec.MD5.round4_aux | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | {
"end_col": 6,
"end_line": 253,
"start_col": 53,
"start_line": 232
} |
Prims.Tot | val update: update_t MD5 | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let update = update_aux | val update: update_t MD5
let update = | false | null | false | update_aux | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.update_aux"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd
[@"opaque_to_smt"]
let round1 = round1_aux
let round2_op = round_op_gen g
let round2_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round2_op abcd x ia ib ic id 1 5ul 17 in
let abcd = round2_op abcd x id ia ib ic 6 9ul 18 in
let abcd = round2_op abcd x ic id ia ib 11 14ul 19 in
let abcd = round2_op abcd x ib ic id ia 0 20ul 20 in
let abcd = round2_op abcd x ia ib ic id 5 5ul 21 in
let abcd = round2_op abcd x id ia ib ic 10 9ul 22 in
let abcd = round2_op abcd x ic id ia ib 15 14ul 23 in
let abcd = round2_op abcd x ib ic id ia 4 20ul 24 in
let abcd = round2_op abcd x ia ib ic id 9 5ul 25 in
let abcd = round2_op abcd x id ia ib ic 14 9ul 26 in
let abcd = round2_op abcd x ic id ia ib 3 14ul 27 in
let abcd = round2_op abcd x ib ic id ia 8 20ul 28 in
let abcd = round2_op abcd x ia ib ic id 13 5ul 29 in
let abcd = round2_op abcd x id ia ib ic 2 9ul 30 in
let abcd = round2_op abcd x ic id ia ib 7 14ul 31 in
let abcd = round2_op abcd x ib ic id ia 12 20ul 32 in
abcd
[@"opaque_to_smt"]
let round2 = round2_aux
let round3_op = round_op_gen h
let round3_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round3_op abcd x ia ib ic id 5 4ul 33 in
let abcd = round3_op abcd x id ia ib ic 8 11ul 34 in
let abcd = round3_op abcd x ic id ia ib 11 16ul 35 in
let abcd = round3_op abcd x ib ic id ia 14 23ul 36 in
let abcd = round3_op abcd x ia ib ic id 1 4ul 37 in
let abcd = round3_op abcd x id ia ib ic 4 11ul 38 in
let abcd = round3_op abcd x ic id ia ib 7 16ul 39 in
let abcd = round3_op abcd x ib ic id ia 10 23ul 40 in
let abcd = round3_op abcd x ia ib ic id 13 4ul 41 in
let abcd = round3_op abcd x id ia ib ic 0 11ul 42 in
let abcd = round3_op abcd x ic id ia ib 3 16ul 43 in
let abcd = round3_op abcd x ib ic id ia 6 23ul 44 in
let abcd = round3_op abcd x ia ib ic id 9 4ul 45 in
let abcd = round3_op abcd x id ia ib ic 12 11ul 46 in
let abcd = round3_op abcd x ic id ia ib 15 16ul 47 in
let abcd = round3_op abcd x ib ic id ia 2 23ul 48 in
abcd
[@"opaque_to_smt"]
let round3 = round3_aux
let round4_op = round_op_gen i
let round4_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round4_op abcd x ia ib ic id 0 6ul 49 in
let abcd = round4_op abcd x id ia ib ic 7 10ul 50 in
let abcd = round4_op abcd x ic id ia ib 14 15ul 51 in
let abcd = round4_op abcd x ib ic id ia 5 21ul 52 in
let abcd = round4_op abcd x ia ib ic id 12 6ul 53 in
let abcd = round4_op abcd x id ia ib ic 3 10ul 54 in
let abcd = round4_op abcd x ic id ia ib 10 15ul 55 in
let abcd = round4_op abcd x ib ic id ia 1 21ul 56 in
let abcd = round4_op abcd x ia ib ic id 8 6ul 57 in
let abcd = round4_op abcd x id ia ib ic 15 10ul 58 in
let abcd = round4_op abcd x ic id ia ib 6 15ul 59 in
let abcd = round4_op abcd x ib ic id ia 13 21ul 60 in
let abcd = round4_op abcd x ia ib ic id 4 6ul 61 in
let abcd = round4_op abcd x id ia ib ic 11 10ul 62 in
let abcd = round4_op abcd x ic id ia ib 2 15ul 63 in
let abcd = round4_op abcd x ib ic id ia 9 21ul 64 in
abcd
[@"opaque_to_smt"]
let round4 = round4_aux
let rounds_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1 abcd x in
let abcd = round2 abcd x in
let abcd = round3 abcd x in
let abcd = round4 abcd x in
abcd
[@"opaque_to_smt"]
let rounds = rounds_aux
let overwrite_aux (abcd: abcd_t) (a' b' c' d' : uint32) : Tot abcd_t =
let abcd : abcd_t = Seq.upd abcd ia a' in
let abcd : abcd_t = Seq.upd abcd ib b' in
let abcd : abcd_t = Seq.upd abcd ic c' in
let abcd : abcd_t = Seq.upd abcd id d' in
abcd
[@"opaque_to_smt"]
let overwrite = overwrite_aux
let update_aux (abcd:words_state MD5) x : Tot (words_state MD5) =
let x = words_of_bytes MD5 #16 x in
let aa = Seq.index abcd ia in
let bb = Seq.index abcd ib in
let cc = Seq.index abcd ic in
let dd = Seq.index abcd id in
// let aabbccdd = abcd in
let abcd = rounds abcd x in
overwrite abcd
(Seq.index abcd ia +. aa)
(Seq.index abcd ib +. bb)
(Seq.index abcd ic +. cc)
(Seq.index abcd id +. dd) | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val update: update_t MD5 | [] | Spec.MD5.update | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Spec.Hash.Definitions.update_t Spec.Hash.Definitions.MD5 | {
"end_col": 23,
"end_line": 293,
"start_col": 13,
"start_line": 293
} |
Prims.Tot | val round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t =
let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd | val round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t
let round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t = | false | null | false | let abcd = round1_op abcd x ia ib ic id 0 7ul 1 in
let abcd = round1_op abcd x id ia ib ic 1 12ul 2 in
let abcd = round1_op abcd x ic id ia ib 2 17ul 3 in
let abcd = round1_op abcd x ib ic id ia 3 22ul 4 in
let abcd = round1_op abcd x ia ib ic id 4 7ul 5 in
let abcd = round1_op abcd x id ia ib ic 5 12ul 6 in
let abcd = round1_op abcd x ic id ia ib 6 17ul 7 in
let abcd = round1_op abcd x ib ic id ia 7 22ul 8 in
let abcd = round1_op abcd x ia ib ic id 8 7ul 9 in
let abcd = round1_op abcd x id ia ib ic 9 12ul 10 in
let abcd = round1_op abcd x ic id ia ib 10 17ul 11 in
let abcd = round1_op abcd x ib ic id ia 11 22ul 12 in
let abcd = round1_op abcd x ia ib ic id 12 7ul 13 in
let abcd = round1_op abcd x id ia ib ic 13 12ul 14 in
let abcd = round1_op abcd x ic id ia ib 14 17ul 15 in
let abcd = round1_op abcd x ib ic id ia 15 22ul 16 in
abcd | {
"checked_file": "Spec.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "Spec.MD5.fst"
} | [
"total"
] | [
"Spec.MD5.abcd_t",
"Spec.MD5.x_t",
"Spec.MD5.round1_op",
"Spec.MD5.ib",
"Spec.MD5.ic",
"Spec.MD5.id",
"Spec.MD5.ia",
"FStar.UInt32.__uint_to_t"
] | [] | module Spec.MD5
(* Source: https://tools.ietf.org/html/rfc1321 *)
open Lib.IntTypes
open Spec.Hash.Definitions
(* Section 3.3 *)
inline_for_extraction
let init_as_list : list uint32 = [
u32 0x67452301;
u32 0xefcdab89;
u32 0x98badcfe;
u32 0x10325476;
]
let init : words_state MD5 = Seq.seq_of_list init_as_list
(* Section 3.4 *)
inline_for_extraction
let f (x y z: uint32) : Tot uint32 =
(x &. y) |. ((~. x) &. z)
inline_for_extraction
let g (x y z: uint32) : Tot uint32 =
(x &. z) |. (y &. (~. z))
inline_for_extraction
let h (x y z: uint32) : Tot uint32 =
x ^. y ^. z
inline_for_extraction
let i (x y z: uint32) : Tot uint32 =
y ^. (x |. ~. z)
(* Table T: specified in 3.4, defined in Appendix A.3, function MD5Transform *)
inline_for_extraction
let t_as_list : list uint32 = [
u32 0xd76aa478;
u32 0xe8c7b756;
u32 0x242070db;
u32 0xc1bdceee;
u32 0xf57c0faf;
u32 0x4787c62a;
u32 0xa8304613;
u32 0xfd469501;
u32 0x698098d8;
u32 0x8b44f7af;
u32 0xffff5bb1;
u32 0x895cd7be;
u32 0x6b901122;
u32 0xfd987193;
u32 0xa679438e;
u32 0x49b40821;
u32 0xf61e2562;
u32 0xc040b340;
u32 0x265e5a51;
u32 0xe9b6c7aa;
u32 0xd62f105d;
u32 0x02441453;
u32 0xd8a1e681;
u32 0xe7d3fbc8;
u32 0x21e1cde6;
u32 0xc33707d6;
u32 0xf4d50d87;
u32 0x455a14ed;
u32 0xa9e3e905;
u32 0xfcefa3f8;
u32 0x676f02d9;
u32 0x8d2a4c8a;
u32 0xfffa3942;
u32 0x8771f681;
u32 0x6d9d6122;
u32 0xfde5380c;
u32 0xa4beea44;
u32 0x4bdecfa9;
u32 0xf6bb4b60;
u32 0xbebfbc70;
u32 0x289b7ec6;
u32 0xeaa127fa;
u32 0xd4ef3085;
u32 0x4881d05;
u32 0xd9d4d039;
u32 0xe6db99e5;
u32 0x1fa27cf8;
u32 0xc4ac5665;
u32 0xf4292244;
u32 0x432aff97;
u32 0xab9423a7;
u32 0xfc93a039;
u32 0x655b59c3;
u32 0x8f0ccc92;
u32 0xffeff47d;
u32 0x85845dd1;
u32 0x6fa87e4f;
u32 0xfe2ce6e0;
u32 0xa3014314;
u32 0x4e0811a1;
u32 0xf7537e82;
u32 0xbd3af235;
u32 0x2ad7d2bb;
u32 0xeb86d391;
]
module L = FStar.List.Tot
let t : Seq.lseq uint32 64 =
assert_norm (L.length t_as_list == 64);
Seq.seq_of_list t_as_list
let abcd_idx = (n: nat { n < 4 } )
let abcd_t = Seq.lseq uint32 4
let x_idx = (n: nat { n < 16 } )
let x_t = Seq.lseq uint32 16
let t_idx = (n: nat { 1 <= n /\ n <= 64 } )
inline_for_extraction
let rotate_idx = rotval U32
let round_op_gen_aux (f: (uint32 -> uint32 -> uint32 -> Tot uint32)) (abcd: abcd_t) (x: x_t) (a b c d: abcd_idx) (k: x_idx) (s: rotate_idx) (i: t_idx) : Tot abcd_t =
let va = Seq.index abcd a in
let vb = Seq.index abcd b in
let vc = Seq.index abcd c in
let vd = Seq.index abcd d in
Seq.upd abcd a (vb +. ((va +. f vb vc vd +. Seq.index x k +. Seq.index t (i - 1)) <<<. s))
[@"opaque_to_smt"]
let round_op_gen = round_op_gen_aux
(* Round 1 *)
let round1_op = round_op_gen f
let ia : abcd_idx = 0
let ib : abcd_idx = 1
let ic : abcd_idx = 2
let id : abcd_idx = 3 | false | true | Spec.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val round1_aux (abcd: abcd_t) (x: x_t) : Tot abcd_t | [] | Spec.MD5.round1_aux | {
"file_name": "specs/Spec.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | abcd: Spec.MD5.abcd_t -> x: Spec.MD5.x_t -> Spec.MD5.abcd_t | {
"end_col": 6,
"end_line": 169,
"start_col": 53,
"start_line": 148
} |