file_name
stringlengths 5
52
| name
stringlengths 4
95
| original_source_type
stringlengths 0
23k
| source_type
stringlengths 9
23k
| source_definition
stringlengths 9
57.9k
| source
dict | source_range
dict | file_context
stringlengths 0
721k
| dependencies
dict | opens_and_abbrevs
listlengths 2
94
| vconfig
dict | interleaved
bool 1
class | verbose_type
stringlengths 1
7.42k
| effect
stringclasses 118
values | effect_flags
sequencelengths 0
2
| mutual_with
sequencelengths 0
11
| ideal_premises
sequencelengths 0
236
| proof_features
sequencelengths 0
1
| is_simple_lemma
bool 2
classes | is_div
bool 2
classes | is_proof
bool 2
classes | is_simply_typed
bool 2
classes | is_type
bool 2
classes | partial_definition
stringlengths 5
3.99k
| completed_definiton
stringlengths 1
1.63M
| isa_cross_project_example
bool 1
class |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Spec.FFDHE.fst | Spec.FFDHE.get_ffdhe_params | val get_ffdhe_params (a: ffdhe_alg) : ffdhe_params_t | val get_ffdhe_params (a: ffdhe_alg) : ffdhe_params_t | let get_ffdhe_params (a:ffdhe_alg) : ffdhe_params_t =
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> ffdhe_params_2048
| FFDHE3072 -> ffdhe_params_3072
| FFDHE4096 -> ffdhe_params_4096
| FFDHE6144 -> ffdhe_params_6144
| FFDHE8192 -> ffdhe_params_8192 | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 34,
"end_line": 496,
"start_col": 0,
"start_line": 489
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy; 0x57uy; 0xC9uy; 0x35uy;
0x98uy; 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; 0x83uy; 0xB2uy;
0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p3072: List.Tot.llist pub_uint8 384 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6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1Duy; 0xBFuy; 0x9Auy; 0x42uy; 0xD5uy; 0xC4uy; 0x48uy; 0x4Euy;
0x0Auy; 0xBCuy; 0xD0uy; 0x6Buy; 0xFAuy; 0x53uy; 0xDDuy; 0xEFuy;
0x3Cuy; 0x1Buy; 0x20uy; 0xEEuy; 0x3Fuy; 0xD5uy; 0x9Duy; 0x7Cuy;
0x25uy; 0xE4uy; 0x1Duy; 0x2Buy; 0x66uy; 0xC6uy; 0x2Euy; 0x37uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 384);
l
let ffdhe_p3072: lseq pub_uint8 384 = of_list list_ffdhe_p3072
// The estimated symmetric-equivalent strength of this group is 125 bits.
let ffdhe_params_3072 : ffdhe_params_t =
Mk_ffdhe_params 384 ffdhe_p3072 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p4096: List.Tot.llist pub_uint8 512 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0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cuy;
0x2Auy; 0x4Euy; 0xCEuy; 0xA9uy; 0xF9uy; 0x8Duy; 0x0Auy; 0xCCuy;
0x0Auy; 0x82uy; 0x91uy; 0xCDuy; 0xCEuy; 0xC9uy; 0x7Duy; 0xCFuy;
0x8Euy; 0xC9uy; 0xB5uy; 0x5Auy; 0x7Fuy; 0x88uy; 0xA4uy; 0x6Buy;
0x4Duy; 0xB5uy; 0xA8uy; 0x51uy; 0xF4uy; 0x41uy; 0x82uy; 0xE1uy;
0xC6uy; 0x8Auy; 0x00uy; 0x7Euy; 0x5Euy; 0x65uy; 0x5Fuy; 0x6Auy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 512);
l
let ffdhe_p4096: lseq pub_uint8 512 = of_list list_ffdhe_p4096
// The estimated symmetric-equivalent strength of this group is 150 bits.
let ffdhe_params_4096 : ffdhe_params_t =
Mk_ffdhe_params 512 ffdhe_p4096 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p6144: List.Tot.llist pub_uint8 768 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0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0x5Buy; 0x3Buy; 0x71uy; 0xF9uy; 0xDCuy; 0x6Buy; 0x80uy; 0xD6uy;
0x3Fuy; 0xDDuy; 0x4Auy; 0x8Euy; 0x9Auy; 0xDBuy; 0x1Euy; 0x69uy;
0x62uy; 0xA6uy; 0x95uy; 0x26uy; 0xD4uy; 0x31uy; 0x61uy; 0xC1uy;
0xA4uy; 0x1Duy; 0x57uy; 0x0Duy; 0x79uy; 0x38uy; 0xDAuy; 0xD4uy;
0xA4uy; 0x0Euy; 0x32uy; 0x9Cuy; 0xD0uy; 0xE4uy; 0x0Euy; 0x65uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 768);
l
let ffdhe_p6144: lseq pub_uint8 768 = of_list list_ffdhe_p6144
// The estimated symmetric-equivalent strength of this group is 175 bits.
let ffdhe_params_6144 : ffdhe_params_t =
Mk_ffdhe_params 768 ffdhe_p6144 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p8192: List.Tot.llist pub_uint8 1024 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0x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1Duy; 0x49uy; 0xF7uy; 0xA8uy; 0x44uy; 0x3Duy;
0x08uy; 0x22uy; 0xE5uy; 0x06uy; 0xA9uy; 0xF4uy; 0x61uy; 0x4Euy;
0x01uy; 0x1Euy; 0x2Auy; 0x94uy; 0x83uy; 0x8Fuy; 0xF8uy; 0x8Cuy;
0xD6uy; 0x8Cuy; 0x8Buy; 0xB7uy; 0xC5uy; 0xC6uy; 0x42uy; 0x4Cuy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 1024);
l
let ffdhe_p8192: lseq pub_uint8 1024 = of_list list_ffdhe_p8192
// The estimated symmetric-equivalent strength of this group is 192 bits.
let ffdhe_params_8192 : ffdhe_params_t =
Mk_ffdhe_params 1024 ffdhe_p8192 1 ffdhe_g2
type ffdhe_alg =
| FFDHE2048
| FFDHE3072
| FFDHE4096
| FFDHE6144
| FFDHE8192 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Spec.FFDHE.ffdhe_alg -> Spec.FFDHE.ffdhe_params_t | Prims.Tot | [
"total"
] | [] | [
"Spec.FFDHE.ffdhe_alg",
"Spec.FFDHE.ffdhe_params_2048",
"Spec.FFDHE.ffdhe_params_3072",
"Spec.FFDHE.ffdhe_params_4096",
"Spec.FFDHE.ffdhe_params_6144",
"Spec.FFDHE.ffdhe_params_8192",
"Spec.FFDHE.ffdhe_params_t",
"Prims.unit",
"FStar.Pervasives.allow_inversion"
] | [] | false | false | false | true | false | let get_ffdhe_params (a: ffdhe_alg) : ffdhe_params_t =
| allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> ffdhe_params_2048
| FFDHE3072 -> ffdhe_params_3072
| FFDHE4096 -> ffdhe_params_4096
| FFDHE6144 -> ffdhe_params_6144
| FFDHE8192 -> ffdhe_params_8192 | false |
Spec.FFDHE.fst | Spec.FFDHE.ffdhe_params_3072 | val ffdhe_params_3072:ffdhe_params_t | val ffdhe_params_3072:ffdhe_params_t | let ffdhe_params_3072 : ffdhe_params_t =
Mk_ffdhe_params 384 ffdhe_p3072 1 ffdhe_g2 | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 44,
"end_line": 142,
"start_col": 0,
"start_line": 141
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3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y; 0x83uy; 0xFFuy;
0x8Euy; 0x4Fuy; 0x12uy; 0x32uy; 0xEEuy; 0xF2uy; 0x81uy; 0x83uy;
0xC3uy; 0xFEuy; 0x3Buy; 0x1Buy; 0x4Cuy; 0x6Fuy; 0xADuy; 0x73uy;
0x3Buy; 0xB5uy; 0xFCuy; 0xBCuy; 0x2Euy; 0xC2uy; 0x20uy; 0x05uy;
0xC5uy; 0x8Euy; 0xF1uy; 0x83uy; 0x7Duy; 0x16uy; 0x83uy; 0xB2uy;
0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p3072: List.Tot.llist pub_uint8 384 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3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64uy; 0xF2uy; 0xE2uy; 0x1Euy; 0x71uy; 0xF5uy; 0x4Buy; 0xFFuy;
0x5Cuy; 0xAEuy; 0x82uy; 0xABuy; 0x9Cuy; 0x9Duy; 0xF6uy; 0x9Euy;
0xE8uy; 0x6Duy; 0x2Buy; 0xC5uy; 0x22uy; 0x36uy; 0x3Auy; 0x0Duy;
0xABuy; 0xC5uy; 0x21uy; 0x97uy; 0x9Buy; 0x0Duy; 0xEAuy; 0xDAuy;
0x1Duy; 0xBFuy; 0x9Auy; 0x42uy; 0xD5uy; 0xC4uy; 0x48uy; 0x4Euy;
0x0Auy; 0xBCuy; 0xD0uy; 0x6Buy; 0xFAuy; 0x53uy; 0xDDuy; 0xEFuy;
0x3Cuy; 0x1Buy; 0x20uy; 0xEEuy; 0x3Fuy; 0xD5uy; 0x9Duy; 0x7Cuy;
0x25uy; 0xE4uy; 0x1Duy; 0x2Buy; 0x66uy; 0xC6uy; 0x2Euy; 0x37uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 384);
l
let ffdhe_p3072: lseq pub_uint8 384 = of_list list_ffdhe_p3072 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Spec.FFDHE.ffdhe_params_t | Prims.Tot | [
"total"
] | [] | [
"Spec.FFDHE.Mk_ffdhe_params",
"Spec.FFDHE.ffdhe_p3072",
"Spec.FFDHE.ffdhe_g2"
] | [] | false | false | false | true | false | let ffdhe_params_3072:ffdhe_params_t =
| Mk_ffdhe_params 384 ffdhe_p3072 1 ffdhe_g2 | false |
LowParse.Low.ConstInt32.fst | LowParse.Low.ConstInt32.inplace_compare | val inplace_compare
(v: U32.t{0 <= U32.v v /\ U32.v v < 4294967296})
(#rrel #rel: _)
(input: slice rrel rel)
(pos: U32.t)
: HST.Stack bool
(requires (fun h -> valid parse_int32le h input pos))
(ensures
(fun h res h' ->
B.modifies B.loc_none h h' /\ res == (U32.eq (contents parse_int32le h input pos) v))) | val inplace_compare
(v: U32.t{0 <= U32.v v /\ U32.v v < 4294967296})
(#rrel #rel: _)
(input: slice rrel rel)
(pos: U32.t)
: HST.Stack bool
(requires (fun h -> valid parse_int32le h input pos))
(ensures
(fun h res h' ->
B.modifies B.loc_none h h' /\ res == (U32.eq (contents parse_int32le h input pos) v))) | let inplace_compare
(v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
(#rrel: _)
(#rel: _)
(input: slice rrel rel)
(pos: U32.t)
: HST.Stack bool
(requires (fun h -> valid parse_int32le h input pos))
(ensures (fun h res h' ->
B.modifies B.loc_none h h' /\
res == (U32.eq (contents parse_int32le h input pos) v)))
= let h = HST.get () in
let b = input.base in
[@inline_let] let _ =
decode_int32le_eq (Seq.slice (B.as_seq h b) (U32.v pos) (U32.v pos + 4));
decode_int32le_total_constant ();
valid_facts parse_int32le h input pos;
[@inline_let] let v' = contents parse_int32le h input pos in
decompose_compose_equiv (U32.v v);
decompose_compose_equiv (U32.v v');
decompose_compare (U32.v v) (U32.v v')
in
let r0 = B.index b pos in
let r1 = B.index b (pos `U32.add` 1ul) in
let r2 = B.index b (pos `U32.add` 2ul) in
let r3 = B.index b (pos `U32.add` 3ul) in
[@inline_let] let b0 = U8.uint_to_t (decompose_int32le_0 (U32.v v)) in
[@inline_let] let b1 = U8.uint_to_t (decompose_int32le_1 (U32.v v)) in
[@inline_let] let b2 = U8.uint_to_t (decompose_int32le_2 (U32.v v)) in
[@inline_let] let b3 = U8.uint_to_t (decompose_int32le_3 (U32.v v)) in
compare_by_bytes r0 r1 r2 r3 b0 b1 b2 b3 | {
"file_name": "src/lowparse/LowParse.Low.ConstInt32.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 42,
"end_line": 209,
"start_col": 0,
"start_line": 179
} | module LowParse.Low.ConstInt32
(* LowParse implementation module for 32 bits contants *)
include FStar.Endianness
include LowParse.Spec.ConstInt32
include LowParse.Spec.Int32le
include LowParse.Low.Combinators
include LowParse.Low.Int32le
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module B = LowStar.Buffer
module Cast = FStar.Int.Cast
module U64 = FStar.UInt64
let valid_constint32le
(v: nat { 0 <= v /\ v < 4294967296 } )
(h: HS.mem)
(#rrel #rel: _)
(input: slice rrel rel)
(pos: U32.t)
: Lemma (valid (parse_constint32le v) h input pos
<==>
(valid parse_int32le h input pos /\
U32.v (contents parse_int32le h input pos) == v))
= valid_facts (parse_constint32le v) h input pos;
valid_facts parse_int32le h input pos;
parse_constint32le_unfold v (bytes_of_slice_from h input pos)
inline_for_extraction
let validate_constint32le_slow
(v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
: Tot (validator (parse_constint32le (U32.v v)))
= fun #rrel #rel (input: slice rrel rel) pos ->
let h = HST.get() in
let _ =
valid_constint32le (U32.v v) h input (uint64_to_uint32 pos);
valid_equiv parse_int32le h input (uint64_to_uint32 pos)
in
if U64.lt (Cast.uint32_to_uint64 input.len `U64.sub` pos) 4uL
then
validator_error_not_enough_data
else
let v' = read_int32le input (uint64_to_uint32 pos) in
if U32.eq v v' then
pos `U64.add` 4uL
else
validator_error_generic
inline_for_extraction
let read_constint32le
(v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
: Tot (leaf_reader (parse_constint32le (U32.v v)))
= fun #rrel #rel input pos ->
v
inline_for_extraction
let decompose_int32le_0
(v: nat { 0 <= v /\ v < 4294967296 } )
: Tot (b0: nat { 0 <= b0 /\ b0 < 256 } )
= v % 256
inline_for_extraction
let decompose_int32le_1
(v: nat { 0 <= v /\ v < 4294967296 } )
: Tot (b1: nat { 0 <= b1 /\ b1 < 256 } )
= v / 256 % 256
inline_for_extraction
let decompose_int32le_2
(v: nat { 0 <= v /\ v < 4294967296 } )
: Tot (b2: nat { 0 <= b2 /\ b2 < 256 } )
= v / 65536 % 256
inline_for_extraction
let decompose_int32le_3
(v: nat { 0 <= v /\ v < 4294967296 } )
: Tot (b3: nat { 0 <= b3 /\ b3 < 256 } )
= v / 16777216
let compose_int32le
(b0: nat { 0 <= b0 /\ b0 < 256 } )
(b1: nat { 0 <= b1 /\ b1 < 256 } )
(b2: nat { 0 <= b2 /\ b2 < 256 } )
(b3: nat { 0 <= b3 /\ b3 < 256 } )
: Tot (v: nat { 0 <= v /\ v < 4294967296 } )
= b0
+ 256 `FStar.Mul.op_Star` (b1
+ 256 `FStar.Mul.op_Star` (b2
+ 256 `FStar.Mul.op_Star` b3))
#push-options "--z3rlimit 16"
let decompose_compose_equiv
(v: nat { 0 <= v /\ v < 4294967296 } )
: Lemma (compose_int32le (decompose_int32le_0 v) (decompose_int32le_1 v) (decompose_int32le_2 v) (decompose_int32le_3 v) == v)
= ()
#pop-options
inline_for_extraction
let compare_by_bytes
(a0: U8.t { 0 <= U8.v a0 /\ U8.v a0 < 256 } )
(a1: U8.t { 0 <= U8.v a1 /\ U8.v a1 < 256 } )
(a2: U8.t { 0 <= U8.v a2 /\ U8.v a2 < 256 } )
(a3: U8.t { 0 <= U8.v a3 /\ U8.v a3 < 256 } )
(b0: U8.t { 0 <= U8.v b0 /\ U8.v b0 < 256 } )
(b1: U8.t { 0 <= U8.v b1 /\ U8.v b1 < 256 } )
(b2: U8.t { 0 <= U8.v b2 /\ U8.v b2 < 256 } )
(b3: U8.t { 0 <= U8.v b3 /\ U8.v b3 < 256 } )
= a0 = b0 && a1 = b1 && a2 = b2 && a3 = b3
let compare_by_bytes'
(a0: U8.t { 0 <= U8.v a0 /\ U8.v a0 < 256 } )
(a1: U8.t { 0 <= U8.v a1 /\ U8.v a1 < 256 } )
(a2: U8.t { 0 <= U8.v a2 /\ U8.v a2 < 256 } )
(a3: U8.t { 0 <= U8.v a3 /\ U8.v a3 < 256 } )
(b0: U8.t { 0 <= U8.v b0 /\ U8.v b0 < 256 } )
(b1: U8.t { 0 <= U8.v b1 /\ U8.v b1 < 256 } )
(b2: U8.t { 0 <= U8.v b2 /\ U8.v b2 < 256 } )
(b3: U8.t { 0 <= U8.v b3 /\ U8.v b3 < 256 } )
= (compose_int32le (U8.v a0) (U8.v a1) (U8.v a2) (U8.v a3)) =
(compose_int32le (U8.v b0) (U8.v b1) (U8.v b2) (U8.v b3))
#push-options "--max_fuel 5 --z3rlimit 64"
let compare_by_bytes_equiv
(a0: U8.t { 0 <= U8.v a0 /\ U8.v a0 < 256 } )
(a1: U8.t { 0 <= U8.v a1 /\ U8.v a1 < 256 } )
(a2: U8.t { 0 <= U8.v a2 /\ U8.v a2 < 256 } )
(a3: U8.t { 0 <= U8.v a3 /\ U8.v a3 < 256 } )
(b0: U8.t { 0 <= U8.v b0 /\ U8.v b0 < 256 } )
(b1: U8.t { 0 <= U8.v b1 /\ U8.v b1 < 256 } )
(b2: U8.t { 0 <= U8.v b2 /\ U8.v b2 < 256 } )
(b3: U8.t { 0 <= U8.v b3 /\ U8.v b3 < 256 } )
: Lemma
((compare_by_bytes a0 a1 a2 a3 b0 b1 b2 b3) ==
compare_by_bytes' a0 a1 a2 a3 b0 b1 b2 b3)
= let a = compose_int32le (U8.v a0) (U8.v a1) (U8.v a2) (U8.v a3) in
let b = compose_int32le (U8.v b0) (U8.v b1) (U8.v b2) (U8.v b3) in
decompose_compose_equiv a;
decompose_compose_equiv b
#pop-options
let decompose_compare
(v1 : nat { 0 <= v1 /\ v1 < 4294967296 } )
(v2 : nat { 0 <= v2 /\ v2 < 4294967296 } )
: Lemma ( (v1 = v2)
== (compare_by_bytes
(U8.uint_to_t (decompose_int32le_0 v1))
(U8.uint_to_t (decompose_int32le_1 v1))
(U8.uint_to_t (decompose_int32le_2 v1))
(U8.uint_to_t (decompose_int32le_3 v1))
(U8.uint_to_t (decompose_int32le_0 v2))
(U8.uint_to_t (decompose_int32le_1 v2))
(U8.uint_to_t (decompose_int32le_2 v2))
(U8.uint_to_t (decompose_int32le_3 v2))))
= let a0 = U8.uint_to_t (decompose_int32le_0 v1) in
let a1 = U8.uint_to_t (decompose_int32le_1 v1) in
let a2 = U8.uint_to_t (decompose_int32le_2 v1) in
let a3 = U8.uint_to_t (decompose_int32le_3 v1) in
let b0 = U8.uint_to_t (decompose_int32le_0 v2) in
let b1 = U8.uint_to_t (decompose_int32le_1 v2) in
let b2 = U8.uint_to_t (decompose_int32le_2 v2) in
let b3 = U8.uint_to_t (decompose_int32le_3 v2) in
compare_by_bytes_equiv a0 a1 a2 a3 b0 b1 b2 b3;
decompose_compose_equiv v1;
decompose_compose_equiv v2
#push-options " --max_fuel 6 --z3rlimit 64 " | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.Int32le.fst.checked",
"LowParse.Spec.ConstInt32.fst.checked",
"LowParse.Low.Int32le.fst.checked",
"LowParse.Low.Combinators.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Endianness.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.ConstInt32.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Int32le",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Int32le",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.ConstInt32",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Endianness",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 6,
"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": 64,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
v: FStar.UInt32.t{0 <= FStar.UInt32.v v /\ FStar.UInt32.v v < 4294967296} ->
input: LowParse.Slice.slice rrel rel ->
pos: FStar.UInt32.t
-> FStar.HyperStack.ST.Stack Prims.bool | FStar.HyperStack.ST.Stack | [] | [] | [
"FStar.UInt32.t",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.UInt32.v",
"Prims.op_LessThan",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"LowParse.Low.ConstInt32.compare_by_bytes",
"FStar.UInt8.t",
"FStar.UInt8.uint_to_t",
"LowParse.Low.ConstInt32.decompose_int32le_3",
"LowParse.Low.ConstInt32.decompose_int32le_2",
"LowParse.Low.ConstInt32.decompose_int32le_1",
"LowParse.Low.ConstInt32.decompose_int32le_0",
"Prims.bool",
"LowStar.Monotonic.Buffer.index",
"LowParse.Slice.buffer_srel_of_srel",
"FStar.UInt32.add",
"FStar.UInt32.__uint_to_t",
"Prims.unit",
"LowParse.Low.ConstInt32.decompose_compare",
"LowParse.Low.ConstInt32.decompose_compose_equiv",
"LowParse.Low.Base.Spec.contents",
"LowParse.Spec.Base.total_constant_size_parser_kind",
"LowParse.Spec.Int32le.parse_int32le",
"LowParse.Low.Base.Spec.valid_facts",
"LowParse.Spec.Int32le.decode_int32le_total_constant",
"LowParse.Spec.Int32le.decode_int32le_eq",
"FStar.Seq.Base.slice",
"LowStar.Monotonic.Buffer.as_seq",
"Prims.op_Addition",
"LowStar.Monotonic.Buffer.mbuffer",
"LowParse.Slice.__proj__Mkslice__item__base",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"LowParse.Low.Base.Spec.valid",
"LowStar.Monotonic.Buffer.modifies",
"LowStar.Monotonic.Buffer.loc_none",
"Prims.eq2",
"FStar.UInt32.eq"
] | [] | false | true | false | false | false | let inplace_compare
(v: U32.t{0 <= U32.v v /\ U32.v v < 4294967296})
(#rrel #rel: _)
(input: slice rrel rel)
(pos: U32.t)
: HST.Stack bool
(requires (fun h -> valid parse_int32le h input pos))
(ensures
(fun h res h' ->
B.modifies B.loc_none h h' /\ res == (U32.eq (contents parse_int32le h input pos) v))) =
| let h = HST.get () in
let b = input.base in
[@@ inline_let ]let _ =
decode_int32le_eq (Seq.slice (B.as_seq h b) (U32.v pos) (U32.v pos + 4));
decode_int32le_total_constant ();
valid_facts parse_int32le h input pos;
[@@ inline_let ]let v' = contents parse_int32le h input pos in
decompose_compose_equiv (U32.v v);
decompose_compose_equiv (U32.v v');
decompose_compare (U32.v v) (U32.v v')
in
let r0 = B.index b pos in
let r1 = B.index b (pos `U32.add` 1ul) in
let r2 = B.index b (pos `U32.add` 2ul) in
let r3 = B.index b (pos `U32.add` 3ul) in
[@@ inline_let ]let b0 = U8.uint_to_t (decompose_int32le_0 (U32.v v)) in
[@@ inline_let ]let b1 = U8.uint_to_t (decompose_int32le_1 (U32.v v)) in
[@@ inline_let ]let b2 = U8.uint_to_t (decompose_int32le_2 (U32.v v)) in
[@@ inline_let ]let b3 = U8.uint_to_t (decompose_int32le_3 (U32.v v)) in
compare_by_bytes r0 r1 r2 r3 b0 b1 b2 b3 | false |
LowParse.Low.DER.fst | LowParse.Low.DER.validate_bounded_der_length32 | val validate_bounded_der_length32
(vmin: der_length_t)
(min: U32.t{U32.v min == vmin})
(vmax: der_length_t)
(max: U32.t{U32.v max == vmax /\ U32.v min <= U32.v max})
: Tot (validator (parse_bounded_der_length32 (vmin) (vmax))) | val validate_bounded_der_length32
(vmin: der_length_t)
(min: U32.t{U32.v min == vmin})
(vmax: der_length_t)
(max: U32.t{U32.v max == vmax /\ U32.v min <= U32.v max})
: Tot (validator (parse_bounded_der_length32 (vmin) (vmax))) | let validate_bounded_der_length32
(vmin: der_length_t)
(min: U32.t { U32.v min == vmin } )
(vmax: der_length_t)
(max: U32.t { U32.v max == vmax /\ U32.v min <= U32.v max } )
: Tot (
validator (parse_bounded_der_length32 (vmin) (vmax)))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let]
let _ =
valid_facts (parse_bounded_der_length32 (U32.v min) (U32.v max)) h input (uint64_to_uint32 pos);
parse_bounded_der_length32_unfold (U32.v min) (U32.v max) (bytes_of_slice_from h input (uint64_to_uint32 pos));
valid_facts parse_u8 h input (uint64_to_uint32 pos)
in
let v = validate_u8 () input pos in
if is_error v
then v
else
let x = read_u8 input (uint64_to_uint32 pos) in
let len = der_length_payload_size_of_tag8 x in
let tg1 = tag_of_der_length32_impl min in
let l1 = der_length_payload_size_of_tag8 tg1 in
let tg2 = tag_of_der_length32_impl max in
let l2 = der_length_payload_size_of_tag8 tg2 in
if (len `U8.lt` l1) || ( l2 `U8.lt` len)
then validator_error_generic
else
[@inline_let] let _ = valid_facts (parse_der_length_payload32 x) h input (uint64_to_uint32 v) in
let v2 = validate_der_length_payload32 x input v in
if is_error v2
then v2
else
let y = read_der_length_payload32 x input (uint64_to_uint32 v) in
if y `U32.lt` min || max `U32.lt` y
then validator_error_generic
else v2 | {
"file_name": "src/lowparse/LowParse.Low.DER.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 17,
"end_line": 190,
"start_col": 0,
"start_line": 154
} | module LowParse.Low.DER
include LowParse.Spec.DER
include LowParse.Low.Int // for parse_u8
include LowParse.Low.BoundedInt // for bounded_integer
open FStar.Mul
module U8 = FStar.UInt8
module U32 = FStar.UInt32
module HST = FStar.HyperStack.ST
module B = LowStar.Buffer
module Cast = FStar.Int.Cast
module U64 = FStar.UInt64
#reset-options "--z3cliopt smt.arith.nl=false --max_fuel 0 --max_ifuel 0"
#push-options "--z3rlimit 32"
inline_for_extraction
let validate_der_length_payload32
(x: U8.t { der_length_payload_size_of_tag x <= 4 } )
: Tot (validator (parse_der_length_payload32 x))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let] let _ =
valid_facts (parse_der_length_payload32 x) h input (uint64_to_uint32 pos);
assert (U64.v pos <= U32.v input.len);
parse_der_length_payload32_unfold x (bytes_of_slice_from h input (uint64_to_uint32 pos));
assert_norm (pow2 (8 * 1) == 256);
assert_norm (pow2 (8 * 2) == 65536);
assert_norm (pow2 (8 * 3) == 16777216);
assert_norm (pow2 (8 * 4) == 4294967296)
in
if x `U8.lt` 128uy
then pos
else if x = 128uy || x = 255uy
then validator_error_generic
else if x = 129uy
then
[@inline_let] let _ = valid_facts parse_u8 h input (uint64_to_uint32 pos) in
let v = validate_u8 () input pos in
if is_error v
then v
else
let z = read_u8 input (uint64_to_uint32 pos) in
if z `U8.lt` 128uy
then validator_error_generic
else v
else
let len = x `U8.sub` 128uy in
[@inline_let] let _ = valid_facts (parse_bounded_integer (U8.v len)) h input (uint64_to_uint32 pos) in
if len = 2uy
then
let v = validate_bounded_integer 2 input pos in
if is_error v
then v
else
let y = read_bounded_integer_2 () input (uint64_to_uint32 pos) in
if y `U32.lt `256ul
then validator_error_generic
else v
else if len = 3uy
then
let v = validate_bounded_integer 3 input pos in
if is_error v
then v
else
let y = read_bounded_integer_3 () input (uint64_to_uint32 pos) in
if y `U32.lt `65536ul
then validator_error_generic
else v
else
let v = validate_bounded_integer 4 input pos in
if is_error v
then v
else
let y = read_bounded_integer_4 () input (uint64_to_uint32 pos) in
if y `U32.lt` 16777216ul
then validator_error_generic
else v
inline_for_extraction
let jump_der_length_payload32
(x: U8.t { der_length_payload_size_of_tag x <= 4 } )
: Tot (jumper (parse_der_length_payload32 x))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let] let _ =
valid_facts (parse_der_length_payload32 x) h input pos;
parse_der_length_payload32_unfold x (bytes_of_slice_from h input pos);
assert_norm (pow2 (8 * 1) == 256);
assert_norm (pow2 (8 * 2) == 65536);
assert_norm (pow2 (8 * 3) == 16777216);
assert_norm (pow2 (8 * 4) == 4294967296)
in
if x `U8.lt` 128uy
then pos
else
[@inline_let]
let len = x `U8.sub` 128uy in
[@inline_let] let _ =
valid_facts parse_u8 h input pos;
parser_kind_prop_equiv parse_u8_kind parse_u8;
valid_facts (parse_bounded_integer (U8.v len)) h input pos;
parser_kind_prop_equiv (parse_bounded_integer_kind (U8.v len)) (parse_bounded_integer (U8.v len))
in
pos `U32.add` Cast.uint8_to_uint32 len
inline_for_extraction
let read_der_length_payload32
(x: U8.t { der_length_payload_size_of_tag x <= 4 } )
: Tot (leaf_reader (parse_der_length_payload32 x))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let] let _ =
valid_facts (parse_der_length_payload32 x) h input pos;
parse_der_length_payload32_unfold x (bytes_of_slice_from h input pos);
assert_norm (pow2 (8 * 1) == 256);
assert_norm (pow2 (8 * 2) == 65536);
assert_norm (pow2 (8 * 3) == 16777216);
assert_norm (pow2 (8 * 4) == 4294967296)
in
if x `U8.lt` 128uy
then
[@inline_let]
let res = Cast.uint8_to_uint32 x in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x)
else if x = 129uy
then
[@inline_let] let _ = valid_facts parse_u8 h input pos in
let z = read_u8 input pos in
[@inline_let] let res = Cast.uint8_to_uint32 z in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x)
else
let len = x `U8.sub` 128uy in
[@inline_let] let _ = valid_facts (parse_bounded_integer (U8.v len)) h input pos in
if len = 2uy
then
let res = read_bounded_integer_2 () input pos in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x)
else if len = 3uy
then
let res = read_bounded_integer_3 () input pos in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x)
else
let res = read_bounded_integer_4 () input pos in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.DER.fsti.checked",
"LowParse.Low.Int.fsti.checked",
"LowParse.Low.BoundedInt.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.DER.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low.BoundedInt",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.DER",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"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": [
"smt.arith.nl=false"
],
"z3refresh": false,
"z3rlimit": 32,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
vmin: LowParse.Spec.DER.der_length_t ->
min: FStar.UInt32.t{FStar.UInt32.v min == vmin} ->
vmax: LowParse.Spec.DER.der_length_t ->
max: FStar.UInt32.t{FStar.UInt32.v max == vmax /\ FStar.UInt32.v min <= FStar.UInt32.v max}
-> LowParse.Low.Base.validator (LowParse.Spec.DER.parse_bounded_der_length32 vmin vmax) | Prims.Tot | [
"total"
] | [] | [
"LowParse.Spec.DER.der_length_t",
"FStar.UInt32.t",
"Prims.eq2",
"Prims.int",
"Prims.l_or",
"FStar.UInt.size",
"FStar.UInt32.n",
"Prims.l_and",
"Prims.b2t",
"Prims.op_GreaterThanOrEqual",
"Prims.op_LessThanOrEqual",
"LowParse.Spec.DER.der_length_max",
"FStar.UInt32.v",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"FStar.UInt64.t",
"LowParse.Low.ErrorCode.is_error",
"Prims.bool",
"Prims.op_BarBar",
"FStar.UInt8.lt",
"LowParse.Low.ErrorCode.validator_error_generic",
"FStar.UInt32.lt",
"LowParse.Spec.Base.refine_with_tag",
"FStar.UInt8.t",
"LowParse.Spec.DER.tag_of_der_length32",
"LowParse.Low.DER.read_der_length_payload32",
"LowParse.Low.ErrorCode.uint64_to_uint32",
"LowParse.Low.DER.validate_der_length_payload32",
"Prims.unit",
"LowParse.Low.Base.Spec.valid_facts",
"LowParse.Spec.DER.parse_der_length_payload_kind",
"LowParse.Spec.DER.parse_der_length_payload32",
"FStar.UInt8.v",
"LowParse.Spec.DER.der_length_payload_size_of_tag",
"LowParse.Spec.DER.der_length_payload_size_of_tag8",
"Prims.op_LessThan",
"LowParse.Spec.DER.tag_of_der_length",
"LowParse.Spec.DER.tag_of_der_length32_impl",
"LowParse.Low.Int.read_u8",
"LowParse.Low.Int.validate_u8",
"LowParse.Spec.Int.parse_u8_kind",
"LowParse.Spec.Int.parse_u8",
"LowParse.Spec.DER.parse_bounded_der_length32_unfold",
"LowParse.Slice.bytes_of_slice_from",
"LowParse.Spec.DER.parse_bounded_der_length32_kind",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.DER.parse_bounded_der_length32",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"LowParse.Low.Base.validator"
] | [] | false | false | false | false | false | let validate_bounded_der_length32
(vmin: der_length_t)
(min: U32.t{U32.v min == vmin})
(vmax: der_length_t)
(max: U32.t{U32.v max == vmax /\ U32.v min <= U32.v max})
: Tot (validator (parse_bounded_der_length32 (vmin) (vmax))) =
| fun #rrel #rel input pos ->
let h = HST.get () in
[@@ inline_let ]let _ =
valid_facts (parse_bounded_der_length32 (U32.v min) (U32.v max)) h input (uint64_to_uint32 pos);
parse_bounded_der_length32_unfold (U32.v min)
(U32.v max)
(bytes_of_slice_from h input (uint64_to_uint32 pos));
valid_facts parse_u8 h input (uint64_to_uint32 pos)
in
let v = validate_u8 () input pos in
if is_error v
then v
else
let x = read_u8 input (uint64_to_uint32 pos) in
let len = der_length_payload_size_of_tag8 x in
let tg1 = tag_of_der_length32_impl min in
let l1 = der_length_payload_size_of_tag8 tg1 in
let tg2 = tag_of_der_length32_impl max in
let l2 = der_length_payload_size_of_tag8 tg2 in
if (len `U8.lt` l1) || (l2 `U8.lt` len)
then validator_error_generic
else
[@@ inline_let ]let _ =
valid_facts (parse_der_length_payload32 x) h input (uint64_to_uint32 v)
in
let v2 = validate_der_length_payload32 x input v in
if is_error v2
then v2
else
let y = read_der_length_payload32 x input (uint64_to_uint32 v) in
if y `U32.lt` min || max `U32.lt` y then validator_error_generic else v2 | false |
Spec.FFDHE.fst | Spec.FFDHE.ffdhe_params_8192 | val ffdhe_params_8192:ffdhe_params_t | val ffdhe_params_8192:ffdhe_params_t | let ffdhe_params_8192 : ffdhe_params_t =
Mk_ffdhe_params 1024 ffdhe_p8192 1 ffdhe_g2 | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 45,
"end_line": 478,
"start_col": 0,
"start_line": 477
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy; 0x57uy; 0xC9uy; 0x35uy;
0x98uy; 0x4Fuy; 0x0Cuy; 0x70uy; 0xE0uy; 0xE6uy; 0x8Buy; 0x77uy;
0xE2uy; 0xA6uy; 0x89uy;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;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p3072: List.Tot.llist pub_uint8 384 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5u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D0uy; 0x6Buy; 0xFAuy; 0x53uy; 0xDDuy; 0xEFuy;
0x3Cuy; 0x1Buy; 0x20uy; 0xEEuy; 0x3Fuy; 0xD5uy; 0x9Duy; 0x7Cuy;
0x25uy; 0xE4uy; 0x1Duy; 0x2Buy; 0x66uy; 0xC6uy; 0x2Euy; 0x37uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 384);
l
let ffdhe_p3072: lseq pub_uint8 384 = of_list list_ffdhe_p3072
// The estimated symmetric-equivalent strength of this group is 125 bits.
let ffdhe_params_3072 : ffdhe_params_t =
Mk_ffdhe_params 384 ffdhe_p3072 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p4096: List.Tot.llist pub_uint8 512 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF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x82uy; 0x91uy; 0xCDuy; 0xCEuy; 0xC9uy; 0x7Duy; 0xCFuy;
0x8Euy; 0xC9uy; 0xB5uy; 0x5Auy; 0x7Fuy; 0x88uy; 0xA4uy; 0x6Buy;
0x4Duy; 0xB5uy; 0xA8uy; 0x51uy; 0xF4uy; 0x41uy; 0x82uy; 0xE1uy;
0xC6uy; 0x8Auy; 0x00uy; 0x7Euy; 0x5Euy; 0x65uy; 0x5Fuy; 0x6Auy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 512);
l
let ffdhe_p4096: lseq pub_uint8 512 = of_list list_ffdhe_p4096
// The estimated symmetric-equivalent strength of this group is 150 bits.
let ffdhe_params_4096 : ffdhe_params_t =
Mk_ffdhe_params 512 ffdhe_p4096 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p6144: List.Tot.llist pub_uint8 768 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0x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 0x4Auy; 0x8Euy; 0x9Auy; 0xDBuy; 0x1Euy; 0x69uy;
0x62uy; 0xA6uy; 0x95uy; 0x26uy; 0xD4uy; 0x31uy; 0x61uy; 0xC1uy;
0xA4uy; 0x1Duy; 0x57uy; 0x0Duy; 0x79uy; 0x38uy; 0xDAuy; 0xD4uy;
0xA4uy; 0x0Euy; 0x32uy; 0x9Cuy; 0xD0uy; 0xE4uy; 0x0Euy; 0x65uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 768);
l
let ffdhe_p6144: lseq pub_uint8 768 = of_list list_ffdhe_p6144
// The estimated symmetric-equivalent strength of this group is 175 bits.
let ffdhe_params_6144 : ffdhe_params_t =
Mk_ffdhe_params 768 ffdhe_p6144 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p8192: List.Tot.llist pub_uint8 1024 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1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y; 0xF4uy; 0x61uy; 0x4Euy;
0x01uy; 0x1Euy; 0x2Auy; 0x94uy; 0x83uy; 0x8Fuy; 0xF8uy; 0x8Cuy;
0xD6uy; 0x8Cuy; 0x8Buy; 0xB7uy; 0xC5uy; 0xC6uy; 0x42uy; 0x4Cuy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 1024);
l
let ffdhe_p8192: lseq pub_uint8 1024 = of_list list_ffdhe_p8192 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Spec.FFDHE.ffdhe_params_t | Prims.Tot | [
"total"
] | [] | [
"Spec.FFDHE.Mk_ffdhe_params",
"Spec.FFDHE.ffdhe_p8192",
"Spec.FFDHE.ffdhe_g2"
] | [] | false | false | false | true | false | let ffdhe_params_8192:ffdhe_params_t =
| Mk_ffdhe_params 1024 ffdhe_p8192 1 ffdhe_g2 | false |
Spec.FFDHE.fst | Spec.FFDHE.ffdhe_sk_t | val ffdhe_sk_t : a: Spec.FFDHE.ffdhe_alg -> Type0 | let ffdhe_sk_t (a:ffdhe_alg) =
sk:lseq uint8 (ffdhe_len a){1 < nat_from_bytes_be sk} | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 55,
"end_line": 572,
"start_col": 7,
"start_line": 571
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"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);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p3072: List.Tot.llist pub_uint8 384 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy; 0x57uy; 0xC9uy; 0x35uy;
0x98uy; 0x4Fuy; 0x0Cuy; 0x70uy; 0xE0uy; 0xE6uy; 0x8Buy; 0x77uy;
0xE2uy; 0xA6uy; 0x89uy; 0x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66uy; 0xC6uy; 0x2Euy; 0x37uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 384);
l
let ffdhe_p3072: lseq pub_uint8 384 = of_list list_ffdhe_p3072
// The estimated symmetric-equivalent strength of this group is 125 bits.
let ffdhe_params_3072 : ffdhe_params_t =
Mk_ffdhe_params 384 ffdhe_p3072 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p4096: List.Tot.llist pub_uint8 512 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy;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uy; 0xF4uy; 0x41uy; 0x82uy; 0xE1uy;
0xC6uy; 0x8Auy; 0x00uy; 0x7Euy; 0x5Euy; 0x65uy; 0x5Fuy; 0x6Auy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 512);
l
let ffdhe_p4096: lseq pub_uint8 512 = of_list list_ffdhe_p4096
// The estimated symmetric-equivalent strength of this group is 150 bits.
let ffdhe_params_4096 : ffdhe_params_t =
Mk_ffdhe_params 512 ffdhe_p4096 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p6144: List.Tot.llist pub_uint8 768 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0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 0x38uy; 0xDAuy; 0xD4uy;
0xA4uy; 0x0Euy; 0x32uy; 0x9Cuy; 0xD0uy; 0xE4uy; 0x0Euy; 0x65uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 768);
l
let ffdhe_p6144: lseq pub_uint8 768 = of_list list_ffdhe_p6144
// The estimated symmetric-equivalent strength of this group is 175 bits.
let ffdhe_params_6144 : ffdhe_params_t =
Mk_ffdhe_params 768 ffdhe_p6144 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p8192: List.Tot.llist pub_uint8 1024 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0x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 0x4Cuy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 1024);
l
let ffdhe_p8192: lseq pub_uint8 1024 = of_list list_ffdhe_p8192
// The estimated symmetric-equivalent strength of this group is 192 bits.
let ffdhe_params_8192 : ffdhe_params_t =
Mk_ffdhe_params 1024 ffdhe_p8192 1 ffdhe_g2
type ffdhe_alg =
| FFDHE2048
| FFDHE3072
| FFDHE4096
| FFDHE6144
| FFDHE8192
let get_ffdhe_params (a:ffdhe_alg) : ffdhe_params_t =
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> ffdhe_params_2048
| FFDHE3072 -> ffdhe_params_3072
| FFDHE4096 -> ffdhe_params_4096
| FFDHE6144 -> ffdhe_params_6144
| FFDHE8192 -> ffdhe_params_8192
let ffdhe_len (a:ffdhe_alg) : x:size_pos{x <= 1024} =
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> 256
| FFDHE3072 -> 384
| FFDHE4096 -> 512
| FFDHE6144 -> 768
| FFDHE8192 -> 1024
val ffdhe_g2_lemma: unit -> Lemma (nat_from_bytes_be (of_list list_ffdhe_g2) = 2)
let ffdhe_g2_lemma () =
let g = of_list list_ffdhe_g2 in
assert_norm (Seq.index (Seq.seq_of_list list_ffdhe_g2) 0 = 0x02uy);
nat_from_intseq_be_lemma0 g
val ffdhe_p_lemma0: a:ffdhe_alg -> Lemma
(let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
Seq.index p (len - 1) == 0xffuy)
let ffdhe_p_lemma0 a =
let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 ->
assert (p == of_list list_ffdhe_p2048);
assert_norm (List.Tot.index list_ffdhe_p2048 255 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p2048) 255 == 0xffuy)
| FFDHE3072 ->
assert (p == of_list list_ffdhe_p3072);
assert_norm (List.Tot.index list_ffdhe_p3072 383 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p3072) 383 == 0xffuy)
| FFDHE4096 ->
assert (p == of_list list_ffdhe_p4096);
assert_norm (List.Tot.index list_ffdhe_p4096 511 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p4096) 511 == 0xffuy)
| FFDHE6144 ->
assert (p == of_list list_ffdhe_p6144);
assert_norm (List.Tot.index list_ffdhe_p6144 767 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p6144) 767 == 0xffuy)
| FFDHE8192 ->
assert (p == of_list list_ffdhe_p8192);
assert_norm (List.Tot.index list_ffdhe_p8192 1023 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p8192) 1023 == 0xffuy)
val ffdhe_p_lemma: a:ffdhe_alg -> Lemma
(let ffdhe_p = get_ffdhe_params a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let p_n = nat_from_bytes_be p in
p_n % 2 = 1 /\ 255 <= p_n) // 2 < p_n <==> g_n < p_n
let ffdhe_p_lemma a =
let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let p_n = nat_from_bytes_be p in
nat_from_intseq_be_slice_lemma p (len - 1);
assert (p_n == nat_from_bytes_be (slice p (len - 1) len) + pow2 8 * nat_from_bytes_be (slice p 0 (len - 1)));
nat_from_intseq_be_lemma0 (slice p (len - 1) len);
assert (p_n == v p.[len - 1] + pow2 8 * nat_from_bytes_be (slice p 0 (len - 1)));
ffdhe_p_lemma0 a | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Spec.FFDHE.ffdhe_alg -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Spec.FFDHE.ffdhe_alg",
"Lib.Sequence.lseq",
"Lib.IntTypes.uint8",
"Spec.FFDHE.ffdhe_len",
"Prims.b2t",
"Prims.op_LessThan",
"Lib.ByteSequence.nat_from_bytes_be",
"Lib.IntTypes.SEC"
] | [] | false | false | false | true | true | let ffdhe_sk_t (a: ffdhe_alg) =
| sk: lseq uint8 (ffdhe_len a) {1 < nat_from_bytes_be sk} | false |
|
Spec.FFDHE.fst | Spec.FFDHE.ffdhe_p2048 | val ffdhe_p2048:lseq pub_uint8 256 | val ffdhe_p2048:lseq pub_uint8 256 | let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048 | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 62,
"end_line": 74,
"start_col": 0,
"start_line": 74
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy;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 0x07uy; 0xA7uy; 0xC8uy; 0xEEuy; 0x0Auy; 0x6Duy; 0x70uy;
0x9Euy; 0x02uy; 0xFCuy; 0xE1uy; 0xCDuy; 0xF7uy; 0xE2uy; 0xECuy;
0xC0uy; 0x34uy; 0x04uy; 0xCDuy; 0x28uy; 0x34uy; 0x2Fuy; 0x61uy;
0x91uy; 0x72uy; 0xFEuy; 0x9Cuy; 0xE9uy; 0x85uy; 0x83uy; 0xFFuy;
0x8Euy; 0x4Fuy; 0x12uy; 0x32uy; 0xEEuy; 0xF2uy; 0x81uy; 0x83uy;
0xC3uy; 0xFEuy; 0x3Buy; 0x1Buy; 0x4Cuy; 0x6Fuy; 0xADuy; 0x73uy;
0x3Buy; 0xB5uy; 0xFCuy; 0xBCuy; 0x2Euy; 0xC2uy; 0x20uy; 0x05uy;
0xC5uy; 0x8Euy; 0xF1uy; 0x83uy; 0x7Duy; 0x16uy; 0x83uy; 0xB2uy;
0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.PUB) 256 | Prims.Tot | [
"total"
] | [] | [
"Lib.Sequence.of_list",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.PUB",
"Spec.FFDHE.list_ffdhe_p2048"
] | [] | false | false | false | false | false | let ffdhe_p2048:lseq pub_uint8 256 =
| of_list list_ffdhe_p2048 | false |
Spec.FFDHE.fst | Spec.FFDHE.list_ffdhe_p2048 | val list_ffdhe_p2048:List.Tot.llist pub_uint8 256 | val list_ffdhe_p2048:List.Tot.llist pub_uint8 256 | let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0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Buy;
0xB9uy; 0x6Auy; 0xDAuy; 0xB7uy; 0x60uy; 0xD7uy; 0xF4uy; 0x68uy;
0x1Duy; 0x4Fuy; 0x42uy; 0xA3uy; 0xDEuy; 0x39uy; 0x4Duy; 0xF4uy;
0xAEuy; 0x56uy; 0xEDuy; 0xE7uy; 0x63uy; 0x72uy; 0xBBuy; 0x19uy;
0x0Buy; 0x07uy; 0xA7uy; 0xC8uy; 0xEEuy; 0x0Auy; 0x6Duy; 0x70uy;
0x9Euy; 0x02uy; 0xFCuy; 0xE1uy; 0xCDuy; 0xF7uy; 0xE2uy; 0xECuy;
0xC0uy; 0x34uy; 0x04uy; 0xCDuy; 0x28uy; 0x34uy; 0x2Fuy; 0x61uy;
0x91uy; 0x72uy; 0xFEuy; 0x9Cuy; 0xE9uy; 0x85uy; 0x83uy; 0xFFuy;
0x8Euy; 0x4Fuy; 0x12uy; 0x32uy; 0xEEuy; 0xF2uy; 0x81uy; 0x83uy;
0xC3uy; 0xFEuy; 0x3Buy; 0x1Buy; 0x4Cuy; 0x6Fuy; 0xADuy; 0x73uy;
0x3Buy; 0xB5uy; 0xFCuy; 0xBCuy; 0x2Euy; 0xC2uy; 0x20uy; 0x05uy;
0xC5uy; 0x8Euy; 0xF1uy; 0x83uy; 0x7Duy; 0x16uy; 0x83uy; 0xB2uy;
0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 72,
"start_col": 0,
"start_line": 35
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"] | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.List.Tot.Properties.llist (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.PUB) 256 | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.int",
"FStar.List.Tot.Base.length",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.PUB",
"Prims.list",
"Prims.Cons",
"FStar.UInt8.__uint_to_t",
"Prims.Nil"
] | [] | false | false | false | false | false | let list_ffdhe_p2048:List.Tot.llist pub_uint8 256 =
| [@@ inline_let ]let l =
[
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xADuy; 0xF8uy; 0x54uy; 0x58uy;
0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy; 0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy; 0xA9uy; 0xE1uy; 0x36uy; 0x41uy;
0x14uy; 0x64uy; 0x33uy; 0xFBuy; 0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy; 0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34uy; 0x2Fuy; 0x61uy;
0x91uy; 0x72uy; 0xFEuy; 0x9Cuy; 0xE9uy; 0x85uy; 0x83uy; 0xFFuy; 0x8Euy; 0x4Fuy; 0x12uy; 0x32uy;
0xEEuy; 0xF2uy; 0x81uy; 0x83uy; 0xC3uy; 0xFEuy; 0x3Buy; 0x1Buy; 0x4Cuy; 0x6Fuy; 0xADuy; 0x73uy;
0x3Buy; 0xB5uy; 0xFCuy; 0xBCuy; 0x2Euy; 0xC2uy; 0x20uy; 0x05uy; 0xC5uy; 0x8Euy; 0xF1uy; 0x83uy;
0x7Duy; 0x16uy; 0x83uy; 0xB2uy; 0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
]
in
assert_norm (List.Tot.length l == 256);
l | false |
LowParse.Low.DER.fst | LowParse.Low.DER.jump_bounded_der_length32 | val jump_bounded_der_length32
(vmin: der_length_t)
(vmax: der_length_t{vmin <= vmax /\ vmax < 4294967296})
: Tot (jumper (parse_bounded_der_length32 (vmin) (vmax))) | val jump_bounded_der_length32
(vmin: der_length_t)
(vmax: der_length_t{vmin <= vmax /\ vmax < 4294967296})
: Tot (jumper (parse_bounded_der_length32 (vmin) (vmax))) | let jump_bounded_der_length32
(vmin: der_length_t)
(vmax: der_length_t { vmin <= vmax /\ vmax < 4294967296 } )
: Tot (
jumper (parse_bounded_der_length32 (vmin) (vmax)))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let]
let _ =
valid_facts (parse_bounded_der_length32 (vmin) (vmax)) h input pos;
parse_bounded_der_length32_unfold (vmin) (vmax) (bytes_of_slice_from h input pos);
valid_facts parse_u8 h input pos
in
let v = jump_u8 input pos in
let x = read_u8 input pos in
let len = der_length_payload_size_of_tag8 x in
[@inline_let] let _ = valid_facts (parse_der_length_payload32 x) h input v in
jump_der_length_payload32 x input v | {
"file_name": "src/lowparse/LowParse.Low.DER.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 39,
"end_line": 210,
"start_col": 0,
"start_line": 193
} | module LowParse.Low.DER
include LowParse.Spec.DER
include LowParse.Low.Int // for parse_u8
include LowParse.Low.BoundedInt // for bounded_integer
open FStar.Mul
module U8 = FStar.UInt8
module U32 = FStar.UInt32
module HST = FStar.HyperStack.ST
module B = LowStar.Buffer
module Cast = FStar.Int.Cast
module U64 = FStar.UInt64
#reset-options "--z3cliopt smt.arith.nl=false --max_fuel 0 --max_ifuel 0"
#push-options "--z3rlimit 32"
inline_for_extraction
let validate_der_length_payload32
(x: U8.t { der_length_payload_size_of_tag x <= 4 } )
: Tot (validator (parse_der_length_payload32 x))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let] let _ =
valid_facts (parse_der_length_payload32 x) h input (uint64_to_uint32 pos);
assert (U64.v pos <= U32.v input.len);
parse_der_length_payload32_unfold x (bytes_of_slice_from h input (uint64_to_uint32 pos));
assert_norm (pow2 (8 * 1) == 256);
assert_norm (pow2 (8 * 2) == 65536);
assert_norm (pow2 (8 * 3) == 16777216);
assert_norm (pow2 (8 * 4) == 4294967296)
in
if x `U8.lt` 128uy
then pos
else if x = 128uy || x = 255uy
then validator_error_generic
else if x = 129uy
then
[@inline_let] let _ = valid_facts parse_u8 h input (uint64_to_uint32 pos) in
let v = validate_u8 () input pos in
if is_error v
then v
else
let z = read_u8 input (uint64_to_uint32 pos) in
if z `U8.lt` 128uy
then validator_error_generic
else v
else
let len = x `U8.sub` 128uy in
[@inline_let] let _ = valid_facts (parse_bounded_integer (U8.v len)) h input (uint64_to_uint32 pos) in
if len = 2uy
then
let v = validate_bounded_integer 2 input pos in
if is_error v
then v
else
let y = read_bounded_integer_2 () input (uint64_to_uint32 pos) in
if y `U32.lt `256ul
then validator_error_generic
else v
else if len = 3uy
then
let v = validate_bounded_integer 3 input pos in
if is_error v
then v
else
let y = read_bounded_integer_3 () input (uint64_to_uint32 pos) in
if y `U32.lt `65536ul
then validator_error_generic
else v
else
let v = validate_bounded_integer 4 input pos in
if is_error v
then v
else
let y = read_bounded_integer_4 () input (uint64_to_uint32 pos) in
if y `U32.lt` 16777216ul
then validator_error_generic
else v
inline_for_extraction
let jump_der_length_payload32
(x: U8.t { der_length_payload_size_of_tag x <= 4 } )
: Tot (jumper (parse_der_length_payload32 x))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let] let _ =
valid_facts (parse_der_length_payload32 x) h input pos;
parse_der_length_payload32_unfold x (bytes_of_slice_from h input pos);
assert_norm (pow2 (8 * 1) == 256);
assert_norm (pow2 (8 * 2) == 65536);
assert_norm (pow2 (8 * 3) == 16777216);
assert_norm (pow2 (8 * 4) == 4294967296)
in
if x `U8.lt` 128uy
then pos
else
[@inline_let]
let len = x `U8.sub` 128uy in
[@inline_let] let _ =
valid_facts parse_u8 h input pos;
parser_kind_prop_equiv parse_u8_kind parse_u8;
valid_facts (parse_bounded_integer (U8.v len)) h input pos;
parser_kind_prop_equiv (parse_bounded_integer_kind (U8.v len)) (parse_bounded_integer (U8.v len))
in
pos `U32.add` Cast.uint8_to_uint32 len
inline_for_extraction
let read_der_length_payload32
(x: U8.t { der_length_payload_size_of_tag x <= 4 } )
: Tot (leaf_reader (parse_der_length_payload32 x))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let] let _ =
valid_facts (parse_der_length_payload32 x) h input pos;
parse_der_length_payload32_unfold x (bytes_of_slice_from h input pos);
assert_norm (pow2 (8 * 1) == 256);
assert_norm (pow2 (8 * 2) == 65536);
assert_norm (pow2 (8 * 3) == 16777216);
assert_norm (pow2 (8 * 4) == 4294967296)
in
if x `U8.lt` 128uy
then
[@inline_let]
let res = Cast.uint8_to_uint32 x in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x)
else if x = 129uy
then
[@inline_let] let _ = valid_facts parse_u8 h input pos in
let z = read_u8 input pos in
[@inline_let] let res = Cast.uint8_to_uint32 z in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x)
else
let len = x `U8.sub` 128uy in
[@inline_let] let _ = valid_facts (parse_bounded_integer (U8.v len)) h input pos in
if len = 2uy
then
let res = read_bounded_integer_2 () input pos in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x)
else if len = 3uy
then
let res = read_bounded_integer_3 () input pos in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x)
else
let res = read_bounded_integer_4 () input pos in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x)
inline_for_extraction
let validate_bounded_der_length32
(vmin: der_length_t)
(min: U32.t { U32.v min == vmin } )
(vmax: der_length_t)
(max: U32.t { U32.v max == vmax /\ U32.v min <= U32.v max } )
: Tot (
validator (parse_bounded_der_length32 (vmin) (vmax)))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let]
let _ =
valid_facts (parse_bounded_der_length32 (U32.v min) (U32.v max)) h input (uint64_to_uint32 pos);
parse_bounded_der_length32_unfold (U32.v min) (U32.v max) (bytes_of_slice_from h input (uint64_to_uint32 pos));
valid_facts parse_u8 h input (uint64_to_uint32 pos)
in
let v = validate_u8 () input pos in
if is_error v
then v
else
let x = read_u8 input (uint64_to_uint32 pos) in
let len = der_length_payload_size_of_tag8 x in
let tg1 = tag_of_der_length32_impl min in
let l1 = der_length_payload_size_of_tag8 tg1 in
let tg2 = tag_of_der_length32_impl max in
let l2 = der_length_payload_size_of_tag8 tg2 in
if (len `U8.lt` l1) || ( l2 `U8.lt` len)
then validator_error_generic
else
[@inline_let] let _ = valid_facts (parse_der_length_payload32 x) h input (uint64_to_uint32 v) in
let v2 = validate_der_length_payload32 x input v in
if is_error v2
then v2
else
let y = read_der_length_payload32 x input (uint64_to_uint32 v) in
if y `U32.lt` min || max `U32.lt` y
then validator_error_generic
else v2 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.DER.fsti.checked",
"LowParse.Low.Int.fsti.checked",
"LowParse.Low.BoundedInt.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.DER.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low.BoundedInt",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.DER",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"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": [
"smt.arith.nl=false"
],
"z3refresh": false,
"z3rlimit": 32,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
vmin: LowParse.Spec.DER.der_length_t ->
vmax: LowParse.Spec.DER.der_length_t{vmin <= vmax /\ vmax < 4294967296}
-> LowParse.Low.Base.jumper (LowParse.Spec.DER.parse_bounded_der_length32 vmin vmax) | Prims.Tot | [
"total"
] | [] | [
"LowParse.Spec.DER.der_length_t",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"FStar.UInt32.t",
"LowParse.Low.DER.jump_der_length_payload32",
"Prims.unit",
"LowParse.Low.Base.Spec.valid_facts",
"LowParse.Spec.DER.parse_der_length_payload_kind",
"LowParse.Spec.Base.refine_with_tag",
"FStar.UInt8.t",
"LowParse.Spec.DER.tag_of_der_length32",
"LowParse.Spec.DER.parse_der_length_payload32",
"Prims.eq2",
"Prims.int",
"Prims.l_or",
"FStar.UInt.size",
"Prims.op_GreaterThanOrEqual",
"FStar.UInt8.v",
"LowParse.Spec.DER.der_length_payload_size_of_tag",
"LowParse.Spec.DER.der_length_payload_size_of_tag8",
"LowParse.Low.Int.read_u8",
"LowParse.Low.Int.jump_u8",
"LowParse.Spec.Int.parse_u8_kind",
"LowParse.Spec.Int.parse_u8",
"LowParse.Spec.DER.parse_bounded_der_length32_unfold",
"LowParse.Slice.bytes_of_slice_from",
"LowParse.Spec.DER.parse_bounded_der_length32_kind",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.DER.parse_bounded_der_length32",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"LowParse.Low.Base.jumper"
] | [] | false | false | false | false | false | let jump_bounded_der_length32
(vmin: der_length_t)
(vmax: der_length_t{vmin <= vmax /\ vmax < 4294967296})
: Tot (jumper (parse_bounded_der_length32 (vmin) (vmax))) =
| fun #rrel #rel input pos ->
let h = HST.get () in
[@@ inline_let ]let _ =
valid_facts (parse_bounded_der_length32 (vmin) (vmax)) h input pos;
parse_bounded_der_length32_unfold (vmin) (vmax) (bytes_of_slice_from h input pos);
valid_facts parse_u8 h input pos
in
let v = jump_u8 input pos in
let x = read_u8 input pos in
let len = der_length_payload_size_of_tag8 x in
[@@ inline_let ]let _ = valid_facts (parse_der_length_payload32 x) h input v in
jump_der_length_payload32 x input v | false |
Spec.FFDHE.fst | Spec.FFDHE.ffdhe_len | val ffdhe_len (a: ffdhe_alg) : x: size_pos{x <= 1024} | val ffdhe_len (a: ffdhe_alg) : x: size_pos{x <= 1024} | let ffdhe_len (a:ffdhe_alg) : x:size_pos{x <= 1024} =
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> 256
| FFDHE3072 -> 384
| FFDHE4096 -> 512
| FFDHE6144 -> 768
| FFDHE8192 -> 1024 | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 21,
"end_line": 506,
"start_col": 0,
"start_line": 499
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 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; 0x05uy;
0xC5uy; 0x8Euy; 0xF1uy; 0x83uy; 0x7Duy; 0x16uy; 0x83uy; 0xB2uy;
0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p3072: List.Tot.llist pub_uint8 384 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61u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5uy; 0x21uy; 0x97uy; 0x9Buy; 0x0Duy; 0xEAuy; 0xDAuy;
0x1Duy; 0xBFuy; 0x9Auy; 0x42uy; 0xD5uy; 0xC4uy; 0x48uy; 0x4Euy;
0x0Auy; 0xBCuy; 0xD0uy; 0x6Buy; 0xFAuy; 0x53uy; 0xDDuy; 0xEFuy;
0x3Cuy; 0x1Buy; 0x20uy; 0xEEuy; 0x3Fuy; 0xD5uy; 0x9Duy; 0x7Cuy;
0x25uy; 0xE4uy; 0x1Duy; 0x2Buy; 0x66uy; 0xC6uy; 0x2Euy; 0x37uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 384);
l
let ffdhe_p3072: lseq pub_uint8 384 = of_list list_ffdhe_p3072
// The estimated symmetric-equivalent strength of this group is 125 bits.
let ffdhe_params_3072 : ffdhe_params_t =
Mk_ffdhe_params 384 ffdhe_p3072 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p4096: List.Tot.llist pub_uint8 512 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0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auy; 0x1Duy; 0xB9uy; 0x3Duy; 0x71uy; 0x40uy; 0x00uy; 0x3Cuy;
0x2Auy; 0x4Euy; 0xCEuy; 0xA9uy; 0xF9uy; 0x8Duy; 0x0Auy; 0xCCuy;
0x0Auy; 0x82uy; 0x91uy; 0xCDuy; 0xCEuy; 0xC9uy; 0x7Duy; 0xCFuy;
0x8Euy; 0xC9uy; 0xB5uy; 0x5Auy; 0x7Fuy; 0x88uy; 0xA4uy; 0x6Buy;
0x4Duy; 0xB5uy; 0xA8uy; 0x51uy; 0xF4uy; 0x41uy; 0x82uy; 0xE1uy;
0xC6uy; 0x8Auy; 0x00uy; 0x7Euy; 0x5Euy; 0x65uy; 0x5Fuy; 0x6Auy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 512);
l
let ffdhe_p4096: lseq pub_uint8 512 = of_list list_ffdhe_p4096
// The estimated symmetric-equivalent strength of this group is 150 bits.
let ffdhe_params_4096 : ffdhe_params_t =
Mk_ffdhe_params 512 ffdhe_p4096 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p6144: List.Tot.llist pub_uint8 768 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7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 0x9Duy; 0x18uy; 0x10uy; 0xC6uy; 0x27uy; 0x2Buy; 0x04uy;
0x5Buy; 0x3Buy; 0x71uy; 0xF9uy; 0xDCuy; 0x6Buy; 0x80uy; 0xD6uy;
0x3Fuy; 0xDDuy; 0x4Auy; 0x8Euy; 0x9Auy; 0xDBuy; 0x1Euy; 0x69uy;
0x62uy; 0xA6uy; 0x95uy; 0x26uy; 0xD4uy; 0x31uy; 0x61uy; 0xC1uy;
0xA4uy; 0x1Duy; 0x57uy; 0x0Duy; 0x79uy; 0x38uy; 0xDAuy; 0xD4uy;
0xA4uy; 0x0Euy; 0x32uy; 0x9Cuy; 0xD0uy; 0xE4uy; 0x0Euy; 0x65uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 768);
l
let ffdhe_p6144: lseq pub_uint8 768 = of_list list_ffdhe_p6144
// The estimated symmetric-equivalent strength of this group is 175 bits.
let ffdhe_params_6144 : ffdhe_params_t =
Mk_ffdhe_params 768 ffdhe_p6144 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p8192: List.Tot.llist pub_uint8 1024 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2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5uy; 0x30uy; 0x67uy; 0x7Fuy; 0x0Duy;
0x97uy; 0xD1uy; 0x1Duy; 0x49uy; 0xF7uy; 0xA8uy; 0x44uy; 0x3Duy;
0x08uy; 0x22uy; 0xE5uy; 0x06uy; 0xA9uy; 0xF4uy; 0x61uy; 0x4Euy;
0x01uy; 0x1Euy; 0x2Auy; 0x94uy; 0x83uy; 0x8Fuy; 0xF8uy; 0x8Cuy;
0xD6uy; 0x8Cuy; 0x8Buy; 0xB7uy; 0xC5uy; 0xC6uy; 0x42uy; 0x4Cuy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 1024);
l
let ffdhe_p8192: lseq pub_uint8 1024 = of_list list_ffdhe_p8192
// The estimated symmetric-equivalent strength of this group is 192 bits.
let ffdhe_params_8192 : ffdhe_params_t =
Mk_ffdhe_params 1024 ffdhe_p8192 1 ffdhe_g2
type ffdhe_alg =
| FFDHE2048
| FFDHE3072
| FFDHE4096
| FFDHE6144
| FFDHE8192
let get_ffdhe_params (a:ffdhe_alg) : ffdhe_params_t =
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> ffdhe_params_2048
| FFDHE3072 -> ffdhe_params_3072
| FFDHE4096 -> ffdhe_params_4096
| FFDHE6144 -> ffdhe_params_6144
| FFDHE8192 -> ffdhe_params_8192 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Spec.FFDHE.ffdhe_alg -> x: Lib.IntTypes.size_pos{x <= 1024} | Prims.Tot | [
"total"
] | [] | [
"Spec.FFDHE.ffdhe_alg",
"Lib.IntTypes.size_pos",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.unit",
"FStar.Pervasives.allow_inversion"
] | [] | false | false | false | false | false | let ffdhe_len (a: ffdhe_alg) : x: size_pos{x <= 1024} =
| allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> 256
| FFDHE3072 -> 384
| FFDHE4096 -> 512
| FFDHE6144 -> 768
| FFDHE8192 -> 1024 | false |
Spec.FFDHE.fst | Spec.FFDHE.ffdhe_secret_to_public | val ffdhe_secret_to_public: a:ffdhe_alg -> sk:ffdhe_sk_t a -> lseq uint8 (ffdhe_len a) | val ffdhe_secret_to_public: a:ffdhe_alg -> sk:ffdhe_sk_t a -> lseq uint8 (ffdhe_len a) | let ffdhe_secret_to_public a sk =
let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let g = Mk_ffdhe_params?.ffdhe_g ffdhe_p in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let g_n = nat_from_bytes_be g in
let p_n = nat_from_bytes_be p in
let sk_n = nat_from_bytes_be sk in
ffdhe_g2_lemma ();
ffdhe_p_lemma a;
let pk_n = Lib.NatMod.pow_mod #p_n g_n sk_n in
nat_to_bytes_be len pk_n | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 26,
"end_line": 589,
"start_col": 0,
"start_line": 576
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xD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uy; 0x68uy;
0x1Duy; 0x4Fuy; 0x42uy; 0xA3uy; 0xDEuy; 0x39uy; 0x4Duy; 0xF4uy;
0xAEuy; 0x56uy; 0xEDuy; 0xE7uy; 0x63uy; 0x72uy; 0xBBuy; 0x19uy;
0x0Buy; 0x07uy; 0xA7uy; 0xC8uy; 0xEEuy; 0x0Auy; 0x6Duy; 0x70uy;
0x9Euy; 0x02uy; 0xFCuy; 0xE1uy; 0xCDuy; 0xF7uy; 0xE2uy; 0xECuy;
0xC0uy; 0x34uy; 0x04uy; 0xCDuy; 0x28uy; 0x34uy; 0x2Fuy; 0x61uy;
0x91uy; 0x72uy; 0xFEuy; 0x9Cuy; 0xE9uy; 0x85uy; 0x83uy; 0xFFuy;
0x8Euy; 0x4Fuy; 0x12uy; 0x32uy; 0xEEuy; 0xF2uy; 0x81uy; 0x83uy;
0xC3uy; 0xFEuy; 0x3Buy; 0x1Buy; 0x4Cuy; 0x6Fuy; 0xADuy; 0x73uy;
0x3Buy; 0xB5uy; 0xFCuy; 0xBCuy; 0x2Euy; 0xC2uy; 0x20uy; 0x05uy;
0xC5uy; 0x8Euy; 0xF1uy; 0x83uy; 0x7Duy; 0x16uy; 0x83uy; 0xB2uy;
0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p3072: List.Tot.llist pub_uint8 384 =
[@inline_let]
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4uy; 0x6Fuy; 0xC9uy; 0xD6uy; 0xE6uy; 0xC9uy; 0x07uy;
0x7Auy; 0xD9uy; 0x1Duy; 0x26uy; 0x91uy; 0xF7uy; 0xF7uy; 0xEEuy;
0x59uy; 0x8Cuy; 0xB0uy; 0xFAuy; 0xC1uy; 0x86uy; 0xD9uy; 0x1Cuy;
0xAEuy; 0xFEuy; 0x13uy; 0x09uy; 0x85uy; 0x13uy; 0x92uy; 0x70uy;
0xB4uy; 0x13uy; 0x0Cuy; 0x93uy; 0xBCuy; 0x43uy; 0x79uy; 0x44uy;
0xF4uy; 0xFDuy; 0x44uy; 0x52uy; 0xE2uy; 0xD7uy; 0x4Duy; 0xD3uy;
0x64uy; 0xF2uy; 0xE2uy; 0x1Euy; 0x71uy; 0xF5uy; 0x4Buy; 0xFFuy;
0x5Cuy; 0xAEuy; 0x82uy; 0xABuy; 0x9Cuy; 0x9Duy; 0xF6uy; 0x9Euy;
0xE8uy; 0x6Duy; 0x2Buy; 0xC5uy; 0x22uy; 0x36uy; 0x3Auy; 0x0Duy;
0xABuy; 0xC5uy; 0x21uy; 0x97uy; 0x9Buy; 0x0Duy; 0xEAuy; 0xDAuy;
0x1Duy; 0xBFuy; 0x9Auy; 0x42uy; 0xD5uy; 0xC4uy; 0x48uy; 0x4Euy;
0x0Auy; 0xBCuy; 0xD0uy; 0x6Buy; 0xFAuy; 0x53uy; 0xDDuy; 0xEFuy;
0x3Cuy; 0x1Buy; 0x20uy; 0xEEuy; 0x3Fuy; 0xD5uy; 0x9Duy; 0x7Cuy;
0x25uy; 0xE4uy; 0x1Duy; 0x2Buy; 0x66uy; 0xC6uy; 0x2Euy; 0x37uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 384);
l
let ffdhe_p3072: lseq pub_uint8 384 = of_list list_ffdhe_p3072
// The estimated symmetric-equivalent strength of this group is 125 bits.
let ffdhe_params_3072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4096: lseq pub_uint8 512 = of_list list_ffdhe_p4096
// The estimated symmetric-equivalent strength of this group is 150 bits.
let ffdhe_params_4096 : ffdhe_params_t =
Mk_ffdhe_params 512 ffdhe_p4096 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p6144: List.Tot.llist pub_uint8 768 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy; 0x57uy; 0xC9uy; 0x35uy;
0x98uy; 0x4Fuy; 0x0Cuy; 0x70uy; 0xE0uy; 0xE6uy; 0x8Buy; 0x77uy;
0xE2uy; 0xA6uy; 0x89uy; 0xDAuy; 0xF3uy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int8 768 = of_list list_ffdhe_p6144
// The estimated symmetric-equivalent strength of this group is 175 bits.
let ffdhe_params_6144 : ffdhe_params_t =
Mk_ffdhe_params 768 ffdhe_p6144 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p8192: List.Tot.llist pub_uint8 1024 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy; 0x57uy; 0xC9uy; 0x35uy;
0x98uy; 0x4Fuy; 0x0Cuy; 0x70uy; 0xE0uy; 0xE6uy; 0x8Buy; 0x77uy;
0xE2uy; 0xA6uy; 0x89uy; 0xDAuy; 0xF3uy; 0xEFuy;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ADuy; 0x9Auy; 0x95uy; 0xF9uy;
0xD5uy; 0xB8uy; 0x01uy; 0x94uy; 0x88uy; 0xD9uy; 0xC0uy; 0xA0uy;
0xA1uy; 0xFEuy; 0x30uy; 0x75uy; 0xA5uy; 0x77uy; 0xE2uy; 0x31uy;
0x83uy; 0xF8uy; 0x1Duy; 0x4Auy; 0x3Fuy; 0x2Fuy; 0xA4uy; 0x57uy;
0x1Euy; 0xFCuy; 0x8Cuy; 0xE0uy; 0xBAuy; 0x8Auy; 0x4Fuy; 0xE8uy;
0xB6uy; 0x85uy; 0x5Duy; 0xFEuy; 0x72uy; 0xB0uy; 0xA6uy; 0x6Euy;
0xDEuy; 0xD2uy; 0xFBuy; 0xABuy; 0xFBuy; 0xE5uy; 0x8Auy; 0x30uy;
0xFAuy; 0xFAuy; 0xBEuy; 0x1Cuy; 0x5Duy; 0x71uy; 0xA8uy; 0x7Euy;
0x2Fuy; 0x74uy; 0x1Euy; 0xF8uy; 0xC1uy; 0xFEuy; 0x86uy; 0xFEuy;
0xA6uy; 0xBBuy; 0xFDuy; 0xE5uy; 0x30uy; 0x67uy; 0x7Fuy; 0x0Duy;
0x97uy; 0xD1uy; 0x1Duy; 0x49uy; 0xF7uy; 0xA8uy; 0x44uy; 0x3Duy;
0x08uy; 0x22uy; 0xE5uy; 0x06uy; 0xA9uy; 0xF4uy; 0x61uy; 0x4Euy;
0x01uy; 0x1Euy; 0x2Auy; 0x94uy; 0x83uy; 0x8Fuy; 0xF8uy; 0x8Cuy;
0xD6uy; 0x8Cuy; 0x8Buy; 0xB7uy; 0xC5uy; 0xC6uy; 0x42uy; 0x4Cuy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 1024);
l
let ffdhe_p8192: lseq pub_uint8 1024 = of_list list_ffdhe_p8192
// The estimated symmetric-equivalent strength of this group is 192 bits.
let ffdhe_params_8192 : ffdhe_params_t =
Mk_ffdhe_params 1024 ffdhe_p8192 1 ffdhe_g2
type ffdhe_alg =
| FFDHE2048
| FFDHE3072
| FFDHE4096
| FFDHE6144
| FFDHE8192
let get_ffdhe_params (a:ffdhe_alg) : ffdhe_params_t =
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> ffdhe_params_2048
| FFDHE3072 -> ffdhe_params_3072
| FFDHE4096 -> ffdhe_params_4096
| FFDHE6144 -> ffdhe_params_6144
| FFDHE8192 -> ffdhe_params_8192
let ffdhe_len (a:ffdhe_alg) : x:size_pos{x <= 1024} =
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> 256
| FFDHE3072 -> 384
| FFDHE4096 -> 512
| FFDHE6144 -> 768
| FFDHE8192 -> 1024
val ffdhe_g2_lemma: unit -> Lemma (nat_from_bytes_be (of_list list_ffdhe_g2) = 2)
let ffdhe_g2_lemma () =
let g = of_list list_ffdhe_g2 in
assert_norm (Seq.index (Seq.seq_of_list list_ffdhe_g2) 0 = 0x02uy);
nat_from_intseq_be_lemma0 g
val ffdhe_p_lemma0: a:ffdhe_alg -> Lemma
(let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
Seq.index p (len - 1) == 0xffuy)
let ffdhe_p_lemma0 a =
let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 ->
assert (p == of_list list_ffdhe_p2048);
assert_norm (List.Tot.index list_ffdhe_p2048 255 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p2048) 255 == 0xffuy)
| FFDHE3072 ->
assert (p == of_list list_ffdhe_p3072);
assert_norm (List.Tot.index list_ffdhe_p3072 383 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p3072) 383 == 0xffuy)
| FFDHE4096 ->
assert (p == of_list list_ffdhe_p4096);
assert_norm (List.Tot.index list_ffdhe_p4096 511 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p4096) 511 == 0xffuy)
| FFDHE6144 ->
assert (p == of_list list_ffdhe_p6144);
assert_norm (List.Tot.index list_ffdhe_p6144 767 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p6144) 767 == 0xffuy)
| FFDHE8192 ->
assert (p == of_list list_ffdhe_p8192);
assert_norm (List.Tot.index list_ffdhe_p8192 1023 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p8192) 1023 == 0xffuy)
val ffdhe_p_lemma: a:ffdhe_alg -> Lemma
(let ffdhe_p = get_ffdhe_params a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let p_n = nat_from_bytes_be p in
p_n % 2 = 1 /\ 255 <= p_n) // 2 < p_n <==> g_n < p_n
let ffdhe_p_lemma a =
let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let p_n = nat_from_bytes_be p in
nat_from_intseq_be_slice_lemma p (len - 1);
assert (p_n == nat_from_bytes_be (slice p (len - 1) len) + pow2 8 * nat_from_bytes_be (slice p 0 (len - 1)));
nat_from_intseq_be_lemma0 (slice p (len - 1) len);
assert (p_n == v p.[len - 1] + pow2 8 * nat_from_bytes_be (slice p 0 (len - 1)));
ffdhe_p_lemma0 a
// RFC4419: 1 < sk /\ sk < (p - 1) / 2 = q
unfold let ffdhe_sk_t (a:ffdhe_alg) =
sk:lseq uint8 (ffdhe_len a){1 < nat_from_bytes_be sk}
// pk_A = g ^^ sk_A % p | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Spec.FFDHE.ffdhe_alg -> sk: Spec.FFDHE.ffdhe_sk_t a
-> Lib.Sequence.lseq Lib.IntTypes.uint8 (Spec.FFDHE.ffdhe_len a) | Prims.Tot | [
"total"
] | [] | [
"Spec.FFDHE.ffdhe_alg",
"Spec.FFDHE.ffdhe_sk_t",
"Lib.ByteSequence.nat_to_bytes_be",
"Lib.IntTypes.SEC",
"Lib.NatMod.nat_mod",
"Lib.NatMod.pow_mod",
"Prims.unit",
"Spec.FFDHE.ffdhe_p_lemma",
"Spec.FFDHE.ffdhe_g2_lemma",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.pow2",
"Prims.op_Multiply",
"Lib.Sequence.length",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.ByteSequence.nat_from_bytes_be",
"Lib.IntTypes.PUB",
"Lib.Sequence.lseq",
"Spec.FFDHE.__proj__Mk_ffdhe_params__item__ffdhe_p_len",
"Spec.FFDHE.__proj__Mk_ffdhe_params__item__ffdhe_p",
"Spec.FFDHE.__proj__Mk_ffdhe_params__item__ffdhe_g_len",
"Spec.FFDHE.__proj__Mk_ffdhe_params__item__ffdhe_g",
"Prims.pos",
"Prims.op_LessThanOrEqual",
"Prims.op_Subtraction",
"Spec.FFDHE.ffdhe_len",
"Spec.FFDHE.ffdhe_params_t",
"Spec.FFDHE.get_ffdhe_params",
"Lib.IntTypes.uint8"
] | [] | false | false | false | false | false | let ffdhe_secret_to_public a sk =
| let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let g = Mk_ffdhe_params?.ffdhe_g ffdhe_p in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let g_n = nat_from_bytes_be g in
let p_n = nat_from_bytes_be p in
let sk_n = nat_from_bytes_be sk in
ffdhe_g2_lemma ();
ffdhe_p_lemma a;
let pk_n = Lib.NatMod.pow_mod #p_n g_n sk_n in
nat_to_bytes_be len pk_n | false |
Spec.FFDHE.fst | Spec.FFDHE.ffdhe_g2_lemma | val ffdhe_g2_lemma: unit -> Lemma (nat_from_bytes_be (of_list list_ffdhe_g2) = 2) | val ffdhe_g2_lemma: unit -> Lemma (nat_from_bytes_be (of_list list_ffdhe_g2) = 2) | let ffdhe_g2_lemma () =
let g = of_list list_ffdhe_g2 in
assert_norm (Seq.index (Seq.seq_of_list list_ffdhe_g2) 0 = 0x02uy);
nat_from_intseq_be_lemma0 g | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 29,
"end_line": 513,
"start_col": 0,
"start_line": 510
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0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12uy; 0x32uy; 0xEEuy; 0xF2uy; 0x81uy; 0x83uy;
0xC3uy; 0xFEuy; 0x3Buy; 0x1Buy; 0x4Cuy; 0x6Fuy; 0xADuy; 0x73uy;
0x3Buy; 0xB5uy; 0xFCuy; 0xBCuy; 0x2Euy; 0xC2uy; 0x20uy; 0x05uy;
0xC5uy; 0x8Euy; 0xF1uy; 0x83uy; 0x7Duy; 0x16uy; 0x83uy; 0xB2uy;
0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p3072: List.Tot.llist pub_uint8 384 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy;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xF5uy; 0x4Buy; 0xFFuy;
0x5Cuy; 0xAEuy; 0x82uy; 0xABuy; 0x9Cuy; 0x9Duy; 0xF6uy; 0x9Euy;
0xE8uy; 0x6Duy; 0x2Buy; 0xC5uy; 0x22uy; 0x36uy; 0x3Auy; 0x0Duy;
0xABuy; 0xC5uy; 0x21uy; 0x97uy; 0x9Buy; 0x0Duy; 0xEAuy; 0xDAuy;
0x1Duy; 0xBFuy; 0x9Auy; 0x42uy; 0xD5uy; 0xC4uy; 0x48uy; 0x4Euy;
0x0Auy; 0xBCuy; 0xD0uy; 0x6Buy; 0xFAuy; 0x53uy; 0xDDuy; 0xEFuy;
0x3Cuy; 0x1Buy; 0x20uy; 0xEEuy; 0x3Fuy; 0xD5uy; 0x9Duy; 0x7Cuy;
0x25uy; 0xE4uy; 0x1Duy; 0x2Buy; 0x66uy; 0xC6uy; 0x2Euy; 0x37uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 384);
l
let ffdhe_p3072: lseq pub_uint8 384 = of_list list_ffdhe_p3072
// The estimated symmetric-equivalent strength of this group is 125 bits.
let ffdhe_params_3072 : ffdhe_params_t =
Mk_ffdhe_params 384 ffdhe_p3072 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p4096: List.Tot.llist pub_uint8 512 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14u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x0Auy; 0x91uy; 0x81uy; 0x30uy; 0xC4uy;
0x6Duy; 0xC7uy; 0x78uy; 0xF9uy; 0x71uy; 0xADuy; 0x00uy; 0x38uy;
0x09uy; 0x29uy; 0x99uy; 0xA3uy; 0x33uy; 0xCBuy; 0x8Buy; 0x7Auy;
0x1Auy; 0x1Duy; 0xB9uy; 0x3Duy; 0x71uy; 0x40uy; 0x00uy; 0x3Cuy;
0x2Auy; 0x4Euy; 0xCEuy; 0xA9uy; 0xF9uy; 0x8Duy; 0x0Auy; 0xCCuy;
0x0Auy; 0x82uy; 0x91uy; 0xCDuy; 0xCEuy; 0xC9uy; 0x7Duy; 0xCFuy;
0x8Euy; 0xC9uy; 0xB5uy; 0x5Auy; 0x7Fuy; 0x88uy; 0xA4uy; 0x6Buy;
0x4Duy; 0xB5uy; 0xA8uy; 0x51uy; 0xF4uy; 0x41uy; 0x82uy; 0xE1uy;
0xC6uy; 0x8Auy; 0x00uy; 0x7Euy; 0x5Euy; 0x65uy; 0x5Fuy; 0x6Auy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 512);
l
let ffdhe_p4096: lseq pub_uint8 512 = of_list list_ffdhe_p4096
// The estimated symmetric-equivalent strength of this group is 150 bits.
let ffdhe_params_4096 : ffdhe_params_t =
Mk_ffdhe_params 512 ffdhe_p4096 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p6144: List.Tot.llist pub_uint8 768 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x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B8uy; 0x54uy; 0x33uy; 0x8Auy;
0xE4uy; 0x9Fuy; 0x52uy; 0x35uy; 0xC9uy; 0x5Buy; 0x91uy; 0x17uy;
0x8Cuy; 0xCFuy; 0x2Duy; 0xD5uy; 0xCAuy; 0xCEuy; 0xF4uy; 0x03uy;
0xECuy; 0x9Duy; 0x18uy; 0x10uy; 0xC6uy; 0x27uy; 0x2Buy; 0x04uy;
0x5Buy; 0x3Buy; 0x71uy; 0xF9uy; 0xDCuy; 0x6Buy; 0x80uy; 0xD6uy;
0x3Fuy; 0xDDuy; 0x4Auy; 0x8Euy; 0x9Auy; 0xDBuy; 0x1Euy; 0x69uy;
0x62uy; 0xA6uy; 0x95uy; 0x26uy; 0xD4uy; 0x31uy; 0x61uy; 0xC1uy;
0xA4uy; 0x1Duy; 0x57uy; 0x0Duy; 0x79uy; 0x38uy; 0xDAuy; 0xD4uy;
0xA4uy; 0x0Euy; 0x32uy; 0x9Cuy; 0xD0uy; 0xE4uy; 0x0Euy; 0x65uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 768);
l
let ffdhe_p6144: lseq pub_uint8 768 = of_list list_ffdhe_p6144
// The estimated symmetric-equivalent strength of this group is 175 bits.
let ffdhe_params_6144 : ffdhe_params_t =
Mk_ffdhe_params 768 ffdhe_p6144 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p8192: List.Tot.llist pub_uint8 1024 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCE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30uy;
0xFAuy; 0xFAuy; 0xBEuy; 0x1Cuy; 0x5Duy; 0x71uy; 0xA8uy; 0x7Euy;
0x2Fuy; 0x74uy; 0x1Euy; 0xF8uy; 0xC1uy; 0xFEuy; 0x86uy; 0xFEuy;
0xA6uy; 0xBBuy; 0xFDuy; 0xE5uy; 0x30uy; 0x67uy; 0x7Fuy; 0x0Duy;
0x97uy; 0xD1uy; 0x1Duy; 0x49uy; 0xF7uy; 0xA8uy; 0x44uy; 0x3Duy;
0x08uy; 0x22uy; 0xE5uy; 0x06uy; 0xA9uy; 0xF4uy; 0x61uy; 0x4Euy;
0x01uy; 0x1Euy; 0x2Auy; 0x94uy; 0x83uy; 0x8Fuy; 0xF8uy; 0x8Cuy;
0xD6uy; 0x8Cuy; 0x8Buy; 0xB7uy; 0xC5uy; 0xC6uy; 0x42uy; 0x4Cuy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 1024);
l
let ffdhe_p8192: lseq pub_uint8 1024 = of_list list_ffdhe_p8192
// The estimated symmetric-equivalent strength of this group is 192 bits.
let ffdhe_params_8192 : ffdhe_params_t =
Mk_ffdhe_params 1024 ffdhe_p8192 1 ffdhe_g2
type ffdhe_alg =
| FFDHE2048
| FFDHE3072
| FFDHE4096
| FFDHE6144
| FFDHE8192
let get_ffdhe_params (a:ffdhe_alg) : ffdhe_params_t =
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> ffdhe_params_2048
| FFDHE3072 -> ffdhe_params_3072
| FFDHE4096 -> ffdhe_params_4096
| FFDHE6144 -> ffdhe_params_6144
| FFDHE8192 -> ffdhe_params_8192
let ffdhe_len (a:ffdhe_alg) : x:size_pos{x <= 1024} =
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> 256
| FFDHE3072 -> 384
| FFDHE4096 -> 512
| FFDHE6144 -> 768
| FFDHE8192 -> 1024 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures Lib.ByteSequence.nat_from_bytes_be (Lib.Sequence.of_list Spec.FFDHE.list_ffdhe_g2) = 2) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.unit",
"Lib.ByteSequence.nat_from_intseq_be_lemma0",
"Lib.IntTypes.U8",
"Lib.IntTypes.PUB",
"FStar.Pervasives.assert_norm",
"Prims.b2t",
"Prims.op_Equality",
"FStar.UInt8.t",
"FStar.Seq.Base.index",
"Lib.IntTypes.int_t",
"FStar.Seq.Base.seq_of_list",
"Spec.FFDHE.list_ffdhe_g2",
"FStar.UInt8.__uint_to_t",
"Lib.Sequence.lseq",
"FStar.List.Tot.Base.length",
"Prims.eq2",
"FStar.Seq.Base.seq",
"Lib.Sequence.to_seq",
"Lib.Sequence.of_list"
] | [] | true | false | true | false | false | let ffdhe_g2_lemma () =
| let g = of_list list_ffdhe_g2 in
assert_norm (Seq.index (Seq.seq_of_list list_ffdhe_g2) 0 = 0x02uy);
nat_from_intseq_be_lemma0 g | false |
LowParse.Low.ConstInt32.fst | LowParse.Low.ConstInt32.validate_constint32le | val validate_constint32le (v: U32.t{0 <= U32.v v /\ U32.v v < 4294967296})
: Tot (validator (parse_constint32le (U32.v v))) | val validate_constint32le (v: U32.t{0 <= U32.v v /\ U32.v v < 4294967296})
: Tot (validator (parse_constint32le (U32.v v))) | let validate_constint32le
(v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
: Tot (validator (parse_constint32le (U32.v v)))
= fun #rrel #rel (input: slice rrel rel) pos ->
let h = HST.get() in
let _ =
valid_constint32le (U32.v v) h input (uint64_to_uint32 pos);
valid_equiv parse_int32le h input (uint64_to_uint32 pos)
in
if U64.lt (Cast.uint32_to_uint64 input.len `U64.sub` pos) 4uL
then
validator_error_not_enough_data
else
if inplace_compare v input (uint64_to_uint32 pos) then
pos `U64.add` 4uL
else
validator_error_generic | {
"file_name": "src/lowparse/LowParse.Low.ConstInt32.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 29,
"end_line": 230,
"start_col": 0,
"start_line": 214
} | module LowParse.Low.ConstInt32
(* LowParse implementation module for 32 bits contants *)
include FStar.Endianness
include LowParse.Spec.ConstInt32
include LowParse.Spec.Int32le
include LowParse.Low.Combinators
include LowParse.Low.Int32le
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module B = LowStar.Buffer
module Cast = FStar.Int.Cast
module U64 = FStar.UInt64
let valid_constint32le
(v: nat { 0 <= v /\ v < 4294967296 } )
(h: HS.mem)
(#rrel #rel: _)
(input: slice rrel rel)
(pos: U32.t)
: Lemma (valid (parse_constint32le v) h input pos
<==>
(valid parse_int32le h input pos /\
U32.v (contents parse_int32le h input pos) == v))
= valid_facts (parse_constint32le v) h input pos;
valid_facts parse_int32le h input pos;
parse_constint32le_unfold v (bytes_of_slice_from h input pos)
inline_for_extraction
let validate_constint32le_slow
(v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
: Tot (validator (parse_constint32le (U32.v v)))
= fun #rrel #rel (input: slice rrel rel) pos ->
let h = HST.get() in
let _ =
valid_constint32le (U32.v v) h input (uint64_to_uint32 pos);
valid_equiv parse_int32le h input (uint64_to_uint32 pos)
in
if U64.lt (Cast.uint32_to_uint64 input.len `U64.sub` pos) 4uL
then
validator_error_not_enough_data
else
let v' = read_int32le input (uint64_to_uint32 pos) in
if U32.eq v v' then
pos `U64.add` 4uL
else
validator_error_generic
inline_for_extraction
let read_constint32le
(v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
: Tot (leaf_reader (parse_constint32le (U32.v v)))
= fun #rrel #rel input pos ->
v
inline_for_extraction
let decompose_int32le_0
(v: nat { 0 <= v /\ v < 4294967296 } )
: Tot (b0: nat { 0 <= b0 /\ b0 < 256 } )
= v % 256
inline_for_extraction
let decompose_int32le_1
(v: nat { 0 <= v /\ v < 4294967296 } )
: Tot (b1: nat { 0 <= b1 /\ b1 < 256 } )
= v / 256 % 256
inline_for_extraction
let decompose_int32le_2
(v: nat { 0 <= v /\ v < 4294967296 } )
: Tot (b2: nat { 0 <= b2 /\ b2 < 256 } )
= v / 65536 % 256
inline_for_extraction
let decompose_int32le_3
(v: nat { 0 <= v /\ v < 4294967296 } )
: Tot (b3: nat { 0 <= b3 /\ b3 < 256 } )
= v / 16777216
let compose_int32le
(b0: nat { 0 <= b0 /\ b0 < 256 } )
(b1: nat { 0 <= b1 /\ b1 < 256 } )
(b2: nat { 0 <= b2 /\ b2 < 256 } )
(b3: nat { 0 <= b3 /\ b3 < 256 } )
: Tot (v: nat { 0 <= v /\ v < 4294967296 } )
= b0
+ 256 `FStar.Mul.op_Star` (b1
+ 256 `FStar.Mul.op_Star` (b2
+ 256 `FStar.Mul.op_Star` b3))
#push-options "--z3rlimit 16"
let decompose_compose_equiv
(v: nat { 0 <= v /\ v < 4294967296 } )
: Lemma (compose_int32le (decompose_int32le_0 v) (decompose_int32le_1 v) (decompose_int32le_2 v) (decompose_int32le_3 v) == v)
= ()
#pop-options
inline_for_extraction
let compare_by_bytes
(a0: U8.t { 0 <= U8.v a0 /\ U8.v a0 < 256 } )
(a1: U8.t { 0 <= U8.v a1 /\ U8.v a1 < 256 } )
(a2: U8.t { 0 <= U8.v a2 /\ U8.v a2 < 256 } )
(a3: U8.t { 0 <= U8.v a3 /\ U8.v a3 < 256 } )
(b0: U8.t { 0 <= U8.v b0 /\ U8.v b0 < 256 } )
(b1: U8.t { 0 <= U8.v b1 /\ U8.v b1 < 256 } )
(b2: U8.t { 0 <= U8.v b2 /\ U8.v b2 < 256 } )
(b3: U8.t { 0 <= U8.v b3 /\ U8.v b3 < 256 } )
= a0 = b0 && a1 = b1 && a2 = b2 && a3 = b3
let compare_by_bytes'
(a0: U8.t { 0 <= U8.v a0 /\ U8.v a0 < 256 } )
(a1: U8.t { 0 <= U8.v a1 /\ U8.v a1 < 256 } )
(a2: U8.t { 0 <= U8.v a2 /\ U8.v a2 < 256 } )
(a3: U8.t { 0 <= U8.v a3 /\ U8.v a3 < 256 } )
(b0: U8.t { 0 <= U8.v b0 /\ U8.v b0 < 256 } )
(b1: U8.t { 0 <= U8.v b1 /\ U8.v b1 < 256 } )
(b2: U8.t { 0 <= U8.v b2 /\ U8.v b2 < 256 } )
(b3: U8.t { 0 <= U8.v b3 /\ U8.v b3 < 256 } )
= (compose_int32le (U8.v a0) (U8.v a1) (U8.v a2) (U8.v a3)) =
(compose_int32le (U8.v b0) (U8.v b1) (U8.v b2) (U8.v b3))
#push-options "--max_fuel 5 --z3rlimit 64"
let compare_by_bytes_equiv
(a0: U8.t { 0 <= U8.v a0 /\ U8.v a0 < 256 } )
(a1: U8.t { 0 <= U8.v a1 /\ U8.v a1 < 256 } )
(a2: U8.t { 0 <= U8.v a2 /\ U8.v a2 < 256 } )
(a3: U8.t { 0 <= U8.v a3 /\ U8.v a3 < 256 } )
(b0: U8.t { 0 <= U8.v b0 /\ U8.v b0 < 256 } )
(b1: U8.t { 0 <= U8.v b1 /\ U8.v b1 < 256 } )
(b2: U8.t { 0 <= U8.v b2 /\ U8.v b2 < 256 } )
(b3: U8.t { 0 <= U8.v b3 /\ U8.v b3 < 256 } )
: Lemma
((compare_by_bytes a0 a1 a2 a3 b0 b1 b2 b3) ==
compare_by_bytes' a0 a1 a2 a3 b0 b1 b2 b3)
= let a = compose_int32le (U8.v a0) (U8.v a1) (U8.v a2) (U8.v a3) in
let b = compose_int32le (U8.v b0) (U8.v b1) (U8.v b2) (U8.v b3) in
decompose_compose_equiv a;
decompose_compose_equiv b
#pop-options
let decompose_compare
(v1 : nat { 0 <= v1 /\ v1 < 4294967296 } )
(v2 : nat { 0 <= v2 /\ v2 < 4294967296 } )
: Lemma ( (v1 = v2)
== (compare_by_bytes
(U8.uint_to_t (decompose_int32le_0 v1))
(U8.uint_to_t (decompose_int32le_1 v1))
(U8.uint_to_t (decompose_int32le_2 v1))
(U8.uint_to_t (decompose_int32le_3 v1))
(U8.uint_to_t (decompose_int32le_0 v2))
(U8.uint_to_t (decompose_int32le_1 v2))
(U8.uint_to_t (decompose_int32le_2 v2))
(U8.uint_to_t (decompose_int32le_3 v2))))
= let a0 = U8.uint_to_t (decompose_int32le_0 v1) in
let a1 = U8.uint_to_t (decompose_int32le_1 v1) in
let a2 = U8.uint_to_t (decompose_int32le_2 v1) in
let a3 = U8.uint_to_t (decompose_int32le_3 v1) in
let b0 = U8.uint_to_t (decompose_int32le_0 v2) in
let b1 = U8.uint_to_t (decompose_int32le_1 v2) in
let b2 = U8.uint_to_t (decompose_int32le_2 v2) in
let b3 = U8.uint_to_t (decompose_int32le_3 v2) in
compare_by_bytes_equiv a0 a1 a2 a3 b0 b1 b2 b3;
decompose_compose_equiv v1;
decompose_compose_equiv v2
#push-options " --max_fuel 6 --z3rlimit 64 "
inline_for_extraction
let inplace_compare
(v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
(#rrel: _)
(#rel: _)
(input: slice rrel rel)
(pos: U32.t)
: HST.Stack bool
(requires (fun h -> valid parse_int32le h input pos))
(ensures (fun h res h' ->
B.modifies B.loc_none h h' /\
res == (U32.eq (contents parse_int32le h input pos) v)))
= let h = HST.get () in
let b = input.base in
[@inline_let] let _ =
decode_int32le_eq (Seq.slice (B.as_seq h b) (U32.v pos) (U32.v pos + 4));
decode_int32le_total_constant ();
valid_facts parse_int32le h input pos;
[@inline_let] let v' = contents parse_int32le h input pos in
decompose_compose_equiv (U32.v v);
decompose_compose_equiv (U32.v v');
decompose_compare (U32.v v) (U32.v v')
in
let r0 = B.index b pos in
let r1 = B.index b (pos `U32.add` 1ul) in
let r2 = B.index b (pos `U32.add` 2ul) in
let r3 = B.index b (pos `U32.add` 3ul) in
[@inline_let] let b0 = U8.uint_to_t (decompose_int32le_0 (U32.v v)) in
[@inline_let] let b1 = U8.uint_to_t (decompose_int32le_1 (U32.v v)) in
[@inline_let] let b2 = U8.uint_to_t (decompose_int32le_2 (U32.v v)) in
[@inline_let] let b3 = U8.uint_to_t (decompose_int32le_3 (U32.v v)) in
compare_by_bytes r0 r1 r2 r3 b0 b1 b2 b3
#pop-options | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.Int32le.fst.checked",
"LowParse.Spec.ConstInt32.fst.checked",
"LowParse.Low.Int32le.fst.checked",
"LowParse.Low.Combinators.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Endianness.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.ConstInt32.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Int32le",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Int32le",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.ConstInt32",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Endianness",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | v: FStar.UInt32.t{0 <= FStar.UInt32.v v /\ FStar.UInt32.v v < 4294967296}
-> LowParse.Low.Base.validator (LowParse.Spec.ConstInt32.parse_constint32le (FStar.UInt32.v v)) | Prims.Tot | [
"total"
] | [] | [
"FStar.UInt32.t",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.UInt32.v",
"Prims.op_LessThan",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"FStar.UInt64.t",
"FStar.UInt64.lt",
"FStar.UInt64.sub",
"FStar.Int.Cast.uint32_to_uint64",
"LowParse.Slice.__proj__Mkslice__item__len",
"FStar.UInt64.__uint_to_t",
"LowParse.Low.ErrorCode.validator_error_not_enough_data",
"Prims.bool",
"FStar.UInt64.add",
"LowParse.Low.ErrorCode.validator_error_generic",
"LowParse.Low.ConstInt32.inplace_compare",
"LowParse.Low.ErrorCode.uint64_to_uint32",
"Prims.unit",
"LowParse.Low.Base.Spec.valid_equiv",
"LowParse.Spec.Base.total_constant_size_parser_kind",
"LowParse.Spec.Int32le.parse_int32le",
"LowParse.Low.ConstInt32.valid_constint32le",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"LowParse.Low.Base.validator",
"LowParse.Spec.ConstInt32.parse_constint32le_kind",
"LowParse.Spec.ConstInt32.constint32",
"LowParse.Spec.ConstInt32.parse_constint32le"
] | [] | false | false | false | false | false | let validate_constint32le (v: U32.t{0 <= U32.v v /\ U32.v v < 4294967296})
: Tot (validator (parse_constint32le (U32.v v))) =
| fun #rrel #rel (input: slice rrel rel) pos ->
let h = HST.get () in
let _ =
valid_constint32le (U32.v v) h input (uint64_to_uint32 pos);
valid_equiv parse_int32le h input (uint64_to_uint32 pos)
in
if U64.lt ((Cast.uint32_to_uint64 input.len) `U64.sub` pos) 4uL
then validator_error_not_enough_data
else
if inplace_compare v input (uint64_to_uint32 pos)
then pos `U64.add` 4uL
else validator_error_generic | false |
Spec.FFDHE.fst | Spec.FFDHE.ffdhe_shared_secret | val ffdhe_shared_secret:
a:ffdhe_alg
-> sk:ffdhe_sk_t a
-> pk:lseq uint8 (ffdhe_len a) ->
option (lseq uint8 (ffdhe_len a)) | val ffdhe_shared_secret:
a:ffdhe_alg
-> sk:ffdhe_sk_t a
-> pk:lseq uint8 (ffdhe_len a) ->
option (lseq uint8 (ffdhe_len a)) | let ffdhe_shared_secret a sk pk =
let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let p_n = nat_from_bytes_be p in
let sk_n = nat_from_bytes_be sk in
let pk_n = nat_from_bytes_be pk in
if 1 < pk_n && pk_n < p_n - 1 then begin
ffdhe_p_lemma a;
let ss_n = Lib.NatMod.pow_mod #p_n pk_n sk_n in
let ss = nat_to_bytes_be len ss_n in
Some ss end
else None | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 11,
"end_line": 616,
"start_col": 0,
"start_line": 602
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 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; 0xBCuy; 0x2Euy; 0xC2uy; 0x20uy; 0x05uy;
0xC5uy; 0x8Euy; 0xF1uy; 0x83uy; 0x7Duy; 0x16uy; 0x83uy; 0xB2uy;
0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p3072: List.Tot.llist pub_uint8 384 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5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36uy; 0x3Auy; 0x0Duy;
0xABuy; 0xC5uy; 0x21uy; 0x97uy; 0x9Buy; 0x0Duy; 0xEAuy; 0xDAuy;
0x1Duy; 0xBFuy; 0x9Auy; 0x42uy; 0xD5uy; 0xC4uy; 0x48uy; 0x4Euy;
0x0Auy; 0xBCuy; 0xD0uy; 0x6Buy; 0xFAuy; 0x53uy; 0xDDuy; 0xEFuy;
0x3Cuy; 0x1Buy; 0x20uy; 0xEEuy; 0x3Fuy; 0xD5uy; 0x9Duy; 0x7Cuy;
0x25uy; 0xE4uy; 0x1Duy; 0x2Buy; 0x66uy; 0xC6uy; 0x2Euy; 0x37uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 384);
l
let ffdhe_p3072: lseq pub_uint8 384 = of_list list_ffdhe_p3072
// The estimated symmetric-equivalent strength of this group is 125 bits.
let ffdhe_params_3072 : ffdhe_params_t =
Mk_ffdhe_params 384 ffdhe_p3072 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p4096: List.Tot.llist pub_uint8 512 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x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y; 0xCBuy; 0x8Buy; 0x7Auy;
0x1Auy; 0x1Duy; 0xB9uy; 0x3Duy; 0x71uy; 0x40uy; 0x00uy; 0x3Cuy;
0x2Auy; 0x4Euy; 0xCEuy; 0xA9uy; 0xF9uy; 0x8Duy; 0x0Auy; 0xCCuy;
0x0Auy; 0x82uy; 0x91uy; 0xCDuy; 0xCEuy; 0xC9uy; 0x7Duy; 0xCFuy;
0x8Euy; 0xC9uy; 0xB5uy; 0x5Auy; 0x7Fuy; 0x88uy; 0xA4uy; 0x6Buy;
0x4Duy; 0xB5uy; 0xA8uy; 0x51uy; 0xF4uy; 0x41uy; 0x82uy; 0xE1uy;
0xC6uy; 0x8Auy; 0x00uy; 0x7Euy; 0x5Euy; 0x65uy; 0x5Fuy; 0x6Auy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 512);
l
let ffdhe_p4096: lseq pub_uint8 512 = of_list list_ffdhe_p4096
// The estimated symmetric-equivalent strength of this group is 150 bits.
let ffdhe_params_4096 : ffdhe_params_t =
Mk_ffdhe_params 512 ffdhe_p4096 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p6144: List.Tot.llist pub_uint8 768 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24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; 0xCEuy; 0xF4uy; 0x03uy;
0xECuy; 0x9Duy; 0x18uy; 0x10uy; 0xC6uy; 0x27uy; 0x2Buy; 0x04uy;
0x5Buy; 0x3Buy; 0x71uy; 0xF9uy; 0xDCuy; 0x6Buy; 0x80uy; 0xD6uy;
0x3Fuy; 0xDDuy; 0x4Auy; 0x8Euy; 0x9Auy; 0xDBuy; 0x1Euy; 0x69uy;
0x62uy; 0xA6uy; 0x95uy; 0x26uy; 0xD4uy; 0x31uy; 0x61uy; 0xC1uy;
0xA4uy; 0x1Duy; 0x57uy; 0x0Duy; 0x79uy; 0x38uy; 0xDAuy; 0xD4uy;
0xA4uy; 0x0Euy; 0x32uy; 0x9Cuy; 0xD0uy; 0xE4uy; 0x0Euy; 0x65uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 768);
l
let ffdhe_p6144: lseq pub_uint8 768 = of_list list_ffdhe_p6144
// The estimated symmetric-equivalent strength of this group is 175 bits.
let ffdhe_params_6144 : ffdhe_params_t =
Mk_ffdhe_params 768 ffdhe_p6144 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p8192: List.Tot.llist pub_uint8 1024 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Bu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uy;
0xA6uy; 0xBBuy; 0xFDuy; 0xE5uy; 0x30uy; 0x67uy; 0x7Fuy; 0x0Duy;
0x97uy; 0xD1uy; 0x1Duy; 0x49uy; 0xF7uy; 0xA8uy; 0x44uy; 0x3Duy;
0x08uy; 0x22uy; 0xE5uy; 0x06uy; 0xA9uy; 0xF4uy; 0x61uy; 0x4Euy;
0x01uy; 0x1Euy; 0x2Auy; 0x94uy; 0x83uy; 0x8Fuy; 0xF8uy; 0x8Cuy;
0xD6uy; 0x8Cuy; 0x8Buy; 0xB7uy; 0xC5uy; 0xC6uy; 0x42uy; 0x4Cuy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 1024);
l
let ffdhe_p8192: lseq pub_uint8 1024 = of_list list_ffdhe_p8192
// The estimated symmetric-equivalent strength of this group is 192 bits.
let ffdhe_params_8192 : ffdhe_params_t =
Mk_ffdhe_params 1024 ffdhe_p8192 1 ffdhe_g2
type ffdhe_alg =
| FFDHE2048
| FFDHE3072
| FFDHE4096
| FFDHE6144
| FFDHE8192
let get_ffdhe_params (a:ffdhe_alg) : ffdhe_params_t =
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> ffdhe_params_2048
| FFDHE3072 -> ffdhe_params_3072
| FFDHE4096 -> ffdhe_params_4096
| FFDHE6144 -> ffdhe_params_6144
| FFDHE8192 -> ffdhe_params_8192
let ffdhe_len (a:ffdhe_alg) : x:size_pos{x <= 1024} =
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> 256
| FFDHE3072 -> 384
| FFDHE4096 -> 512
| FFDHE6144 -> 768
| FFDHE8192 -> 1024
val ffdhe_g2_lemma: unit -> Lemma (nat_from_bytes_be (of_list list_ffdhe_g2) = 2)
let ffdhe_g2_lemma () =
let g = of_list list_ffdhe_g2 in
assert_norm (Seq.index (Seq.seq_of_list list_ffdhe_g2) 0 = 0x02uy);
nat_from_intseq_be_lemma0 g
val ffdhe_p_lemma0: a:ffdhe_alg -> Lemma
(let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
Seq.index p (len - 1) == 0xffuy)
let ffdhe_p_lemma0 a =
let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 ->
assert (p == of_list list_ffdhe_p2048);
assert_norm (List.Tot.index list_ffdhe_p2048 255 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p2048) 255 == 0xffuy)
| FFDHE3072 ->
assert (p == of_list list_ffdhe_p3072);
assert_norm (List.Tot.index list_ffdhe_p3072 383 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p3072) 383 == 0xffuy)
| FFDHE4096 ->
assert (p == of_list list_ffdhe_p4096);
assert_norm (List.Tot.index list_ffdhe_p4096 511 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p4096) 511 == 0xffuy)
| FFDHE6144 ->
assert (p == of_list list_ffdhe_p6144);
assert_norm (List.Tot.index list_ffdhe_p6144 767 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p6144) 767 == 0xffuy)
| FFDHE8192 ->
assert (p == of_list list_ffdhe_p8192);
assert_norm (List.Tot.index list_ffdhe_p8192 1023 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p8192) 1023 == 0xffuy)
val ffdhe_p_lemma: a:ffdhe_alg -> Lemma
(let ffdhe_p = get_ffdhe_params a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let p_n = nat_from_bytes_be p in
p_n % 2 = 1 /\ 255 <= p_n) // 2 < p_n <==> g_n < p_n
let ffdhe_p_lemma a =
let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let p_n = nat_from_bytes_be p in
nat_from_intseq_be_slice_lemma p (len - 1);
assert (p_n == nat_from_bytes_be (slice p (len - 1) len) + pow2 8 * nat_from_bytes_be (slice p 0 (len - 1)));
nat_from_intseq_be_lemma0 (slice p (len - 1) len);
assert (p_n == v p.[len - 1] + pow2 8 * nat_from_bytes_be (slice p 0 (len - 1)));
ffdhe_p_lemma0 a
// RFC4419: 1 < sk /\ sk < (p - 1) / 2 = q
unfold let ffdhe_sk_t (a:ffdhe_alg) =
sk:lseq uint8 (ffdhe_len a){1 < nat_from_bytes_be sk}
// pk_A = g ^^ sk_A % p
val ffdhe_secret_to_public: a:ffdhe_alg -> sk:ffdhe_sk_t a -> lseq uint8 (ffdhe_len a)
let ffdhe_secret_to_public a sk =
let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let g = Mk_ffdhe_params?.ffdhe_g ffdhe_p in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let g_n = nat_from_bytes_be g in
let p_n = nat_from_bytes_be p in
let sk_n = nat_from_bytes_be sk in
ffdhe_g2_lemma ();
ffdhe_p_lemma a;
let pk_n = Lib.NatMod.pow_mod #p_n g_n sk_n in
nat_to_bytes_be len pk_n
(** 5.1. Checking the Peer's Public Key
Peers MUST validate each other's public key Y (dh_Ys offered by the
server or dh_Yc offered by the client) by ensuring that 1 < Y < p-1. *)
// ss = pk_B ^^ sk_A % p
val ffdhe_shared_secret:
a:ffdhe_alg
-> sk:ffdhe_sk_t a
-> pk:lseq uint8 (ffdhe_len a) ->
option (lseq uint8 (ffdhe_len a)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
a: Spec.FFDHE.ffdhe_alg ->
sk: Spec.FFDHE.ffdhe_sk_t a ->
pk: Lib.Sequence.lseq Lib.IntTypes.uint8 (Spec.FFDHE.ffdhe_len a)
-> FStar.Pervasives.Native.option (Lib.Sequence.lseq Lib.IntTypes.uint8 (Spec.FFDHE.ffdhe_len a)) | Prims.Tot | [
"total"
] | [] | [
"Spec.FFDHE.ffdhe_alg",
"Spec.FFDHE.ffdhe_sk_t",
"Lib.Sequence.lseq",
"Lib.IntTypes.uint8",
"Spec.FFDHE.ffdhe_len",
"Prims.op_AmpAmp",
"Prims.op_LessThan",
"Prims.op_Subtraction",
"FStar.Pervasives.Native.Some",
"Lib.Sequence.seq",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Prims.l_and",
"Prims.eq2",
"Prims.nat",
"Lib.Sequence.length",
"Prims.l_or",
"Prims.b2t",
"Prims.pow2",
"Prims.op_Multiply",
"Lib.ByteSequence.nat_from_intseq_be",
"Lib.ByteSequence.nat_to_bytes_be",
"Lib.NatMod.nat_mod",
"Lib.NatMod.pow_mod",
"Prims.unit",
"Spec.FFDHE.ffdhe_p_lemma",
"Prims.bool",
"FStar.Pervasives.Native.None",
"FStar.Pervasives.Native.option",
"Lib.ByteSequence.nat_from_bytes_be",
"Lib.IntTypes.PUB",
"Spec.FFDHE.__proj__Mk_ffdhe_params__item__ffdhe_p_len",
"Spec.FFDHE.__proj__Mk_ffdhe_params__item__ffdhe_p",
"Prims.pos",
"Prims.op_LessThanOrEqual",
"Spec.FFDHE.ffdhe_params_t",
"Spec.FFDHE.get_ffdhe_params"
] | [] | false | false | false | false | false | let ffdhe_shared_secret a sk pk =
| let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let p_n = nat_from_bytes_be p in
let sk_n = nat_from_bytes_be sk in
let pk_n = nat_from_bytes_be pk in
if 1 < pk_n && pk_n < p_n - 1
then
(ffdhe_p_lemma a;
let ss_n = Lib.NatMod.pow_mod #p_n pk_n sk_n in
let ss = nat_to_bytes_be len ss_n in
Some ss)
else None | false |
Spec.FFDHE.fst | Spec.FFDHE.ffdhe_p_lemma | val ffdhe_p_lemma: a:ffdhe_alg -> Lemma
(let ffdhe_p = get_ffdhe_params a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let p_n = nat_from_bytes_be p in
p_n % 2 = 1 /\ 255 <= p_n) | val ffdhe_p_lemma: a:ffdhe_alg -> Lemma
(let ffdhe_p = get_ffdhe_params a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let p_n = nat_from_bytes_be p in
p_n % 2 = 1 /\ 255 <= p_n) | let ffdhe_p_lemma a =
let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let p_n = nat_from_bytes_be p in
nat_from_intseq_be_slice_lemma p (len - 1);
assert (p_n == nat_from_bytes_be (slice p (len - 1) len) + pow2 8 * nat_from_bytes_be (slice p 0 (len - 1)));
nat_from_intseq_be_lemma0 (slice p (len - 1) len);
assert (p_n == v p.[len - 1] + pow2 8 * nat_from_bytes_be (slice p 0 (len - 1)));
ffdhe_p_lemma0 a | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 18,
"end_line": 567,
"start_col": 0,
"start_line": 557
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAF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y; 0xF4uy; 0x68uy;
0x1Duy; 0x4Fuy; 0x42uy; 0xA3uy; 0xDEuy; 0x39uy; 0x4Duy; 0xF4uy;
0xAEuy; 0x56uy; 0xEDuy; 0xE7uy; 0x63uy; 0x72uy; 0xBBuy; 0x19uy;
0x0Buy; 0x07uy; 0xA7uy; 0xC8uy; 0xEEuy; 0x0Auy; 0x6Duy; 0x70uy;
0x9Euy; 0x02uy; 0xFCuy; 0xE1uy; 0xCDuy; 0xF7uy; 0xE2uy; 0xECuy;
0xC0uy; 0x34uy; 0x04uy; 0xCDuy; 0x28uy; 0x34uy; 0x2Fuy; 0x61uy;
0x91uy; 0x72uy; 0xFEuy; 0x9Cuy; 0xE9uy; 0x85uy; 0x83uy; 0xFFuy;
0x8Euy; 0x4Fuy; 0x12uy; 0x32uy; 0xEEuy; 0xF2uy; 0x81uy; 0x83uy;
0xC3uy; 0xFEuy; 0x3Buy; 0x1Buy; 0x4Cuy; 0x6Fuy; 0xADuy; 0x73uy;
0x3Buy; 0xB5uy; 0xFCuy; 0xBCuy; 0x2Euy; 0xC2uy; 0x20uy; 0x05uy;
0xC5uy; 0x8Euy; 0xF1uy; 0x83uy; 0x7Duy; 0x16uy; 0x83uy; 0xB2uy;
0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p3072: List.Tot.llist pub_uint8 384 =
[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uy; 0xB4uy; 0x6Fuy; 0xC9uy; 0xD6uy; 0xE6uy; 0xC9uy; 0x07uy;
0x7Auy; 0xD9uy; 0x1Duy; 0x26uy; 0x91uy; 0xF7uy; 0xF7uy; 0xEEuy;
0x59uy; 0x8Cuy; 0xB0uy; 0xFAuy; 0xC1uy; 0x86uy; 0xD9uy; 0x1Cuy;
0xAEuy; 0xFEuy; 0x13uy; 0x09uy; 0x85uy; 0x13uy; 0x92uy; 0x70uy;
0xB4uy; 0x13uy; 0x0Cuy; 0x93uy; 0xBCuy; 0x43uy; 0x79uy; 0x44uy;
0xF4uy; 0xFDuy; 0x44uy; 0x52uy; 0xE2uy; 0xD7uy; 0x4Duy; 0xD3uy;
0x64uy; 0xF2uy; 0xE2uy; 0x1Euy; 0x71uy; 0xF5uy; 0x4Buy; 0xFFuy;
0x5Cuy; 0xAEuy; 0x82uy; 0xABuy; 0x9Cuy; 0x9Duy; 0xF6uy; 0x9Euy;
0xE8uy; 0x6Duy; 0x2Buy; 0xC5uy; 0x22uy; 0x36uy; 0x3Auy; 0x0Duy;
0xABuy; 0xC5uy; 0x21uy; 0x97uy; 0x9Buy; 0x0Duy; 0xEAuy; 0xDAuy;
0x1Duy; 0xBFuy; 0x9Auy; 0x42uy; 0xD5uy; 0xC4uy; 0x48uy; 0x4Euy;
0x0Auy; 0xBCuy; 0xD0uy; 0x6Buy; 0xFAuy; 0x53uy; 0xDDuy; 0xEFuy;
0x3Cuy; 0x1Buy; 0x20uy; 0xEEuy; 0x3Fuy; 0xD5uy; 0x9Duy; 0x7Cuy;
0x25uy; 0xE4uy; 0x1Duy; 0x2Buy; 0x66uy; 0xC6uy; 0x2Euy; 0x37uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 384);
l
let ffdhe_p3072: lseq pub_uint8 384 = of_list list_ffdhe_p3072
// The estimated symmetric-equivalent strength of this group is 125 bits.
let ffdhe_params_3072 : ffdhe_params_t =
Mk_ffdhe_params 384 ffdhe_p3072 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p4096: List.Tot.llist pub_uint8 512 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy; 0x57uy; 0xC9uy; 0x35uy;
0x98uy; 0x4Fuy; 0x0Cuy; 0x70uy; 0xE0uy; 0xE6uy; 0x8Buy; 0x77uy;
0xE2uy; 0xA6uy; 0x89uy; 0xDAuy; 0xF3uy; 0xEFuy; 0xE8uy; 0x72uy;
0x1Duy; 0xF1uy; 0x58uy; 0xA1uy; 0x36uy;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ffdhe_p4096: lseq pub_uint8 512 = of_list list_ffdhe_p4096
// The estimated symmetric-equivalent strength of this group is 150 bits.
let ffdhe_params_4096 : ffdhe_params_t =
Mk_ffdhe_params 512 ffdhe_p4096 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p6144: List.Tot.llist pub_uint8 768 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy; 0x57uy; 0xC9uy; 0x35uy;
0x98uy; 0x4Fuy; 0x0Cuy; 0x70uy; 0xE0uy; 0xE6uy; 0x8Buy; 0x77uy;
0xE2uy; 0xA6uy; 0x89uy; 0xDAuy;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lseq pub_uint8 768 = of_list list_ffdhe_p6144
// The estimated symmetric-equivalent strength of this group is 175 bits.
let ffdhe_params_6144 : ffdhe_params_t =
Mk_ffdhe_params 768 ffdhe_p6144 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p8192: List.Tot.llist pub_uint8 1024 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy; 0x57uy; 0xC9uy; 0x35uy;
0x98uy; 0x4Fuy; 0x0Cuy; 0x70uy; 0xE0uy; 0xE6uy; 0x8Buy; 0x77uy;
0xE2uy; 0xA6uy; 0x89uy; 0xDAuy; 0xF3uy; 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Duy; 0xADuy; 0x9Auy; 0x95uy; 0xF9uy;
0xD5uy; 0xB8uy; 0x01uy; 0x94uy; 0x88uy; 0xD9uy; 0xC0uy; 0xA0uy;
0xA1uy; 0xFEuy; 0x30uy; 0x75uy; 0xA5uy; 0x77uy; 0xE2uy; 0x31uy;
0x83uy; 0xF8uy; 0x1Duy; 0x4Auy; 0x3Fuy; 0x2Fuy; 0xA4uy; 0x57uy;
0x1Euy; 0xFCuy; 0x8Cuy; 0xE0uy; 0xBAuy; 0x8Auy; 0x4Fuy; 0xE8uy;
0xB6uy; 0x85uy; 0x5Duy; 0xFEuy; 0x72uy; 0xB0uy; 0xA6uy; 0x6Euy;
0xDEuy; 0xD2uy; 0xFBuy; 0xABuy; 0xFBuy; 0xE5uy; 0x8Auy; 0x30uy;
0xFAuy; 0xFAuy; 0xBEuy; 0x1Cuy; 0x5Duy; 0x71uy; 0xA8uy; 0x7Euy;
0x2Fuy; 0x74uy; 0x1Euy; 0xF8uy; 0xC1uy; 0xFEuy; 0x86uy; 0xFEuy;
0xA6uy; 0xBBuy; 0xFDuy; 0xE5uy; 0x30uy; 0x67uy; 0x7Fuy; 0x0Duy;
0x97uy; 0xD1uy; 0x1Duy; 0x49uy; 0xF7uy; 0xA8uy; 0x44uy; 0x3Duy;
0x08uy; 0x22uy; 0xE5uy; 0x06uy; 0xA9uy; 0xF4uy; 0x61uy; 0x4Euy;
0x01uy; 0x1Euy; 0x2Auy; 0x94uy; 0x83uy; 0x8Fuy; 0xF8uy; 0x8Cuy;
0xD6uy; 0x8Cuy; 0x8Buy; 0xB7uy; 0xC5uy; 0xC6uy; 0x42uy; 0x4Cuy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 1024);
l
let ffdhe_p8192: lseq pub_uint8 1024 = of_list list_ffdhe_p8192
// The estimated symmetric-equivalent strength of this group is 192 bits.
let ffdhe_params_8192 : ffdhe_params_t =
Mk_ffdhe_params 1024 ffdhe_p8192 1 ffdhe_g2
type ffdhe_alg =
| FFDHE2048
| FFDHE3072
| FFDHE4096
| FFDHE6144
| FFDHE8192
let get_ffdhe_params (a:ffdhe_alg) : ffdhe_params_t =
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> ffdhe_params_2048
| FFDHE3072 -> ffdhe_params_3072
| FFDHE4096 -> ffdhe_params_4096
| FFDHE6144 -> ffdhe_params_6144
| FFDHE8192 -> ffdhe_params_8192
let ffdhe_len (a:ffdhe_alg) : x:size_pos{x <= 1024} =
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 -> 256
| FFDHE3072 -> 384
| FFDHE4096 -> 512
| FFDHE6144 -> 768
| FFDHE8192 -> 1024
val ffdhe_g2_lemma: unit -> Lemma (nat_from_bytes_be (of_list list_ffdhe_g2) = 2)
let ffdhe_g2_lemma () =
let g = of_list list_ffdhe_g2 in
assert_norm (Seq.index (Seq.seq_of_list list_ffdhe_g2) 0 = 0x02uy);
nat_from_intseq_be_lemma0 g
val ffdhe_p_lemma0: a:ffdhe_alg -> Lemma
(let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
Seq.index p (len - 1) == 0xffuy)
let ffdhe_p_lemma0 a =
let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
allow_inversion ffdhe_alg;
match a with
| FFDHE2048 ->
assert (p == of_list list_ffdhe_p2048);
assert_norm (List.Tot.index list_ffdhe_p2048 255 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p2048) 255 == 0xffuy)
| FFDHE3072 ->
assert (p == of_list list_ffdhe_p3072);
assert_norm (List.Tot.index list_ffdhe_p3072 383 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p3072) 383 == 0xffuy)
| FFDHE4096 ->
assert (p == of_list list_ffdhe_p4096);
assert_norm (List.Tot.index list_ffdhe_p4096 511 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p4096) 511 == 0xffuy)
| FFDHE6144 ->
assert (p == of_list list_ffdhe_p6144);
assert_norm (List.Tot.index list_ffdhe_p6144 767 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p6144) 767 == 0xffuy)
| FFDHE8192 ->
assert (p == of_list list_ffdhe_p8192);
assert_norm (List.Tot.index list_ffdhe_p8192 1023 == 0xffuy);
assert (Seq.index (Seq.seq_of_list list_ffdhe_p8192) 1023 == 0xffuy)
val ffdhe_p_lemma: a:ffdhe_alg -> Lemma
(let ffdhe_p = get_ffdhe_params a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let p_n = nat_from_bytes_be p in
p_n % 2 = 1 /\ 255 <= p_n) // 2 < p_n <==> g_n < p_n | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Spec.FFDHE.ffdhe_alg
-> FStar.Pervasives.Lemma
(ensures
(let ffdhe_p = Spec.FFDHE.get_ffdhe_params a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let p_n = Lib.ByteSequence.nat_from_bytes_be p in
p_n % 2 = 1 /\ 255 <= p_n)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.FFDHE.ffdhe_alg",
"Spec.FFDHE.ffdhe_p_lemma0",
"Prims.unit",
"Prims._assert",
"Prims.eq2",
"Prims.int",
"Prims.op_Addition",
"Lib.IntTypes.v",
"Lib.IntTypes.U8",
"Lib.IntTypes.PUB",
"Lib.Sequence.op_String_Access",
"Lib.IntTypes.pub_uint8",
"Spec.FFDHE.__proj__Mk_ffdhe_params__item__ffdhe_p_len",
"Prims.op_Subtraction",
"FStar.Mul.op_Star",
"Prims.pow2",
"Lib.ByteSequence.nat_from_bytes_be",
"Lib.Sequence.slice",
"Lib.ByteSequence.nat_from_intseq_be_lemma0",
"Lib.ByteSequence.nat_from_intseq_be_slice_lemma",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.op_Multiply",
"Lib.Sequence.length",
"Lib.IntTypes.int_t",
"Lib.Sequence.lseq",
"Spec.FFDHE.__proj__Mk_ffdhe_params__item__ffdhe_p",
"Prims.pos",
"Prims.op_LessThanOrEqual",
"Spec.FFDHE.ffdhe_len",
"Spec.FFDHE.ffdhe_params_t",
"Spec.FFDHE.get_ffdhe_params"
] | [] | true | false | true | false | false | let ffdhe_p_lemma a =
| let ffdhe_p = get_ffdhe_params a in
let len = ffdhe_len a in
let p = Mk_ffdhe_params?.ffdhe_p ffdhe_p in
let p_n = nat_from_bytes_be p in
nat_from_intseq_be_slice_lemma p (len - 1);
assert (p_n ==
nat_from_bytes_be (slice p (len - 1) len) + pow2 8 * nat_from_bytes_be (slice p 0 (len - 1)));
nat_from_intseq_be_lemma0 (slice p (len - 1) len);
assert (p_n == v p.[ len - 1 ] + pow2 8 * nat_from_bytes_be (slice p 0 (len - 1)));
ffdhe_p_lemma0 a | false |
FStar.Modifies.fsti | FStar.Modifies.loc_all_regions_from | val loc_all_regions_from (preserve_liveness: bool) (r: HS.rid) : GTot loc | val loc_all_regions_from (preserve_liveness: bool) (r: HS.rid) : GTot loc | let loc_all_regions_from
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (HS.mod_set (Set.singleton r)) | {
"file_name": "ulib/FStar.Modifies.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 62,
"end_line": 103,
"start_col": 0,
"start_line": 99
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Modifies
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module B = FStar.Buffer
(*** The modifies clause *)
val loc : Type u#1
val loc_none: loc
val loc_union
(s1 s2: loc)
: GTot loc
(** The following is useful to make Z3 cut matching loops with
modifies_trans and modifies_refl *)
val loc_union_idem
(s: loc)
: Lemma
(loc_union s s == s)
[SMTPat (loc_union s s)]
val loc_union_comm
(s1 s2: loc)
: Lemma
(loc_union s1 s2 == loc_union s2 s1)
[SMTPat (loc_union s1 s2)]
val loc_union_assoc
(s1 s2 s3: loc)
: Lemma
(loc_union s1 (loc_union s2 s3) == loc_union (loc_union s1 s2) s3)
val loc_union_loc_none_l
(s: loc)
: Lemma
(loc_union loc_none s == s)
[SMTPat (loc_union loc_none s)]
val loc_union_loc_none_r
(s: loc)
: Lemma
(loc_union s loc_none == s)
[SMTPat (loc_union s loc_none)]
val loc_buffer
(#t: Type)
(b: B.buffer t)
: GTot loc
val loc_addresses
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: GTot loc
val loc_regions
(preserve_liveness: bool)
(r: Set.set HS.rid)
: GTot loc
let loc_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses true (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_freed_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses false (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_region_only
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (Set.singleton r) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.ModifiesGen.fsti.checked",
"FStar.Map.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Heap.fst.checked",
"FStar.Classical.fsti.checked",
"FStar.Buffer.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Modifies.fsti"
} | [
{
"abbrev": true,
"full_module": "FStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | preserve_liveness: Prims.bool -> r: FStar.Monotonic.HyperHeap.rid -> Prims.GTot FStar.Modifies.loc | Prims.GTot | [
"sometrivial"
] | [] | [
"Prims.bool",
"FStar.Monotonic.HyperHeap.rid",
"FStar.Modifies.loc_regions",
"FStar.Monotonic.HyperHeap.mod_set",
"FStar.Set.singleton",
"FStar.Modifies.loc"
] | [] | false | false | false | false | false | let loc_all_regions_from (preserve_liveness: bool) (r: HS.rid) : GTot loc =
| loc_regions preserve_liveness (HS.mod_set (Set.singleton r)) | false |
FStar.Modifies.fsti | FStar.Modifies.loc_region_only | val loc_region_only (preserve_liveness: bool) (r: HS.rid) : GTot loc | val loc_region_only (preserve_liveness: bool) (r: HS.rid) : GTot loc | let loc_region_only
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (Set.singleton r) | {
"file_name": "ulib/FStar.Modifies.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 49,
"end_line": 97,
"start_col": 0,
"start_line": 93
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Modifies
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module B = FStar.Buffer
(*** The modifies clause *)
val loc : Type u#1
val loc_none: loc
val loc_union
(s1 s2: loc)
: GTot loc
(** The following is useful to make Z3 cut matching loops with
modifies_trans and modifies_refl *)
val loc_union_idem
(s: loc)
: Lemma
(loc_union s s == s)
[SMTPat (loc_union s s)]
val loc_union_comm
(s1 s2: loc)
: Lemma
(loc_union s1 s2 == loc_union s2 s1)
[SMTPat (loc_union s1 s2)]
val loc_union_assoc
(s1 s2 s3: loc)
: Lemma
(loc_union s1 (loc_union s2 s3) == loc_union (loc_union s1 s2) s3)
val loc_union_loc_none_l
(s: loc)
: Lemma
(loc_union loc_none s == s)
[SMTPat (loc_union loc_none s)]
val loc_union_loc_none_r
(s: loc)
: Lemma
(loc_union s loc_none == s)
[SMTPat (loc_union s loc_none)]
val loc_buffer
(#t: Type)
(b: B.buffer t)
: GTot loc
val loc_addresses
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: GTot loc
val loc_regions
(preserve_liveness: bool)
(r: Set.set HS.rid)
: GTot loc
let loc_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses true (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_freed_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses false (HS.frameOf b) (Set.singleton (HS.as_addr b)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.ModifiesGen.fsti.checked",
"FStar.Map.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Heap.fst.checked",
"FStar.Classical.fsti.checked",
"FStar.Buffer.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Modifies.fsti"
} | [
{
"abbrev": true,
"full_module": "FStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | preserve_liveness: Prims.bool -> r: FStar.Monotonic.HyperHeap.rid -> Prims.GTot FStar.Modifies.loc | Prims.GTot | [
"sometrivial"
] | [] | [
"Prims.bool",
"FStar.Monotonic.HyperHeap.rid",
"FStar.Modifies.loc_regions",
"FStar.Set.singleton",
"FStar.Modifies.loc"
] | [] | false | false | false | false | false | let loc_region_only (preserve_liveness: bool) (r: HS.rid) : GTot loc =
| loc_regions preserve_liveness (Set.singleton r) | false |
Spec.FFDHE.fst | Spec.FFDHE.list_ffdhe_p3072 | val list_ffdhe_p3072:List.Tot.llist pub_uint8 384 | val list_ffdhe_p3072:List.Tot.llist pub_uint8 384 | let list_ffdhe_p3072: List.Tot.llist pub_uint8 384 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy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Auy; 0xBCuy; 0xD0uy; 0x6Buy; 0xFAuy; 0x53uy; 0xDDuy; 0xEFuy;
0x3Cuy; 0x1Buy; 0x20uy; 0xEEuy; 0x3Fuy; 0xD5uy; 0x9Duy; 0x7Cuy;
0x25uy; 0xE4uy; 0x1Duy; 0x2Buy; 0x66uy; 0xC6uy; 0x2Euy; 0x37uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 384);
l | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 136,
"start_col": 0,
"start_line": 83
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x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4Fuy; 0x42uy; 0xA3uy; 0xDEuy; 0x39uy; 0x4Duy; 0xF4uy;
0xAEuy; 0x56uy; 0xEDuy; 0xE7uy; 0x63uy; 0x72uy; 0xBBuy; 0x19uy;
0x0Buy; 0x07uy; 0xA7uy; 0xC8uy; 0xEEuy; 0x0Auy; 0x6Duy; 0x70uy;
0x9Euy; 0x02uy; 0xFCuy; 0xE1uy; 0xCDuy; 0xF7uy; 0xE2uy; 0xECuy;
0xC0uy; 0x34uy; 0x04uy; 0xCDuy; 0x28uy; 0x34uy; 0x2Fuy; 0x61uy;
0x91uy; 0x72uy; 0xFEuy; 0x9Cuy; 0xE9uy; 0x85uy; 0x83uy; 0xFFuy;
0x8Euy; 0x4Fuy; 0x12uy; 0x32uy; 0xEEuy; 0xF2uy; 0x81uy; 0x83uy;
0xC3uy; 0xFEuy; 0x3Buy; 0x1Buy; 0x4Cuy; 0x6Fuy; 0xADuy; 0x73uy;
0x3Buy; 0xB5uy; 0xFCuy; 0xBCuy; 0x2Euy; 0xC2uy; 0x20uy; 0x05uy;
0xC5uy; 0x8Euy; 0xF1uy; 0x83uy; 0x7Duy; 0x16uy; 0x83uy; 0xB2uy;
0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"] | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.List.Tot.Properties.llist (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.PUB) 384 | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.int",
"FStar.List.Tot.Base.length",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.PUB",
"Prims.list",
"Prims.Cons",
"FStar.UInt8.__uint_to_t",
"Prims.Nil"
] | [] | false | false | false | false | false | let list_ffdhe_p3072:List.Tot.llist pub_uint8 384 =
| [@@ inline_let ]let l =
[
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xADuy; 0xF8uy; 0x54uy; 0x58uy;
0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy; 0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy; 0xA9uy; 0xE1uy; 0x36uy; 0x41uy;
0x14uy; 0x64uy; 0x33uy; 0xFBuy; 0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy; 0xF6uy; 0x81uy; 0xB2uy; 0x02uy;
0xAEuy; 0xC4uy; 0x61uy; 0x7Auy; 0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy; 0x85uy; 0x63uy; 0x65uy; 0x55uy;
0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy; 0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy; 0x57uy; 0xC9uy; 0x35uy;
0x98uy; 0x4Fuy; 0x0Cuy; 0x70uy; 0xE0uy; 0xE6uy; 0x8Buy; 0x77uy; 0xE2uy; 0xA6uy; 0x89uy; 0xDAuy;
0xF3uy; 0xEFuy; 0xE8uy; 0x72uy; 0x1Duy; 0xF1uy; 0x58uy; 0xA1uy; 0x36uy; 0xADuy; 0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 0xFFuy
]
in
assert_norm (List.Tot.length l == 384);
l | false |
Spec.FFDHE.fst | Spec.FFDHE.ffdhe_p3072 | val ffdhe_p3072:lseq pub_uint8 384 | val ffdhe_p3072:lseq pub_uint8 384 | let ffdhe_p3072: lseq pub_uint8 384 = of_list list_ffdhe_p3072 | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 62,
"end_line": 138,
"start_col": 0,
"start_line": 138
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x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Buy; 0x07uy; 0xA7uy; 0xC8uy; 0xEEuy; 0x0Auy; 0x6Duy; 0x70uy;
0x9Euy; 0x02uy; 0xFCuy; 0xE1uy; 0xCDuy; 0xF7uy; 0xE2uy; 0xECuy;
0xC0uy; 0x34uy; 0x04uy; 0xCDuy; 0x28uy; 0x34uy; 0x2Fuy; 0x61uy;
0x91uy; 0x72uy; 0xFEuy; 0x9Cuy; 0xE9uy; 0x85uy; 0x83uy; 0xFFuy;
0x8Euy; 0x4Fuy; 0x12uy; 0x32uy; 0xEEuy; 0xF2uy; 0x81uy; 0x83uy;
0xC3uy; 0xFEuy; 0x3Buy; 0x1Buy; 0x4Cuy; 0x6Fuy; 0xADuy; 0x73uy;
0x3Buy; 0xB5uy; 0xFCuy; 0xBCuy; 0x2Euy; 0xC2uy; 0x20uy; 0x05uy;
0xC5uy; 0x8Euy; 0xF1uy; 0x83uy; 0x7Duy; 0x16uy; 0x83uy; 0xB2uy;
0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p3072: List.Tot.llist pub_uint8 384 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy;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; 0xFAuy; 0xC1uy; 0x86uy; 0xD9uy; 0x1Cuy;
0xAEuy; 0xFEuy; 0x13uy; 0x09uy; 0x85uy; 0x13uy; 0x92uy; 0x70uy;
0xB4uy; 0x13uy; 0x0Cuy; 0x93uy; 0xBCuy; 0x43uy; 0x79uy; 0x44uy;
0xF4uy; 0xFDuy; 0x44uy; 0x52uy; 0xE2uy; 0xD7uy; 0x4Duy; 0xD3uy;
0x64uy; 0xF2uy; 0xE2uy; 0x1Euy; 0x71uy; 0xF5uy; 0x4Buy; 0xFFuy;
0x5Cuy; 0xAEuy; 0x82uy; 0xABuy; 0x9Cuy; 0x9Duy; 0xF6uy; 0x9Euy;
0xE8uy; 0x6Duy; 0x2Buy; 0xC5uy; 0x22uy; 0x36uy; 0x3Auy; 0x0Duy;
0xABuy; 0xC5uy; 0x21uy; 0x97uy; 0x9Buy; 0x0Duy; 0xEAuy; 0xDAuy;
0x1Duy; 0xBFuy; 0x9Auy; 0x42uy; 0xD5uy; 0xC4uy; 0x48uy; 0x4Euy;
0x0Auy; 0xBCuy; 0xD0uy; 0x6Buy; 0xFAuy; 0x53uy; 0xDDuy; 0xEFuy;
0x3Cuy; 0x1Buy; 0x20uy; 0xEEuy; 0x3Fuy; 0xD5uy; 0x9Duy; 0x7Cuy;
0x25uy; 0xE4uy; 0x1Duy; 0x2Buy; 0x66uy; 0xC6uy; 0x2Euy; 0x37uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 384);
l | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.PUB) 384 | Prims.Tot | [
"total"
] | [] | [
"Lib.Sequence.of_list",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.PUB",
"Spec.FFDHE.list_ffdhe_p3072"
] | [] | false | false | false | false | false | let ffdhe_p3072:lseq pub_uint8 384 =
| of_list list_ffdhe_p3072 | false |
FStar.Modifies.fsti | FStar.Modifies.loc_mreference | val loc_mreference (#a: Type) (#p: Preorder.preorder a) (b: HS.mreference a p) : GTot loc | val loc_mreference (#a: Type) (#p: Preorder.preorder a) (b: HS.mreference a p) : GTot loc | let loc_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses true (HS.frameOf b) (Set.singleton (HS.as_addr b)) | {
"file_name": "ulib/FStar.Modifies.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 66,
"end_line": 84,
"start_col": 0,
"start_line": 79
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Modifies
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module B = FStar.Buffer
(*** The modifies clause *)
val loc : Type u#1
val loc_none: loc
val loc_union
(s1 s2: loc)
: GTot loc
(** The following is useful to make Z3 cut matching loops with
modifies_trans and modifies_refl *)
val loc_union_idem
(s: loc)
: Lemma
(loc_union s s == s)
[SMTPat (loc_union s s)]
val loc_union_comm
(s1 s2: loc)
: Lemma
(loc_union s1 s2 == loc_union s2 s1)
[SMTPat (loc_union s1 s2)]
val loc_union_assoc
(s1 s2 s3: loc)
: Lemma
(loc_union s1 (loc_union s2 s3) == loc_union (loc_union s1 s2) s3)
val loc_union_loc_none_l
(s: loc)
: Lemma
(loc_union loc_none s == s)
[SMTPat (loc_union loc_none s)]
val loc_union_loc_none_r
(s: loc)
: Lemma
(loc_union s loc_none == s)
[SMTPat (loc_union s loc_none)]
val loc_buffer
(#t: Type)
(b: B.buffer t)
: GTot loc
val loc_addresses
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: GTot loc
val loc_regions
(preserve_liveness: bool)
(r: Set.set HS.rid)
: GTot loc | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.ModifiesGen.fsti.checked",
"FStar.Map.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Heap.fst.checked",
"FStar.Classical.fsti.checked",
"FStar.Buffer.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Modifies.fsti"
} | [
{
"abbrev": true,
"full_module": "FStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | b: FStar.Monotonic.HyperStack.mreference a p -> Prims.GTot FStar.Modifies.loc | Prims.GTot | [
"sometrivial"
] | [] | [
"FStar.Preorder.preorder",
"FStar.Monotonic.HyperStack.mreference",
"FStar.Modifies.loc_addresses",
"FStar.Monotonic.HyperStack.frameOf",
"FStar.Set.singleton",
"Prims.nat",
"FStar.Monotonic.HyperStack.as_addr",
"FStar.Modifies.loc"
] | [] | false | false | false | false | false | let loc_mreference (#a: Type) (#p: Preorder.preorder a) (b: HS.mreference a p) : GTot loc =
| loc_addresses true (HS.frameOf b) (Set.singleton (HS.as_addr b)) | false |
FStar.Modifies.fsti | FStar.Modifies.loc_freed_mreference | val loc_freed_mreference (#a: Type) (#p: Preorder.preorder a) (b: HS.mreference a p) : GTot loc | val loc_freed_mreference (#a: Type) (#p: Preorder.preorder a) (b: HS.mreference a p) : GTot loc | let loc_freed_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses false (HS.frameOf b) (Set.singleton (HS.as_addr b)) | {
"file_name": "ulib/FStar.Modifies.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 67,
"end_line": 91,
"start_col": 0,
"start_line": 86
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Modifies
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module B = FStar.Buffer
(*** The modifies clause *)
val loc : Type u#1
val loc_none: loc
val loc_union
(s1 s2: loc)
: GTot loc
(** The following is useful to make Z3 cut matching loops with
modifies_trans and modifies_refl *)
val loc_union_idem
(s: loc)
: Lemma
(loc_union s s == s)
[SMTPat (loc_union s s)]
val loc_union_comm
(s1 s2: loc)
: Lemma
(loc_union s1 s2 == loc_union s2 s1)
[SMTPat (loc_union s1 s2)]
val loc_union_assoc
(s1 s2 s3: loc)
: Lemma
(loc_union s1 (loc_union s2 s3) == loc_union (loc_union s1 s2) s3)
val loc_union_loc_none_l
(s: loc)
: Lemma
(loc_union loc_none s == s)
[SMTPat (loc_union loc_none s)]
val loc_union_loc_none_r
(s: loc)
: Lemma
(loc_union s loc_none == s)
[SMTPat (loc_union s loc_none)]
val loc_buffer
(#t: Type)
(b: B.buffer t)
: GTot loc
val loc_addresses
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: GTot loc
val loc_regions
(preserve_liveness: bool)
(r: Set.set HS.rid)
: GTot loc
let loc_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses true (HS.frameOf b) (Set.singleton (HS.as_addr b)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.ModifiesGen.fsti.checked",
"FStar.Map.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Heap.fst.checked",
"FStar.Classical.fsti.checked",
"FStar.Buffer.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Modifies.fsti"
} | [
{
"abbrev": true,
"full_module": "FStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | b: FStar.Monotonic.HyperStack.mreference a p -> Prims.GTot FStar.Modifies.loc | Prims.GTot | [
"sometrivial"
] | [] | [
"FStar.Preorder.preorder",
"FStar.Monotonic.HyperStack.mreference",
"FStar.Modifies.loc_addresses",
"FStar.Monotonic.HyperStack.frameOf",
"FStar.Set.singleton",
"Prims.nat",
"FStar.Monotonic.HyperStack.as_addr",
"FStar.Modifies.loc"
] | [] | false | false | false | false | false | let loc_freed_mreference (#a: Type) (#p: Preorder.preorder a) (b: HS.mreference a p) : GTot loc =
| loc_addresses false (HS.frameOf b) (Set.singleton (HS.as_addr b)) | false |
Steel.GhostMonotonicHigherReference.fst | Steel.GhostMonotonicHigherReference.recall | val recall (#inames: _) (#a:Type u#1) (#q:perm) (#p:Preorder.preorder a)
(fact:property a)
(r:ref a p)
(v:erased a)
(w:witnessed r fact)
: SteelAtomicU unit inames
(pts_to r q v)
(fun _ -> pts_to r q v)
(requires fun _ -> True)
(ensures fun _ _ _ -> fact v) | val recall (#inames: _) (#a:Type u#1) (#q:perm) (#p:Preorder.preorder a)
(fact:property a)
(r:ref a p)
(v:erased a)
(w:witnessed r fact)
: SteelAtomicU unit inames
(pts_to r q v)
(fun _ -> pts_to r q v)
(requires fun _ -> True)
(ensures fun _ _ _ -> fact v) | let recall (#inames: _) (#a:Type u#1) (#q:perm) (#p:Preorder.preorder a) (fact:property a)
(r:ref a p) (v:erased a) (w:witnessed r fact)
= let h = witness_exists #_ #_ #(pts_to_body r q v) () in
let _ = elim_pure #_ #_ #_ #q r v h in
let h1 = recall (lift_fact fact) r h w in
intro_pure_full r v h;
rewrite_slprop (pts_to _ q _) (pts_to r q v) (fun _ -> ()) | {
"file_name": "lib/steel/Steel.GhostMonotonicHigherReference.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 62,
"end_line": 157,
"start_col": 0,
"start_line": 149
} | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.GhostMonotonicHigherReference
open FStar.Ghost
open FStar.PCM
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.GhostPCMReference
open Steel.FractionalPermission
open Steel.Preorder
module Preorder = FStar.Preorder
module Q = Steel.Preorder
module M = Steel.Memory
module PR = Steel.GhostPCMReference
module A = Steel.Effect.Atomic
open FStar.Real
#set-options "--ide_id_info_off"
let ref a p = PR.ref (history a p) pcm_history
[@@__reduce__]
let pts_to_body #a #p (r:ref a p) (f:perm) (v:a) (h:history a p) =
PR.pts_to r h `star`
pure (history_val h v f)
let pts_to' (#a:Type) (#p:Preorder.preorder a) (r:ref a p) (f:perm) (v: a) =
h_exists (pts_to_body r f v)
let pts_to_sl r f v = hp_of (pts_to' r f v)
let intro_pure #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to_body r f v h)
= A.intro_pure (history_val h v f)
let intro_pure_full #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to r f v)
= intro_pure #_ #a #p #f r v h;
intro_exists h (pts_to_body r f v)
let alloc #_ (#a:Type) (p:Preorder.preorder a) (v:a)
= let h = Current [v] full_perm in
assert (compatible pcm_history h h);
let x : ref a p = alloc h in
intro_pure_full x v h;
x
let extract_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> pts_to_body r f v h)
= elim_pure (history_val h v f);
A.intro_pure (history_val h v f)
let elim_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> PR.pts_to r h)
= let _ = extract_pure r v h in
drop (pure (history_val h v f))
let write (#opened: _) (#a:Type) (#p:Preorder.preorder a) (#v:a)
(r:ref a p) (x:a)
: SteelGhost unit opened (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True)
= let h_old_e = witness_exists #_ #_ #(pts_to_body r full_perm v) () in
let _ = elim_pure r v h_old_e in
let h_old = read r in
let h: history a p = extend_history' h_old x in
write r h_old_e h;
intro_pure_full r x h
let witnessed #a #p r fact =
PR.witnessed r (lift_fact fact)
let get_squash (#p:prop) (_:unit{p}) : squash p = ()
let witness_thunk (#inames: _) (#a:Type) (#pcm:FStar.PCM.pcm a)
(r:PR.ref a pcm)
(fact:M.stable_property pcm)
(v:erased a)
(sq:squash (fact_valid_compat #_ #pcm fact v))
(_:unit)
: SteelAtomicUT (PR.witnessed r fact) inames
(PR.pts_to r v)
(fun _ -> PR.pts_to r v)
= witness r fact v sq
let witness (#inames: _) (#a:Type) (#q:perm) (#p:Preorder.preorder a)
(r:ref a p)
(fact:stable_property p)
(v:erased a)
(_:squash (fact v))
: SteelAtomicUT (witnessed r fact) inames
(pts_to r q v)
(fun _ -> pts_to r q v)
= let h = witness_exists #_ #_ #(pts_to_body r q v) () in
let _ = elim_pure #_ #_ #_ #q r v h in
assert (forall h'. compatible pcm_history h h' ==> lift_fact fact h');
lift_fact_is_stable #a #p fact;
let w = witness_thunk #_ #_ #(pcm_history #a #p) r (lift_fact fact) h () () in
intro_pure_full r v h;
rewrite_slprop (pts_to _ q _) (pts_to r q v) (fun _ -> ());
return w | {
"checked_file": "/",
"dependencies": [
"Steel.Preorder.fst.checked",
"Steel.Memory.fsti.checked",
"Steel.GhostPCMReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.GhostMonotonicHigherReference.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Real",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Effect.Atomic",
"short_module": "A"
},
{
"abbrev": true,
"full_module": "Steel.GhostPCMReference",
"short_module": "PR"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Steel.Preorder",
"short_module": "Q"
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.GhostPCMReference",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
fact: Steel.GhostMonotonicHigherReference.property a ->
r: Steel.GhostMonotonicHigherReference.ref a p ->
v: FStar.Ghost.erased a ->
w: Steel.GhostMonotonicHigherReference.witnessed r fact
-> Steel.Effect.Atomic.SteelAtomicU Prims.unit | Steel.Effect.Atomic.SteelAtomicU | [] | [] | [
"Steel.Memory.inames",
"Steel.FractionalPermission.perm",
"FStar.Preorder.preorder",
"Steel.GhostMonotonicHigherReference.property",
"Steel.GhostMonotonicHigherReference.ref",
"FStar.Ghost.erased",
"Steel.GhostMonotonicHigherReference.witnessed",
"Steel.Effect.Atomic.rewrite_slprop",
"Steel.GhostMonotonicHigherReference.pts_to",
"FStar.Ghost.reveal",
"Steel.Memory.mem",
"Prims.unit",
"Steel.GhostMonotonicHigherReference.intro_pure_full",
"Steel.Preorder.history",
"Steel.GhostPCMReference.recall",
"Steel.Preorder.pcm_history",
"Steel.Preorder.lift_fact",
"Steel.Preorder.history_val",
"FStar.Ghost.hide",
"Steel.GhostMonotonicHigherReference.elim_pure",
"Steel.Effect.Atomic.witness_exists",
"Steel.GhostMonotonicHigherReference.pts_to_body"
] | [] | false | true | false | false | false | let recall
(#inames: _)
(#a: Type u#1)
(#q: perm)
(#p: Preorder.preorder a)
(fact: property a)
(r: ref a p)
(v: erased a)
(w: witnessed r fact)
=
| let h = witness_exists #_ #_ #(pts_to_body r q v) () in
let _ = elim_pure #_ #_ #_ #q r v h in
let h1 = recall (lift_fact fact) r h w in
intro_pure_full r v h;
rewrite_slprop (pts_to _ q _) (pts_to r q v) (fun _ -> ()) | false |
FStar.Modifies.fsti | FStar.Modifies.loc_disjoint_sym' | val loc_disjoint_sym' (s1 s2: loc)
: Lemma (loc_disjoint s1 s2 <==> loc_disjoint s2 s1) [SMTPat (loc_disjoint s1 s2)] | val loc_disjoint_sym' (s1 s2: loc)
: Lemma (loc_disjoint s1 s2 <==> loc_disjoint s2 s1) [SMTPat (loc_disjoint s1 s2)] | let loc_disjoint_sym'
(s1 s2: loc)
: Lemma
(loc_disjoint s1 s2 <==> loc_disjoint s2 s1)
[SMTPat (loc_disjoint s1 s2)]
= Classical.move_requires (loc_disjoint_sym s1) s2;
Classical.move_requires (loc_disjoint_sym s2) s1 | {
"file_name": "ulib/FStar.Modifies.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 50,
"end_line": 255,
"start_col": 0,
"start_line": 249
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Modifies
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module B = FStar.Buffer
(*** The modifies clause *)
val loc : Type u#1
val loc_none: loc
val loc_union
(s1 s2: loc)
: GTot loc
(** The following is useful to make Z3 cut matching loops with
modifies_trans and modifies_refl *)
val loc_union_idem
(s: loc)
: Lemma
(loc_union s s == s)
[SMTPat (loc_union s s)]
val loc_union_comm
(s1 s2: loc)
: Lemma
(loc_union s1 s2 == loc_union s2 s1)
[SMTPat (loc_union s1 s2)]
val loc_union_assoc
(s1 s2 s3: loc)
: Lemma
(loc_union s1 (loc_union s2 s3) == loc_union (loc_union s1 s2) s3)
val loc_union_loc_none_l
(s: loc)
: Lemma
(loc_union loc_none s == s)
[SMTPat (loc_union loc_none s)]
val loc_union_loc_none_r
(s: loc)
: Lemma
(loc_union s loc_none == s)
[SMTPat (loc_union s loc_none)]
val loc_buffer
(#t: Type)
(b: B.buffer t)
: GTot loc
val loc_addresses
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: GTot loc
val loc_regions
(preserve_liveness: bool)
(r: Set.set HS.rid)
: GTot loc
let loc_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses true (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_freed_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses false (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_region_only
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (Set.singleton r)
let loc_all_regions_from
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (HS.mod_set (Set.singleton r))
(* Inclusion of memory locations *)
val loc_includes
(s1 s2: loc)
: GTot Type0
val loc_includes_refl
(s: loc)
: Lemma
(loc_includes s s)
[SMTPat (loc_includes s s)]
val loc_includes_trans
(s1 s2 s3: loc)
: Lemma
(requires (loc_includes s1 s2 /\ loc_includes s2 s3))
(ensures (loc_includes s1 s3))
val loc_includes_union_r
(s s1 s2: loc)
: Lemma
(requires (loc_includes s s1 /\ loc_includes s s2))
(ensures (loc_includes s (loc_union s1 s2)))
[SMTPat (loc_includes s (loc_union s1 s2))]
val loc_includes_union_l
(s1 s2 s: loc)
: Lemma
(requires (loc_includes s1 s \/ loc_includes s2 s))
(ensures (loc_includes (loc_union s1 s2) s))
[SMTPat (loc_includes (loc_union s1 s2) s)]
val loc_includes_none
(s: loc)
: Lemma
(loc_includes s loc_none)
[SMTPat (loc_includes s loc_none)]
val loc_includes_buffer
(#t: Type)
(b1 b2: B.buffer t)
: Lemma
(requires (b1 `B.includes` b2))
(ensures (loc_includes (loc_buffer b1) (loc_buffer b2)))
[SMTPatOr [
[SMTPat (B.includes b1 b2)];
[SMTPat (loc_includes(loc_buffer b1) (loc_buffer b2))]
]]
val loc_includes_gsub_buffer_r
(l: loc)
(#t: Type)
(b: B.buffer t)
(i: UInt32.t)
(len: UInt32.t)
: Lemma
(requires (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer b)))
(ensures (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer (B.sub b i len))))
[SMTPat (loc_includes l (loc_buffer (B.sub b i len)))]
val loc_includes_gsub_buffer_l
(#t: Type)
(b: B.buffer t)
(i1: UInt32.t)
(len1: UInt32.t)
(i2: UInt32.t)
(len2: UInt32.t)
: Lemma
(requires (UInt32.v i1 + UInt32.v len1 <= (B.length b) /\ UInt32.v i1 <= UInt32.v i2 /\ UInt32.v i2 + UInt32.v len2 <= UInt32.v i1 + UInt32.v len1))
(ensures (UInt32.v i1 + UInt32.v len1 <= (B.length b) /\ UInt32.v i1 <= UInt32.v i2 /\ UInt32.v i2 + UInt32.v len2 <= UInt32.v i1 + UInt32.v len1 /\ loc_includes (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2))))
[SMTPat (loc_includes (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2)))]
val loc_includes_addresses_buffer
(#t: Type)
(preserve_liveness: bool)
(r: HS.rid)
(s: Set.set nat)
(p: B.buffer t)
: Lemma
(requires (B.frameOf p == r /\ Set.mem (B.as_addr p) s))
(ensures (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p)))
[SMTPat (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p))]
val loc_includes_region_buffer
(#t: Type)
(preserve_liveness: bool)
(s: Set.set HS.rid)
(b: B.buffer t)
: Lemma
(requires (Set.mem (B.frameOf b) s))
(ensures (loc_includes (loc_regions preserve_liveness s) (loc_buffer b)))
[SMTPat (loc_includes (loc_regions preserve_liveness s) (loc_buffer b))]
val loc_includes_region_addresses
(preserve_liveness1: bool)
(preserve_liveness2: bool)
(s: Set.set HS.rid)
(r: HS.rid)
(a: Set.set nat)
: Lemma
(requires (Set.mem r s))
(ensures (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a)))
[SMTPat (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a))]
val loc_includes_region_region
(preserve_liveness1: bool)
(preserve_liveness2: bool)
(s1 s2: Set.set HS.rid)
: Lemma
(requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1))
(ensures (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2)))
[SMTPat (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2))]
val loc_includes_region_union_l
(preserve_liveness: bool)
(l: loc)
(s1 s2: Set.set HS.rid)
: Lemma
(requires (loc_includes l (loc_regions preserve_liveness (Set.intersect s2 (Set.complement s1)))))
(ensures (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2)))
[SMTPat (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2))]
val loc_includes_addresses_addresses
(preserve_liveness1 preserve_liveness2: bool)
(r: HS.rid)
(s1 s2: Set.set nat)
: Lemma
(requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1))
(ensures (loc_includes (loc_addresses preserve_liveness1 r s1) (loc_addresses preserve_liveness2 r s2)))
(* Disjointness of two memory locations *)
val loc_disjoint
(s1 s2: loc)
: GTot Type0
val loc_disjoint_sym
(s1 s2: loc)
: Lemma
(requires (loc_disjoint s1 s2))
(ensures (loc_disjoint s2 s1)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.ModifiesGen.fsti.checked",
"FStar.Map.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Heap.fst.checked",
"FStar.Classical.fsti.checked",
"FStar.Buffer.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Modifies.fsti"
} | [
{
"abbrev": true,
"full_module": "FStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | s1: FStar.Modifies.loc -> s2: FStar.Modifies.loc
-> FStar.Pervasives.Lemma
(ensures FStar.Modifies.loc_disjoint s1 s2 <==> FStar.Modifies.loc_disjoint s2 s1)
[SMTPat (FStar.Modifies.loc_disjoint s1 s2)] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"FStar.Modifies.loc",
"FStar.Classical.move_requires",
"FStar.Modifies.loc_disjoint",
"FStar.Modifies.loc_disjoint_sym",
"Prims.unit",
"Prims.l_True",
"Prims.squash",
"Prims.l_iff",
"Prims.Cons",
"FStar.Pervasives.pattern",
"FStar.Pervasives.smt_pat",
"Prims.Nil"
] | [] | false | false | true | false | false | let loc_disjoint_sym' (s1 s2: loc)
: Lemma (loc_disjoint s1 s2 <==> loc_disjoint s2 s1) [SMTPat (loc_disjoint s1 s2)] =
| Classical.move_requires (loc_disjoint_sym s1) s2;
Classical.move_requires (loc_disjoint_sym s2) s1 | false |
FStar.Modifies.fsti | FStar.Modifies.modifies_liveness_insensitive_region_weak | val modifies_liveness_insensitive_region_weak (l2: loc) (h h': HS.mem) (x: HS.rid)
: Lemma
(requires
(modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\
HS.live_region h x))
(ensures (HS.live_region h' x))
[
SMTPatOr
[
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h x)];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' x)]
]
] | val modifies_liveness_insensitive_region_weak (l2: loc) (h h': HS.mem) (x: HS.rid)
: Lemma
(requires
(modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\
HS.live_region h x))
(ensures (HS.live_region h' x))
[
SMTPatOr
[
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h x)];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' x)]
]
] | let modifies_liveness_insensitive_region_weak
(l2 : loc)
(h h' : HS.mem)
(x: HS.rid)
: Lemma
(requires (modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h x))
(ensures (HS.live_region h' x))
[SMTPatOr [
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h x)];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' x)];
]]
= modifies_liveness_insensitive_region loc_none l2 h h' x | {
"file_name": "ulib/FStar.Modifies.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 57,
"end_line": 538,
"start_col": 0,
"start_line": 527
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Modifies
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module B = FStar.Buffer
(*** The modifies clause *)
val loc : Type u#1
val loc_none: loc
val loc_union
(s1 s2: loc)
: GTot loc
(** The following is useful to make Z3 cut matching loops with
modifies_trans and modifies_refl *)
val loc_union_idem
(s: loc)
: Lemma
(loc_union s s == s)
[SMTPat (loc_union s s)]
val loc_union_comm
(s1 s2: loc)
: Lemma
(loc_union s1 s2 == loc_union s2 s1)
[SMTPat (loc_union s1 s2)]
val loc_union_assoc
(s1 s2 s3: loc)
: Lemma
(loc_union s1 (loc_union s2 s3) == loc_union (loc_union s1 s2) s3)
val loc_union_loc_none_l
(s: loc)
: Lemma
(loc_union loc_none s == s)
[SMTPat (loc_union loc_none s)]
val loc_union_loc_none_r
(s: loc)
: Lemma
(loc_union s loc_none == s)
[SMTPat (loc_union s loc_none)]
val loc_buffer
(#t: Type)
(b: B.buffer t)
: GTot loc
val loc_addresses
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: GTot loc
val loc_regions
(preserve_liveness: bool)
(r: Set.set HS.rid)
: GTot loc
let loc_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses true (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_freed_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses false (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_region_only
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (Set.singleton r)
let loc_all_regions_from
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (HS.mod_set (Set.singleton r))
(* Inclusion of memory locations *)
val loc_includes
(s1 s2: loc)
: GTot Type0
val loc_includes_refl
(s: loc)
: Lemma
(loc_includes s s)
[SMTPat (loc_includes s s)]
val loc_includes_trans
(s1 s2 s3: loc)
: Lemma
(requires (loc_includes s1 s2 /\ loc_includes s2 s3))
(ensures (loc_includes s1 s3))
val loc_includes_union_r
(s s1 s2: loc)
: Lemma
(requires (loc_includes s s1 /\ loc_includes s s2))
(ensures (loc_includes s (loc_union s1 s2)))
[SMTPat (loc_includes s (loc_union s1 s2))]
val loc_includes_union_l
(s1 s2 s: loc)
: Lemma
(requires (loc_includes s1 s \/ loc_includes s2 s))
(ensures (loc_includes (loc_union s1 s2) s))
[SMTPat (loc_includes (loc_union s1 s2) s)]
val loc_includes_none
(s: loc)
: Lemma
(loc_includes s loc_none)
[SMTPat (loc_includes s loc_none)]
val loc_includes_buffer
(#t: Type)
(b1 b2: B.buffer t)
: Lemma
(requires (b1 `B.includes` b2))
(ensures (loc_includes (loc_buffer b1) (loc_buffer b2)))
[SMTPatOr [
[SMTPat (B.includes b1 b2)];
[SMTPat (loc_includes(loc_buffer b1) (loc_buffer b2))]
]]
val loc_includes_gsub_buffer_r
(l: loc)
(#t: Type)
(b: B.buffer t)
(i: UInt32.t)
(len: UInt32.t)
: Lemma
(requires (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer b)))
(ensures (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer (B.sub b i len))))
[SMTPat (loc_includes l (loc_buffer (B.sub b i len)))]
val loc_includes_gsub_buffer_l
(#t: Type)
(b: B.buffer t)
(i1: UInt32.t)
(len1: UInt32.t)
(i2: UInt32.t)
(len2: UInt32.t)
: Lemma
(requires (UInt32.v i1 + UInt32.v len1 <= (B.length b) /\ UInt32.v i1 <= UInt32.v i2 /\ UInt32.v i2 + UInt32.v len2 <= UInt32.v i1 + UInt32.v len1))
(ensures (UInt32.v i1 + UInt32.v len1 <= (B.length b) /\ UInt32.v i1 <= UInt32.v i2 /\ UInt32.v i2 + UInt32.v len2 <= UInt32.v i1 + UInt32.v len1 /\ loc_includes (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2))))
[SMTPat (loc_includes (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2)))]
val loc_includes_addresses_buffer
(#t: Type)
(preserve_liveness: bool)
(r: HS.rid)
(s: Set.set nat)
(p: B.buffer t)
: Lemma
(requires (B.frameOf p == r /\ Set.mem (B.as_addr p) s))
(ensures (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p)))
[SMTPat (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p))]
val loc_includes_region_buffer
(#t: Type)
(preserve_liveness: bool)
(s: Set.set HS.rid)
(b: B.buffer t)
: Lemma
(requires (Set.mem (B.frameOf b) s))
(ensures (loc_includes (loc_regions preserve_liveness s) (loc_buffer b)))
[SMTPat (loc_includes (loc_regions preserve_liveness s) (loc_buffer b))]
val loc_includes_region_addresses
(preserve_liveness1: bool)
(preserve_liveness2: bool)
(s: Set.set HS.rid)
(r: HS.rid)
(a: Set.set nat)
: Lemma
(requires (Set.mem r s))
(ensures (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a)))
[SMTPat (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a))]
val loc_includes_region_region
(preserve_liveness1: bool)
(preserve_liveness2: bool)
(s1 s2: Set.set HS.rid)
: Lemma
(requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1))
(ensures (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2)))
[SMTPat (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2))]
val loc_includes_region_union_l
(preserve_liveness: bool)
(l: loc)
(s1 s2: Set.set HS.rid)
: Lemma
(requires (loc_includes l (loc_regions preserve_liveness (Set.intersect s2 (Set.complement s1)))))
(ensures (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2)))
[SMTPat (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2))]
val loc_includes_addresses_addresses
(preserve_liveness1 preserve_liveness2: bool)
(r: HS.rid)
(s1 s2: Set.set nat)
: Lemma
(requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1))
(ensures (loc_includes (loc_addresses preserve_liveness1 r s1) (loc_addresses preserve_liveness2 r s2)))
(* Disjointness of two memory locations *)
val loc_disjoint
(s1 s2: loc)
: GTot Type0
val loc_disjoint_sym
(s1 s2: loc)
: Lemma
(requires (loc_disjoint s1 s2))
(ensures (loc_disjoint s2 s1))
let loc_disjoint_sym'
(s1 s2: loc)
: Lemma
(loc_disjoint s1 s2 <==> loc_disjoint s2 s1)
[SMTPat (loc_disjoint s1 s2)]
= Classical.move_requires (loc_disjoint_sym s1) s2;
Classical.move_requires (loc_disjoint_sym s2) s1
val loc_disjoint_none_r
(s: loc)
: Lemma
(ensures (loc_disjoint s loc_none))
[SMTPat (loc_disjoint s loc_none)]
val loc_disjoint_union_r
(s s1 s2: loc)
: Lemma
(requires (loc_disjoint s s1 /\ loc_disjoint s s2))
(ensures (loc_disjoint s (loc_union s1 s2)))
[SMTPat (loc_disjoint s (loc_union s1 s2))]
val loc_disjoint_includes
(p1 p2 p1' p2' : loc)
: Lemma
(requires (loc_includes p1 p1' /\ loc_includes p2 p2' /\ loc_disjoint p1 p2))
(ensures (loc_disjoint p1' p2'))
[SMTPatOr [
[SMTPat (loc_disjoint p1 p2); SMTPat (loc_disjoint p1' p2')];
[SMTPat (loc_includes p1 p1'); SMTPat (loc_includes p2 p2')];
]]
val loc_disjoint_buffer
(#t1 #t2: Type)
(b1: B.buffer t1)
(b2: B.buffer t2)
: Lemma
(requires (B.disjoint b1 b2))
(ensures (loc_disjoint (loc_buffer b1) (loc_buffer b2)))
[SMTPatOr [
[SMTPat (B.disjoint b1 b2)];
[SMTPat (loc_disjoint (loc_buffer b1) (loc_buffer b2))];
]]
val loc_disjoint_gsub_buffer
(#t: Type)
(b: B.buffer t)
(i1: UInt32.t)
(len1: UInt32.t)
(i2: UInt32.t)
(len2: UInt32.t)
: Lemma
(requires (
UInt32.v i1 + UInt32.v len1 <= (B.length b) /\
UInt32.v i2 + UInt32.v len2 <= (B.length b) /\ (
UInt32.v i1 + UInt32.v len1 <= UInt32.v i2 \/
UInt32.v i2 + UInt32.v len2 <= UInt32.v i1
)))
(ensures (
UInt32.v i1 + UInt32.v len1 <= (B.length b) /\
UInt32.v i2 + UInt32.v len2 <= (B.length b) /\
loc_disjoint (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2))
))
[SMTPat (loc_disjoint (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2)))]
val loc_disjoint_addresses
(preserve_liveness1 preserve_liveness2: bool)
(r1 r2: HS.rid)
(n1 n2: Set.set nat)
: Lemma
(requires (r1 <> r2 \/ Set.subset (Set.intersect n1 n2) Set.empty))
(ensures (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2)))
[SMTPat (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2))]
val loc_disjoint_buffer_addresses
(#t: Type)
(p: B.buffer t)
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: Lemma
(requires (r <> B.frameOf p \/ (~ (Set.mem (B.as_addr p) n))))
(ensures (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n)))
[SMTPat (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n))]
val loc_disjoint_regions
(preserve_liveness1 preserve_liveness2: bool)
(rs1 rs2: Set.set HS.rid)
: Lemma
(requires (Set.subset (Set.intersect rs1 rs2) Set.empty))
(ensures (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2)))
[SMTPat (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2))]
(** The modifies clause proper *)
val modifies
(s: loc)
(h1 h2: HS.mem)
: GTot Type0
val modifies_mreference_elim
(#t: Type)
(#pre: Preorder.preorder t)
(b: HS.mreference t pre)
(p: loc)
(h h': HS.mem)
: Lemma
(requires (
loc_disjoint (loc_mreference b) p /\
HS.contains h b /\
modifies p h h'
))
(ensures (
HS.contains h' b /\
HS.sel h b == HS.sel h' b
))
[SMTPatOr [
[ SMTPat (modifies p h h'); SMTPat (HS.sel h b) ] ;
[ SMTPat (modifies p h h'); SMTPat (HS.contains h b) ];
[ SMTPat (modifies p h h'); SMTPat (HS.sel h' b) ] ;
[ SMTPat (modifies p h h'); SMTPat (HS.contains h' b) ]
] ]
val modifies_buffer_elim
(#t1: Type)
(b: B.buffer t1)
(p: loc)
(h h': HS.mem)
: Lemma
(requires (
loc_disjoint (loc_buffer b) p /\
B.live h b /\
modifies p h h'
))
(ensures (
B.live h' b /\ (
B.as_seq h b == B.as_seq h' b
)))
[SMTPatOr [
[ SMTPat (modifies p h h'); SMTPat (B.as_seq h b) ] ;
[ SMTPat (modifies p h h'); SMTPat (B.live h b) ];
[ SMTPat (modifies p h h'); SMTPat (B.as_seq h' b) ] ;
[ SMTPat (modifies p h h'); SMTPat (B.live h' b) ]
] ]
val modifies_refl
(s: loc)
(h: HS.mem)
: Lemma
(modifies s h h)
[SMTPat (modifies s h h)]
val modifies_loc_includes
(s1: loc)
(h h': HS.mem)
(s2: loc)
: Lemma
(requires (modifies s2 h h' /\ loc_includes s1 s2))
(ensures (modifies s1 h h'))
[SMTPatOr [
[SMTPat (modifies s1 h h'); SMTPat (modifies s2 h h')];
[SMTPat (modifies s1 h h'); SMTPat (loc_includes s1 s2)];
[SMTPat (modifies s2 h h'); SMTPat (loc_includes s1 s2)];
]]
/// Some memory locations are tagged as liveness-insensitive: the
/// liveness preservation of a memory location only depends on its
/// disjointness from the liveness-sensitive memory locations of a
/// modifies clause.
val address_liveness_insensitive_locs: loc
val region_liveness_insensitive_locs: loc
val address_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma
(address_liveness_insensitive_locs `loc_includes` (loc_buffer b))
[SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_buffer b))]
val address_liveness_insensitive_addresses (r: HS.rid) (a: Set.set nat) : Lemma
(address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a))
[SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a))]
val region_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_buffer b))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_buffer b))]
val region_liveness_insensitive_addresses (preserve_liveness: bool) (r: HS.rid) (a: Set.set nat) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a))]
val region_liveness_insensitive_regions (rs: Set.set HS.rid) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_regions true rs))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_regions true rs))]
val region_liveness_insensitive_address_liveness_insensitive:
squash (region_liveness_insensitive_locs `loc_includes` address_liveness_insensitive_locs)
val modifies_liveness_insensitive_mreference
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_mreference x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ h `HS.contains` x))
(ensures (h' `HS.contains` x))
(* TODO: pattern *)
val modifies_liveness_insensitive_buffer
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_buffer x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ B.live h x))
(ensures (B.live h' x))
(* TODO: pattern *)
let modifies_liveness_insensitive_mreference_weak
(l : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ h `HS.contains` x))
(ensures (h' `HS.contains` x))
[SMTPatOr [
[SMTPat (h `HS.contains` x); SMTPat (modifies l h h');];
[SMTPat (h' `HS.contains` x); SMTPat (modifies l h h');];
]]
= modifies_liveness_insensitive_mreference loc_none l h h' x
let modifies_liveness_insensitive_buffer_weak
(l : loc)
(h h' : HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires (modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ B.live h x))
(ensures (B.live h' x))
[SMTPatOr [
[SMTPat (B.live h x); SMTPat (modifies l h h');];
[SMTPat (B.live h' x); SMTPat (modifies l h h');];
]]
= modifies_liveness_insensitive_buffer loc_none l h h' x
val modifies_liveness_insensitive_region
(l1 l2 : loc)
(h h' : HS.mem)
(x: HS.rid)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_region_only false x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h x))
(ensures (HS.live_region h' x))
(* TODO: pattern *)
val modifies_liveness_insensitive_region_mreference
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_mreference x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (HS.frameOf x)))
(ensures (HS.live_region h' (HS.frameOf x)))
(* TODO: pattern *)
val modifies_liveness_insensitive_region_buffer
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_buffer x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (B.frameOf x)))
(ensures (HS.live_region h' (B.frameOf x)))
(* TODO: pattern *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.ModifiesGen.fsti.checked",
"FStar.Map.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Heap.fst.checked",
"FStar.Classical.fsti.checked",
"FStar.Buffer.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Modifies.fsti"
} | [
{
"abbrev": true,
"full_module": "FStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
l2: FStar.Modifies.loc ->
h: FStar.Monotonic.HyperStack.mem ->
h': FStar.Monotonic.HyperStack.mem ->
x: FStar.Monotonic.HyperHeap.rid
-> FStar.Pervasives.Lemma
(requires
FStar.Modifies.modifies l2 h h' /\
FStar.Modifies.loc_includes FStar.Modifies.region_liveness_insensitive_locs l2 /\
FStar.Monotonic.HyperStack.live_region h x)
(ensures FStar.Monotonic.HyperStack.live_region h' x)
[
SMTPatOr [
[
SMTPat (FStar.Modifies.modifies l2 h h');
SMTPat (FStar.Monotonic.HyperStack.live_region h x)
];
[
SMTPat (FStar.Modifies.modifies l2 h h');
SMTPat (FStar.Monotonic.HyperStack.live_region h' x)
]
]
] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"FStar.Modifies.loc",
"FStar.Monotonic.HyperStack.mem",
"FStar.Monotonic.HyperHeap.rid",
"FStar.Modifies.modifies_liveness_insensitive_region",
"FStar.Modifies.loc_none",
"Prims.unit",
"Prims.l_and",
"FStar.Modifies.modifies",
"FStar.Modifies.loc_includes",
"FStar.Modifies.region_liveness_insensitive_locs",
"Prims.b2t",
"FStar.Monotonic.HyperStack.live_region",
"Prims.squash",
"Prims.Cons",
"FStar.Pervasives.pattern",
"FStar.Pervasives.smt_pat_or",
"Prims.list",
"FStar.Pervasives.smt_pat",
"Prims.bool",
"Prims.Nil"
] | [] | true | false | true | false | false | let modifies_liveness_insensitive_region_weak (l2: loc) (h h': HS.mem) (x: HS.rid)
: Lemma
(requires
(modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\
HS.live_region h x))
(ensures (HS.live_region h' x))
[
SMTPatOr
[
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h x)];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' x)]
]
] =
| modifies_liveness_insensitive_region loc_none l2 h h' x | false |
FStar.Modifies.fsti | FStar.Modifies.modifies_liveness_insensitive_mreference_weak | val modifies_liveness_insensitive_mreference_weak
(l: loc)
(h h': HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires
(modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ h `HS.contains` x)
)
(ensures (h' `HS.contains` x))
[
SMTPatOr
[
[SMTPat (h `HS.contains` x); SMTPat (modifies l h h')];
[SMTPat (h' `HS.contains` x); SMTPat (modifies l h h')]
]
] | val modifies_liveness_insensitive_mreference_weak
(l: loc)
(h h': HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires
(modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ h `HS.contains` x)
)
(ensures (h' `HS.contains` x))
[
SMTPatOr
[
[SMTPat (h `HS.contains` x); SMTPat (modifies l h h')];
[SMTPat (h' `HS.contains` x); SMTPat (modifies l h h')]
]
] | let modifies_liveness_insensitive_mreference_weak
(l : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ h `HS.contains` x))
(ensures (h' `HS.contains` x))
[SMTPatOr [
[SMTPat (h `HS.contains` x); SMTPat (modifies l h h');];
[SMTPat (h' `HS.contains` x); SMTPat (modifies l h h');];
]]
= modifies_liveness_insensitive_mreference loc_none l h h' x | {
"file_name": "ulib/FStar.Modifies.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 60,
"end_line": 481,
"start_col": 0,
"start_line": 468
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Modifies
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module B = FStar.Buffer
(*** The modifies clause *)
val loc : Type u#1
val loc_none: loc
val loc_union
(s1 s2: loc)
: GTot loc
(** The following is useful to make Z3 cut matching loops with
modifies_trans and modifies_refl *)
val loc_union_idem
(s: loc)
: Lemma
(loc_union s s == s)
[SMTPat (loc_union s s)]
val loc_union_comm
(s1 s2: loc)
: Lemma
(loc_union s1 s2 == loc_union s2 s1)
[SMTPat (loc_union s1 s2)]
val loc_union_assoc
(s1 s2 s3: loc)
: Lemma
(loc_union s1 (loc_union s2 s3) == loc_union (loc_union s1 s2) s3)
val loc_union_loc_none_l
(s: loc)
: Lemma
(loc_union loc_none s == s)
[SMTPat (loc_union loc_none s)]
val loc_union_loc_none_r
(s: loc)
: Lemma
(loc_union s loc_none == s)
[SMTPat (loc_union s loc_none)]
val loc_buffer
(#t: Type)
(b: B.buffer t)
: GTot loc
val loc_addresses
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: GTot loc
val loc_regions
(preserve_liveness: bool)
(r: Set.set HS.rid)
: GTot loc
let loc_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses true (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_freed_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses false (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_region_only
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (Set.singleton r)
let loc_all_regions_from
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (HS.mod_set (Set.singleton r))
(* Inclusion of memory locations *)
val loc_includes
(s1 s2: loc)
: GTot Type0
val loc_includes_refl
(s: loc)
: Lemma
(loc_includes s s)
[SMTPat (loc_includes s s)]
val loc_includes_trans
(s1 s2 s3: loc)
: Lemma
(requires (loc_includes s1 s2 /\ loc_includes s2 s3))
(ensures (loc_includes s1 s3))
val loc_includes_union_r
(s s1 s2: loc)
: Lemma
(requires (loc_includes s s1 /\ loc_includes s s2))
(ensures (loc_includes s (loc_union s1 s2)))
[SMTPat (loc_includes s (loc_union s1 s2))]
val loc_includes_union_l
(s1 s2 s: loc)
: Lemma
(requires (loc_includes s1 s \/ loc_includes s2 s))
(ensures (loc_includes (loc_union s1 s2) s))
[SMTPat (loc_includes (loc_union s1 s2) s)]
val loc_includes_none
(s: loc)
: Lemma
(loc_includes s loc_none)
[SMTPat (loc_includes s loc_none)]
val loc_includes_buffer
(#t: Type)
(b1 b2: B.buffer t)
: Lemma
(requires (b1 `B.includes` b2))
(ensures (loc_includes (loc_buffer b1) (loc_buffer b2)))
[SMTPatOr [
[SMTPat (B.includes b1 b2)];
[SMTPat (loc_includes(loc_buffer b1) (loc_buffer b2))]
]]
val loc_includes_gsub_buffer_r
(l: loc)
(#t: Type)
(b: B.buffer t)
(i: UInt32.t)
(len: UInt32.t)
: Lemma
(requires (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer b)))
(ensures (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer (B.sub b i len))))
[SMTPat (loc_includes l (loc_buffer (B.sub b i len)))]
val loc_includes_gsub_buffer_l
(#t: Type)
(b: B.buffer t)
(i1: UInt32.t)
(len1: UInt32.t)
(i2: UInt32.t)
(len2: UInt32.t)
: Lemma
(requires (UInt32.v i1 + UInt32.v len1 <= (B.length b) /\ UInt32.v i1 <= UInt32.v i2 /\ UInt32.v i2 + UInt32.v len2 <= UInt32.v i1 + UInt32.v len1))
(ensures (UInt32.v i1 + UInt32.v len1 <= (B.length b) /\ UInt32.v i1 <= UInt32.v i2 /\ UInt32.v i2 + UInt32.v len2 <= UInt32.v i1 + UInt32.v len1 /\ loc_includes (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2))))
[SMTPat (loc_includes (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2)))]
val loc_includes_addresses_buffer
(#t: Type)
(preserve_liveness: bool)
(r: HS.rid)
(s: Set.set nat)
(p: B.buffer t)
: Lemma
(requires (B.frameOf p == r /\ Set.mem (B.as_addr p) s))
(ensures (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p)))
[SMTPat (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p))]
val loc_includes_region_buffer
(#t: Type)
(preserve_liveness: bool)
(s: Set.set HS.rid)
(b: B.buffer t)
: Lemma
(requires (Set.mem (B.frameOf b) s))
(ensures (loc_includes (loc_regions preserve_liveness s) (loc_buffer b)))
[SMTPat (loc_includes (loc_regions preserve_liveness s) (loc_buffer b))]
val loc_includes_region_addresses
(preserve_liveness1: bool)
(preserve_liveness2: bool)
(s: Set.set HS.rid)
(r: HS.rid)
(a: Set.set nat)
: Lemma
(requires (Set.mem r s))
(ensures (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a)))
[SMTPat (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a))]
val loc_includes_region_region
(preserve_liveness1: bool)
(preserve_liveness2: bool)
(s1 s2: Set.set HS.rid)
: Lemma
(requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1))
(ensures (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2)))
[SMTPat (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2))]
val loc_includes_region_union_l
(preserve_liveness: bool)
(l: loc)
(s1 s2: Set.set HS.rid)
: Lemma
(requires (loc_includes l (loc_regions preserve_liveness (Set.intersect s2 (Set.complement s1)))))
(ensures (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2)))
[SMTPat (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2))]
val loc_includes_addresses_addresses
(preserve_liveness1 preserve_liveness2: bool)
(r: HS.rid)
(s1 s2: Set.set nat)
: Lemma
(requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1))
(ensures (loc_includes (loc_addresses preserve_liveness1 r s1) (loc_addresses preserve_liveness2 r s2)))
(* Disjointness of two memory locations *)
val loc_disjoint
(s1 s2: loc)
: GTot Type0
val loc_disjoint_sym
(s1 s2: loc)
: Lemma
(requires (loc_disjoint s1 s2))
(ensures (loc_disjoint s2 s1))
let loc_disjoint_sym'
(s1 s2: loc)
: Lemma
(loc_disjoint s1 s2 <==> loc_disjoint s2 s1)
[SMTPat (loc_disjoint s1 s2)]
= Classical.move_requires (loc_disjoint_sym s1) s2;
Classical.move_requires (loc_disjoint_sym s2) s1
val loc_disjoint_none_r
(s: loc)
: Lemma
(ensures (loc_disjoint s loc_none))
[SMTPat (loc_disjoint s loc_none)]
val loc_disjoint_union_r
(s s1 s2: loc)
: Lemma
(requires (loc_disjoint s s1 /\ loc_disjoint s s2))
(ensures (loc_disjoint s (loc_union s1 s2)))
[SMTPat (loc_disjoint s (loc_union s1 s2))]
val loc_disjoint_includes
(p1 p2 p1' p2' : loc)
: Lemma
(requires (loc_includes p1 p1' /\ loc_includes p2 p2' /\ loc_disjoint p1 p2))
(ensures (loc_disjoint p1' p2'))
[SMTPatOr [
[SMTPat (loc_disjoint p1 p2); SMTPat (loc_disjoint p1' p2')];
[SMTPat (loc_includes p1 p1'); SMTPat (loc_includes p2 p2')];
]]
val loc_disjoint_buffer
(#t1 #t2: Type)
(b1: B.buffer t1)
(b2: B.buffer t2)
: Lemma
(requires (B.disjoint b1 b2))
(ensures (loc_disjoint (loc_buffer b1) (loc_buffer b2)))
[SMTPatOr [
[SMTPat (B.disjoint b1 b2)];
[SMTPat (loc_disjoint (loc_buffer b1) (loc_buffer b2))];
]]
val loc_disjoint_gsub_buffer
(#t: Type)
(b: B.buffer t)
(i1: UInt32.t)
(len1: UInt32.t)
(i2: UInt32.t)
(len2: UInt32.t)
: Lemma
(requires (
UInt32.v i1 + UInt32.v len1 <= (B.length b) /\
UInt32.v i2 + UInt32.v len2 <= (B.length b) /\ (
UInt32.v i1 + UInt32.v len1 <= UInt32.v i2 \/
UInt32.v i2 + UInt32.v len2 <= UInt32.v i1
)))
(ensures (
UInt32.v i1 + UInt32.v len1 <= (B.length b) /\
UInt32.v i2 + UInt32.v len2 <= (B.length b) /\
loc_disjoint (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2))
))
[SMTPat (loc_disjoint (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2)))]
val loc_disjoint_addresses
(preserve_liveness1 preserve_liveness2: bool)
(r1 r2: HS.rid)
(n1 n2: Set.set nat)
: Lemma
(requires (r1 <> r2 \/ Set.subset (Set.intersect n1 n2) Set.empty))
(ensures (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2)))
[SMTPat (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2))]
val loc_disjoint_buffer_addresses
(#t: Type)
(p: B.buffer t)
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: Lemma
(requires (r <> B.frameOf p \/ (~ (Set.mem (B.as_addr p) n))))
(ensures (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n)))
[SMTPat (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n))]
val loc_disjoint_regions
(preserve_liveness1 preserve_liveness2: bool)
(rs1 rs2: Set.set HS.rid)
: Lemma
(requires (Set.subset (Set.intersect rs1 rs2) Set.empty))
(ensures (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2)))
[SMTPat (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2))]
(** The modifies clause proper *)
val modifies
(s: loc)
(h1 h2: HS.mem)
: GTot Type0
val modifies_mreference_elim
(#t: Type)
(#pre: Preorder.preorder t)
(b: HS.mreference t pre)
(p: loc)
(h h': HS.mem)
: Lemma
(requires (
loc_disjoint (loc_mreference b) p /\
HS.contains h b /\
modifies p h h'
))
(ensures (
HS.contains h' b /\
HS.sel h b == HS.sel h' b
))
[SMTPatOr [
[ SMTPat (modifies p h h'); SMTPat (HS.sel h b) ] ;
[ SMTPat (modifies p h h'); SMTPat (HS.contains h b) ];
[ SMTPat (modifies p h h'); SMTPat (HS.sel h' b) ] ;
[ SMTPat (modifies p h h'); SMTPat (HS.contains h' b) ]
] ]
val modifies_buffer_elim
(#t1: Type)
(b: B.buffer t1)
(p: loc)
(h h': HS.mem)
: Lemma
(requires (
loc_disjoint (loc_buffer b) p /\
B.live h b /\
modifies p h h'
))
(ensures (
B.live h' b /\ (
B.as_seq h b == B.as_seq h' b
)))
[SMTPatOr [
[ SMTPat (modifies p h h'); SMTPat (B.as_seq h b) ] ;
[ SMTPat (modifies p h h'); SMTPat (B.live h b) ];
[ SMTPat (modifies p h h'); SMTPat (B.as_seq h' b) ] ;
[ SMTPat (modifies p h h'); SMTPat (B.live h' b) ]
] ]
val modifies_refl
(s: loc)
(h: HS.mem)
: Lemma
(modifies s h h)
[SMTPat (modifies s h h)]
val modifies_loc_includes
(s1: loc)
(h h': HS.mem)
(s2: loc)
: Lemma
(requires (modifies s2 h h' /\ loc_includes s1 s2))
(ensures (modifies s1 h h'))
[SMTPatOr [
[SMTPat (modifies s1 h h'); SMTPat (modifies s2 h h')];
[SMTPat (modifies s1 h h'); SMTPat (loc_includes s1 s2)];
[SMTPat (modifies s2 h h'); SMTPat (loc_includes s1 s2)];
]]
/// Some memory locations are tagged as liveness-insensitive: the
/// liveness preservation of a memory location only depends on its
/// disjointness from the liveness-sensitive memory locations of a
/// modifies clause.
val address_liveness_insensitive_locs: loc
val region_liveness_insensitive_locs: loc
val address_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma
(address_liveness_insensitive_locs `loc_includes` (loc_buffer b))
[SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_buffer b))]
val address_liveness_insensitive_addresses (r: HS.rid) (a: Set.set nat) : Lemma
(address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a))
[SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a))]
val region_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_buffer b))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_buffer b))]
val region_liveness_insensitive_addresses (preserve_liveness: bool) (r: HS.rid) (a: Set.set nat) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a))]
val region_liveness_insensitive_regions (rs: Set.set HS.rid) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_regions true rs))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_regions true rs))]
val region_liveness_insensitive_address_liveness_insensitive:
squash (region_liveness_insensitive_locs `loc_includes` address_liveness_insensitive_locs)
val modifies_liveness_insensitive_mreference
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_mreference x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ h `HS.contains` x))
(ensures (h' `HS.contains` x))
(* TODO: pattern *)
val modifies_liveness_insensitive_buffer
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_buffer x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ B.live h x))
(ensures (B.live h' x))
(* TODO: pattern *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.ModifiesGen.fsti.checked",
"FStar.Map.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Heap.fst.checked",
"FStar.Classical.fsti.checked",
"FStar.Buffer.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Modifies.fsti"
} | [
{
"abbrev": true,
"full_module": "FStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
l: FStar.Modifies.loc ->
h: FStar.Monotonic.HyperStack.mem ->
h': FStar.Monotonic.HyperStack.mem ->
x: FStar.Monotonic.HyperStack.mreference t pre
-> FStar.Pervasives.Lemma
(requires
FStar.Modifies.modifies l h h' /\
FStar.Modifies.loc_includes FStar.Modifies.address_liveness_insensitive_locs l /\
FStar.Monotonic.HyperStack.contains h x)
(ensures FStar.Monotonic.HyperStack.contains h' x)
[
SMTPatOr [
[
SMTPat (FStar.Monotonic.HyperStack.contains h x);
SMTPat (FStar.Modifies.modifies l h h')
];
[
SMTPat (FStar.Monotonic.HyperStack.contains h' x);
SMTPat (FStar.Modifies.modifies l h h')
]
]
] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"FStar.Modifies.loc",
"FStar.Monotonic.HyperStack.mem",
"FStar.Preorder.preorder",
"FStar.Monotonic.HyperStack.mreference",
"FStar.Modifies.modifies_liveness_insensitive_mreference",
"FStar.Modifies.loc_none",
"Prims.unit",
"Prims.l_and",
"FStar.Modifies.modifies",
"FStar.Modifies.loc_includes",
"FStar.Modifies.address_liveness_insensitive_locs",
"FStar.Monotonic.HyperStack.contains",
"Prims.squash",
"Prims.Cons",
"FStar.Pervasives.pattern",
"FStar.Pervasives.smt_pat_or",
"Prims.list",
"FStar.Pervasives.smt_pat",
"Prims.logical",
"Prims.Nil"
] | [] | true | false | true | false | false | let modifies_liveness_insensitive_mreference_weak
(l: loc)
(h h': HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires
(modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ h `HS.contains` x)
)
(ensures (h' `HS.contains` x))
[
SMTPatOr
[
[SMTPat (h `HS.contains` x); SMTPat (modifies l h h')];
[SMTPat (h' `HS.contains` x); SMTPat (modifies l h h')]
]
] =
| modifies_liveness_insensitive_mreference loc_none l h h' x | false |
FStar.Modifies.fsti | FStar.Modifies.modifies_liveness_insensitive_buffer_weak | val modifies_liveness_insensitive_buffer_weak (l: loc) (h h': HS.mem) (#t: Type) (x: B.buffer t)
: Lemma
(requires
(modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ B.live h x))
(ensures (B.live h' x))
[
SMTPatOr
[
[SMTPat (B.live h x); SMTPat (modifies l h h')];
[SMTPat (B.live h' x); SMTPat (modifies l h h')]
]
] | val modifies_liveness_insensitive_buffer_weak (l: loc) (h h': HS.mem) (#t: Type) (x: B.buffer t)
: Lemma
(requires
(modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ B.live h x))
(ensures (B.live h' x))
[
SMTPatOr
[
[SMTPat (B.live h x); SMTPat (modifies l h h')];
[SMTPat (B.live h' x); SMTPat (modifies l h h')]
]
] | let modifies_liveness_insensitive_buffer_weak
(l : loc)
(h h' : HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires (modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ B.live h x))
(ensures (B.live h' x))
[SMTPatOr [
[SMTPat (B.live h x); SMTPat (modifies l h h');];
[SMTPat (B.live h' x); SMTPat (modifies l h h');];
]]
= modifies_liveness_insensitive_buffer loc_none l h h' x | {
"file_name": "ulib/FStar.Modifies.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 56,
"end_line": 495,
"start_col": 0,
"start_line": 483
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Modifies
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module B = FStar.Buffer
(*** The modifies clause *)
val loc : Type u#1
val loc_none: loc
val loc_union
(s1 s2: loc)
: GTot loc
(** The following is useful to make Z3 cut matching loops with
modifies_trans and modifies_refl *)
val loc_union_idem
(s: loc)
: Lemma
(loc_union s s == s)
[SMTPat (loc_union s s)]
val loc_union_comm
(s1 s2: loc)
: Lemma
(loc_union s1 s2 == loc_union s2 s1)
[SMTPat (loc_union s1 s2)]
val loc_union_assoc
(s1 s2 s3: loc)
: Lemma
(loc_union s1 (loc_union s2 s3) == loc_union (loc_union s1 s2) s3)
val loc_union_loc_none_l
(s: loc)
: Lemma
(loc_union loc_none s == s)
[SMTPat (loc_union loc_none s)]
val loc_union_loc_none_r
(s: loc)
: Lemma
(loc_union s loc_none == s)
[SMTPat (loc_union s loc_none)]
val loc_buffer
(#t: Type)
(b: B.buffer t)
: GTot loc
val loc_addresses
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: GTot loc
val loc_regions
(preserve_liveness: bool)
(r: Set.set HS.rid)
: GTot loc
let loc_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses true (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_freed_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses false (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_region_only
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (Set.singleton r)
let loc_all_regions_from
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (HS.mod_set (Set.singleton r))
(* Inclusion of memory locations *)
val loc_includes
(s1 s2: loc)
: GTot Type0
val loc_includes_refl
(s: loc)
: Lemma
(loc_includes s s)
[SMTPat (loc_includes s s)]
val loc_includes_trans
(s1 s2 s3: loc)
: Lemma
(requires (loc_includes s1 s2 /\ loc_includes s2 s3))
(ensures (loc_includes s1 s3))
val loc_includes_union_r
(s s1 s2: loc)
: Lemma
(requires (loc_includes s s1 /\ loc_includes s s2))
(ensures (loc_includes s (loc_union s1 s2)))
[SMTPat (loc_includes s (loc_union s1 s2))]
val loc_includes_union_l
(s1 s2 s: loc)
: Lemma
(requires (loc_includes s1 s \/ loc_includes s2 s))
(ensures (loc_includes (loc_union s1 s2) s))
[SMTPat (loc_includes (loc_union s1 s2) s)]
val loc_includes_none
(s: loc)
: Lemma
(loc_includes s loc_none)
[SMTPat (loc_includes s loc_none)]
val loc_includes_buffer
(#t: Type)
(b1 b2: B.buffer t)
: Lemma
(requires (b1 `B.includes` b2))
(ensures (loc_includes (loc_buffer b1) (loc_buffer b2)))
[SMTPatOr [
[SMTPat (B.includes b1 b2)];
[SMTPat (loc_includes(loc_buffer b1) (loc_buffer b2))]
]]
val loc_includes_gsub_buffer_r
(l: loc)
(#t: Type)
(b: B.buffer t)
(i: UInt32.t)
(len: UInt32.t)
: Lemma
(requires (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer b)))
(ensures (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer (B.sub b i len))))
[SMTPat (loc_includes l (loc_buffer (B.sub b i len)))]
val loc_includes_gsub_buffer_l
(#t: Type)
(b: B.buffer t)
(i1: UInt32.t)
(len1: UInt32.t)
(i2: UInt32.t)
(len2: UInt32.t)
: Lemma
(requires (UInt32.v i1 + UInt32.v len1 <= (B.length b) /\ UInt32.v i1 <= UInt32.v i2 /\ UInt32.v i2 + UInt32.v len2 <= UInt32.v i1 + UInt32.v len1))
(ensures (UInt32.v i1 + UInt32.v len1 <= (B.length b) /\ UInt32.v i1 <= UInt32.v i2 /\ UInt32.v i2 + UInt32.v len2 <= UInt32.v i1 + UInt32.v len1 /\ loc_includes (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2))))
[SMTPat (loc_includes (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2)))]
val loc_includes_addresses_buffer
(#t: Type)
(preserve_liveness: bool)
(r: HS.rid)
(s: Set.set nat)
(p: B.buffer t)
: Lemma
(requires (B.frameOf p == r /\ Set.mem (B.as_addr p) s))
(ensures (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p)))
[SMTPat (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p))]
val loc_includes_region_buffer
(#t: Type)
(preserve_liveness: bool)
(s: Set.set HS.rid)
(b: B.buffer t)
: Lemma
(requires (Set.mem (B.frameOf b) s))
(ensures (loc_includes (loc_regions preserve_liveness s) (loc_buffer b)))
[SMTPat (loc_includes (loc_regions preserve_liveness s) (loc_buffer b))]
val loc_includes_region_addresses
(preserve_liveness1: bool)
(preserve_liveness2: bool)
(s: Set.set HS.rid)
(r: HS.rid)
(a: Set.set nat)
: Lemma
(requires (Set.mem r s))
(ensures (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a)))
[SMTPat (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a))]
val loc_includes_region_region
(preserve_liveness1: bool)
(preserve_liveness2: bool)
(s1 s2: Set.set HS.rid)
: Lemma
(requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1))
(ensures (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2)))
[SMTPat (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2))]
val loc_includes_region_union_l
(preserve_liveness: bool)
(l: loc)
(s1 s2: Set.set HS.rid)
: Lemma
(requires (loc_includes l (loc_regions preserve_liveness (Set.intersect s2 (Set.complement s1)))))
(ensures (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2)))
[SMTPat (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2))]
val loc_includes_addresses_addresses
(preserve_liveness1 preserve_liveness2: bool)
(r: HS.rid)
(s1 s2: Set.set nat)
: Lemma
(requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1))
(ensures (loc_includes (loc_addresses preserve_liveness1 r s1) (loc_addresses preserve_liveness2 r s2)))
(* Disjointness of two memory locations *)
val loc_disjoint
(s1 s2: loc)
: GTot Type0
val loc_disjoint_sym
(s1 s2: loc)
: Lemma
(requires (loc_disjoint s1 s2))
(ensures (loc_disjoint s2 s1))
let loc_disjoint_sym'
(s1 s2: loc)
: Lemma
(loc_disjoint s1 s2 <==> loc_disjoint s2 s1)
[SMTPat (loc_disjoint s1 s2)]
= Classical.move_requires (loc_disjoint_sym s1) s2;
Classical.move_requires (loc_disjoint_sym s2) s1
val loc_disjoint_none_r
(s: loc)
: Lemma
(ensures (loc_disjoint s loc_none))
[SMTPat (loc_disjoint s loc_none)]
val loc_disjoint_union_r
(s s1 s2: loc)
: Lemma
(requires (loc_disjoint s s1 /\ loc_disjoint s s2))
(ensures (loc_disjoint s (loc_union s1 s2)))
[SMTPat (loc_disjoint s (loc_union s1 s2))]
val loc_disjoint_includes
(p1 p2 p1' p2' : loc)
: Lemma
(requires (loc_includes p1 p1' /\ loc_includes p2 p2' /\ loc_disjoint p1 p2))
(ensures (loc_disjoint p1' p2'))
[SMTPatOr [
[SMTPat (loc_disjoint p1 p2); SMTPat (loc_disjoint p1' p2')];
[SMTPat (loc_includes p1 p1'); SMTPat (loc_includes p2 p2')];
]]
val loc_disjoint_buffer
(#t1 #t2: Type)
(b1: B.buffer t1)
(b2: B.buffer t2)
: Lemma
(requires (B.disjoint b1 b2))
(ensures (loc_disjoint (loc_buffer b1) (loc_buffer b2)))
[SMTPatOr [
[SMTPat (B.disjoint b1 b2)];
[SMTPat (loc_disjoint (loc_buffer b1) (loc_buffer b2))];
]]
val loc_disjoint_gsub_buffer
(#t: Type)
(b: B.buffer t)
(i1: UInt32.t)
(len1: UInt32.t)
(i2: UInt32.t)
(len2: UInt32.t)
: Lemma
(requires (
UInt32.v i1 + UInt32.v len1 <= (B.length b) /\
UInt32.v i2 + UInt32.v len2 <= (B.length b) /\ (
UInt32.v i1 + UInt32.v len1 <= UInt32.v i2 \/
UInt32.v i2 + UInt32.v len2 <= UInt32.v i1
)))
(ensures (
UInt32.v i1 + UInt32.v len1 <= (B.length b) /\
UInt32.v i2 + UInt32.v len2 <= (B.length b) /\
loc_disjoint (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2))
))
[SMTPat (loc_disjoint (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2)))]
val loc_disjoint_addresses
(preserve_liveness1 preserve_liveness2: bool)
(r1 r2: HS.rid)
(n1 n2: Set.set nat)
: Lemma
(requires (r1 <> r2 \/ Set.subset (Set.intersect n1 n2) Set.empty))
(ensures (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2)))
[SMTPat (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2))]
val loc_disjoint_buffer_addresses
(#t: Type)
(p: B.buffer t)
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: Lemma
(requires (r <> B.frameOf p \/ (~ (Set.mem (B.as_addr p) n))))
(ensures (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n)))
[SMTPat (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n))]
val loc_disjoint_regions
(preserve_liveness1 preserve_liveness2: bool)
(rs1 rs2: Set.set HS.rid)
: Lemma
(requires (Set.subset (Set.intersect rs1 rs2) Set.empty))
(ensures (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2)))
[SMTPat (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2))]
(** The modifies clause proper *)
val modifies
(s: loc)
(h1 h2: HS.mem)
: GTot Type0
val modifies_mreference_elim
(#t: Type)
(#pre: Preorder.preorder t)
(b: HS.mreference t pre)
(p: loc)
(h h': HS.mem)
: Lemma
(requires (
loc_disjoint (loc_mreference b) p /\
HS.contains h b /\
modifies p h h'
))
(ensures (
HS.contains h' b /\
HS.sel h b == HS.sel h' b
))
[SMTPatOr [
[ SMTPat (modifies p h h'); SMTPat (HS.sel h b) ] ;
[ SMTPat (modifies p h h'); SMTPat (HS.contains h b) ];
[ SMTPat (modifies p h h'); SMTPat (HS.sel h' b) ] ;
[ SMTPat (modifies p h h'); SMTPat (HS.contains h' b) ]
] ]
val modifies_buffer_elim
(#t1: Type)
(b: B.buffer t1)
(p: loc)
(h h': HS.mem)
: Lemma
(requires (
loc_disjoint (loc_buffer b) p /\
B.live h b /\
modifies p h h'
))
(ensures (
B.live h' b /\ (
B.as_seq h b == B.as_seq h' b
)))
[SMTPatOr [
[ SMTPat (modifies p h h'); SMTPat (B.as_seq h b) ] ;
[ SMTPat (modifies p h h'); SMTPat (B.live h b) ];
[ SMTPat (modifies p h h'); SMTPat (B.as_seq h' b) ] ;
[ SMTPat (modifies p h h'); SMTPat (B.live h' b) ]
] ]
val modifies_refl
(s: loc)
(h: HS.mem)
: Lemma
(modifies s h h)
[SMTPat (modifies s h h)]
val modifies_loc_includes
(s1: loc)
(h h': HS.mem)
(s2: loc)
: Lemma
(requires (modifies s2 h h' /\ loc_includes s1 s2))
(ensures (modifies s1 h h'))
[SMTPatOr [
[SMTPat (modifies s1 h h'); SMTPat (modifies s2 h h')];
[SMTPat (modifies s1 h h'); SMTPat (loc_includes s1 s2)];
[SMTPat (modifies s2 h h'); SMTPat (loc_includes s1 s2)];
]]
/// Some memory locations are tagged as liveness-insensitive: the
/// liveness preservation of a memory location only depends on its
/// disjointness from the liveness-sensitive memory locations of a
/// modifies clause.
val address_liveness_insensitive_locs: loc
val region_liveness_insensitive_locs: loc
val address_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma
(address_liveness_insensitive_locs `loc_includes` (loc_buffer b))
[SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_buffer b))]
val address_liveness_insensitive_addresses (r: HS.rid) (a: Set.set nat) : Lemma
(address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a))
[SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a))]
val region_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_buffer b))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_buffer b))]
val region_liveness_insensitive_addresses (preserve_liveness: bool) (r: HS.rid) (a: Set.set nat) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a))]
val region_liveness_insensitive_regions (rs: Set.set HS.rid) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_regions true rs))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_regions true rs))]
val region_liveness_insensitive_address_liveness_insensitive:
squash (region_liveness_insensitive_locs `loc_includes` address_liveness_insensitive_locs)
val modifies_liveness_insensitive_mreference
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_mreference x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ h `HS.contains` x))
(ensures (h' `HS.contains` x))
(* TODO: pattern *)
val modifies_liveness_insensitive_buffer
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_buffer x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ B.live h x))
(ensures (B.live h' x))
(* TODO: pattern *)
let modifies_liveness_insensitive_mreference_weak
(l : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ h `HS.contains` x))
(ensures (h' `HS.contains` x))
[SMTPatOr [
[SMTPat (h `HS.contains` x); SMTPat (modifies l h h');];
[SMTPat (h' `HS.contains` x); SMTPat (modifies l h h');];
]]
= modifies_liveness_insensitive_mreference loc_none l h h' x | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.ModifiesGen.fsti.checked",
"FStar.Map.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Heap.fst.checked",
"FStar.Classical.fsti.checked",
"FStar.Buffer.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Modifies.fsti"
} | [
{
"abbrev": true,
"full_module": "FStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
l: FStar.Modifies.loc ->
h: FStar.Monotonic.HyperStack.mem ->
h': FStar.Monotonic.HyperStack.mem ->
x: FStar.Buffer.buffer t
-> FStar.Pervasives.Lemma
(requires
FStar.Modifies.modifies l h h' /\
FStar.Modifies.loc_includes FStar.Modifies.address_liveness_insensitive_locs l /\
FStar.Buffer.live h x)
(ensures FStar.Buffer.live h' x)
[
SMTPatOr [
[SMTPat (FStar.Buffer.live h x); SMTPat (FStar.Modifies.modifies l h h')];
[SMTPat (FStar.Buffer.live h' x); SMTPat (FStar.Modifies.modifies l h h')]
]
] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"FStar.Modifies.loc",
"FStar.Monotonic.HyperStack.mem",
"FStar.Buffer.buffer",
"FStar.Modifies.modifies_liveness_insensitive_buffer",
"FStar.Modifies.loc_none",
"Prims.unit",
"Prims.l_and",
"FStar.Modifies.modifies",
"FStar.Modifies.loc_includes",
"FStar.Modifies.address_liveness_insensitive_locs",
"FStar.Buffer.live",
"Prims.squash",
"Prims.Cons",
"FStar.Pervasives.pattern",
"FStar.Pervasives.smt_pat_or",
"Prims.list",
"FStar.Pervasives.smt_pat",
"Prims.Nil"
] | [] | true | false | true | false | false | let modifies_liveness_insensitive_buffer_weak (l: loc) (h h': HS.mem) (#t: Type) (x: B.buffer t)
: Lemma
(requires
(modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ B.live h x))
(ensures (B.live h' x))
[
SMTPatOr
[
[SMTPat (B.live h x); SMTPat (modifies l h h')];
[SMTPat (B.live h' x); SMTPat (modifies l h h')]
]
] =
| modifies_liveness_insensitive_buffer loc_none l h h' x | false |
FStar.Modifies.fsti | FStar.Modifies.modifies_liveness_insensitive_region_mreference_weak | val modifies_liveness_insensitive_region_mreference_weak
(l2: loc)
(h h': HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires
(modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\
HS.live_region h (HS.frameOf x)))
(ensures (HS.live_region h' (HS.frameOf x)))
[
SMTPatOr
[
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h (HS.frameOf x))];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' (HS.frameOf x))]
]
] | val modifies_liveness_insensitive_region_mreference_weak
(l2: loc)
(h h': HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires
(modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\
HS.live_region h (HS.frameOf x)))
(ensures (HS.live_region h' (HS.frameOf x)))
[
SMTPatOr
[
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h (HS.frameOf x))];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' (HS.frameOf x))]
]
] | let modifies_liveness_insensitive_region_mreference_weak
(l2 : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (HS.frameOf x)))
(ensures (HS.live_region h' (HS.frameOf x)))
[SMTPatOr [
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h (HS.frameOf x))];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' (HS.frameOf x))];
]]
= modifies_liveness_insensitive_region_mreference loc_none l2 h h' x | {
"file_name": "ulib/FStar.Modifies.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 68,
"end_line": 553,
"start_col": 0,
"start_line": 540
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Modifies
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module B = FStar.Buffer
(*** The modifies clause *)
val loc : Type u#1
val loc_none: loc
val loc_union
(s1 s2: loc)
: GTot loc
(** The following is useful to make Z3 cut matching loops with
modifies_trans and modifies_refl *)
val loc_union_idem
(s: loc)
: Lemma
(loc_union s s == s)
[SMTPat (loc_union s s)]
val loc_union_comm
(s1 s2: loc)
: Lemma
(loc_union s1 s2 == loc_union s2 s1)
[SMTPat (loc_union s1 s2)]
val loc_union_assoc
(s1 s2 s3: loc)
: Lemma
(loc_union s1 (loc_union s2 s3) == loc_union (loc_union s1 s2) s3)
val loc_union_loc_none_l
(s: loc)
: Lemma
(loc_union loc_none s == s)
[SMTPat (loc_union loc_none s)]
val loc_union_loc_none_r
(s: loc)
: Lemma
(loc_union s loc_none == s)
[SMTPat (loc_union s loc_none)]
val loc_buffer
(#t: Type)
(b: B.buffer t)
: GTot loc
val loc_addresses
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: GTot loc
val loc_regions
(preserve_liveness: bool)
(r: Set.set HS.rid)
: GTot loc
let loc_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses true (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_freed_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses false (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_region_only
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (Set.singleton r)
let loc_all_regions_from
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (HS.mod_set (Set.singleton r))
(* Inclusion of memory locations *)
val loc_includes
(s1 s2: loc)
: GTot Type0
val loc_includes_refl
(s: loc)
: Lemma
(loc_includes s s)
[SMTPat (loc_includes s s)]
val loc_includes_trans
(s1 s2 s3: loc)
: Lemma
(requires (loc_includes s1 s2 /\ loc_includes s2 s3))
(ensures (loc_includes s1 s3))
val loc_includes_union_r
(s s1 s2: loc)
: Lemma
(requires (loc_includes s s1 /\ loc_includes s s2))
(ensures (loc_includes s (loc_union s1 s2)))
[SMTPat (loc_includes s (loc_union s1 s2))]
val loc_includes_union_l
(s1 s2 s: loc)
: Lemma
(requires (loc_includes s1 s \/ loc_includes s2 s))
(ensures (loc_includes (loc_union s1 s2) s))
[SMTPat (loc_includes (loc_union s1 s2) s)]
val loc_includes_none
(s: loc)
: Lemma
(loc_includes s loc_none)
[SMTPat (loc_includes s loc_none)]
val loc_includes_buffer
(#t: Type)
(b1 b2: B.buffer t)
: Lemma
(requires (b1 `B.includes` b2))
(ensures (loc_includes (loc_buffer b1) (loc_buffer b2)))
[SMTPatOr [
[SMTPat (B.includes b1 b2)];
[SMTPat (loc_includes(loc_buffer b1) (loc_buffer b2))]
]]
val loc_includes_gsub_buffer_r
(l: loc)
(#t: Type)
(b: B.buffer t)
(i: UInt32.t)
(len: UInt32.t)
: Lemma
(requires (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer b)))
(ensures (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer (B.sub b i len))))
[SMTPat (loc_includes l (loc_buffer (B.sub b i len)))]
val loc_includes_gsub_buffer_l
(#t: Type)
(b: B.buffer t)
(i1: UInt32.t)
(len1: UInt32.t)
(i2: UInt32.t)
(len2: UInt32.t)
: Lemma
(requires (UInt32.v i1 + UInt32.v len1 <= (B.length b) /\ UInt32.v i1 <= UInt32.v i2 /\ UInt32.v i2 + UInt32.v len2 <= UInt32.v i1 + UInt32.v len1))
(ensures (UInt32.v i1 + UInt32.v len1 <= (B.length b) /\ UInt32.v i1 <= UInt32.v i2 /\ UInt32.v i2 + UInt32.v len2 <= UInt32.v i1 + UInt32.v len1 /\ loc_includes (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2))))
[SMTPat (loc_includes (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2)))]
val loc_includes_addresses_buffer
(#t: Type)
(preserve_liveness: bool)
(r: HS.rid)
(s: Set.set nat)
(p: B.buffer t)
: Lemma
(requires (B.frameOf p == r /\ Set.mem (B.as_addr p) s))
(ensures (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p)))
[SMTPat (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p))]
val loc_includes_region_buffer
(#t: Type)
(preserve_liveness: bool)
(s: Set.set HS.rid)
(b: B.buffer t)
: Lemma
(requires (Set.mem (B.frameOf b) s))
(ensures (loc_includes (loc_regions preserve_liveness s) (loc_buffer b)))
[SMTPat (loc_includes (loc_regions preserve_liveness s) (loc_buffer b))]
val loc_includes_region_addresses
(preserve_liveness1: bool)
(preserve_liveness2: bool)
(s: Set.set HS.rid)
(r: HS.rid)
(a: Set.set nat)
: Lemma
(requires (Set.mem r s))
(ensures (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a)))
[SMTPat (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a))]
val loc_includes_region_region
(preserve_liveness1: bool)
(preserve_liveness2: bool)
(s1 s2: Set.set HS.rid)
: Lemma
(requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1))
(ensures (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2)))
[SMTPat (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2))]
val loc_includes_region_union_l
(preserve_liveness: bool)
(l: loc)
(s1 s2: Set.set HS.rid)
: Lemma
(requires (loc_includes l (loc_regions preserve_liveness (Set.intersect s2 (Set.complement s1)))))
(ensures (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2)))
[SMTPat (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2))]
val loc_includes_addresses_addresses
(preserve_liveness1 preserve_liveness2: bool)
(r: HS.rid)
(s1 s2: Set.set nat)
: Lemma
(requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1))
(ensures (loc_includes (loc_addresses preserve_liveness1 r s1) (loc_addresses preserve_liveness2 r s2)))
(* Disjointness of two memory locations *)
val loc_disjoint
(s1 s2: loc)
: GTot Type0
val loc_disjoint_sym
(s1 s2: loc)
: Lemma
(requires (loc_disjoint s1 s2))
(ensures (loc_disjoint s2 s1))
let loc_disjoint_sym'
(s1 s2: loc)
: Lemma
(loc_disjoint s1 s2 <==> loc_disjoint s2 s1)
[SMTPat (loc_disjoint s1 s2)]
= Classical.move_requires (loc_disjoint_sym s1) s2;
Classical.move_requires (loc_disjoint_sym s2) s1
val loc_disjoint_none_r
(s: loc)
: Lemma
(ensures (loc_disjoint s loc_none))
[SMTPat (loc_disjoint s loc_none)]
val loc_disjoint_union_r
(s s1 s2: loc)
: Lemma
(requires (loc_disjoint s s1 /\ loc_disjoint s s2))
(ensures (loc_disjoint s (loc_union s1 s2)))
[SMTPat (loc_disjoint s (loc_union s1 s2))]
val loc_disjoint_includes
(p1 p2 p1' p2' : loc)
: Lemma
(requires (loc_includes p1 p1' /\ loc_includes p2 p2' /\ loc_disjoint p1 p2))
(ensures (loc_disjoint p1' p2'))
[SMTPatOr [
[SMTPat (loc_disjoint p1 p2); SMTPat (loc_disjoint p1' p2')];
[SMTPat (loc_includes p1 p1'); SMTPat (loc_includes p2 p2')];
]]
val loc_disjoint_buffer
(#t1 #t2: Type)
(b1: B.buffer t1)
(b2: B.buffer t2)
: Lemma
(requires (B.disjoint b1 b2))
(ensures (loc_disjoint (loc_buffer b1) (loc_buffer b2)))
[SMTPatOr [
[SMTPat (B.disjoint b1 b2)];
[SMTPat (loc_disjoint (loc_buffer b1) (loc_buffer b2))];
]]
val loc_disjoint_gsub_buffer
(#t: Type)
(b: B.buffer t)
(i1: UInt32.t)
(len1: UInt32.t)
(i2: UInt32.t)
(len2: UInt32.t)
: Lemma
(requires (
UInt32.v i1 + UInt32.v len1 <= (B.length b) /\
UInt32.v i2 + UInt32.v len2 <= (B.length b) /\ (
UInt32.v i1 + UInt32.v len1 <= UInt32.v i2 \/
UInt32.v i2 + UInt32.v len2 <= UInt32.v i1
)))
(ensures (
UInt32.v i1 + UInt32.v len1 <= (B.length b) /\
UInt32.v i2 + UInt32.v len2 <= (B.length b) /\
loc_disjoint (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2))
))
[SMTPat (loc_disjoint (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2)))]
val loc_disjoint_addresses
(preserve_liveness1 preserve_liveness2: bool)
(r1 r2: HS.rid)
(n1 n2: Set.set nat)
: Lemma
(requires (r1 <> r2 \/ Set.subset (Set.intersect n1 n2) Set.empty))
(ensures (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2)))
[SMTPat (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2))]
val loc_disjoint_buffer_addresses
(#t: Type)
(p: B.buffer t)
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: Lemma
(requires (r <> B.frameOf p \/ (~ (Set.mem (B.as_addr p) n))))
(ensures (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n)))
[SMTPat (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n))]
val loc_disjoint_regions
(preserve_liveness1 preserve_liveness2: bool)
(rs1 rs2: Set.set HS.rid)
: Lemma
(requires (Set.subset (Set.intersect rs1 rs2) Set.empty))
(ensures (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2)))
[SMTPat (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2))]
(** The modifies clause proper *)
val modifies
(s: loc)
(h1 h2: HS.mem)
: GTot Type0
val modifies_mreference_elim
(#t: Type)
(#pre: Preorder.preorder t)
(b: HS.mreference t pre)
(p: loc)
(h h': HS.mem)
: Lemma
(requires (
loc_disjoint (loc_mreference b) p /\
HS.contains h b /\
modifies p h h'
))
(ensures (
HS.contains h' b /\
HS.sel h b == HS.sel h' b
))
[SMTPatOr [
[ SMTPat (modifies p h h'); SMTPat (HS.sel h b) ] ;
[ SMTPat (modifies p h h'); SMTPat (HS.contains h b) ];
[ SMTPat (modifies p h h'); SMTPat (HS.sel h' b) ] ;
[ SMTPat (modifies p h h'); SMTPat (HS.contains h' b) ]
] ]
val modifies_buffer_elim
(#t1: Type)
(b: B.buffer t1)
(p: loc)
(h h': HS.mem)
: Lemma
(requires (
loc_disjoint (loc_buffer b) p /\
B.live h b /\
modifies p h h'
))
(ensures (
B.live h' b /\ (
B.as_seq h b == B.as_seq h' b
)))
[SMTPatOr [
[ SMTPat (modifies p h h'); SMTPat (B.as_seq h b) ] ;
[ SMTPat (modifies p h h'); SMTPat (B.live h b) ];
[ SMTPat (modifies p h h'); SMTPat (B.as_seq h' b) ] ;
[ SMTPat (modifies p h h'); SMTPat (B.live h' b) ]
] ]
val modifies_refl
(s: loc)
(h: HS.mem)
: Lemma
(modifies s h h)
[SMTPat (modifies s h h)]
val modifies_loc_includes
(s1: loc)
(h h': HS.mem)
(s2: loc)
: Lemma
(requires (modifies s2 h h' /\ loc_includes s1 s2))
(ensures (modifies s1 h h'))
[SMTPatOr [
[SMTPat (modifies s1 h h'); SMTPat (modifies s2 h h')];
[SMTPat (modifies s1 h h'); SMTPat (loc_includes s1 s2)];
[SMTPat (modifies s2 h h'); SMTPat (loc_includes s1 s2)];
]]
/// Some memory locations are tagged as liveness-insensitive: the
/// liveness preservation of a memory location only depends on its
/// disjointness from the liveness-sensitive memory locations of a
/// modifies clause.
val address_liveness_insensitive_locs: loc
val region_liveness_insensitive_locs: loc
val address_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma
(address_liveness_insensitive_locs `loc_includes` (loc_buffer b))
[SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_buffer b))]
val address_liveness_insensitive_addresses (r: HS.rid) (a: Set.set nat) : Lemma
(address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a))
[SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a))]
val region_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_buffer b))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_buffer b))]
val region_liveness_insensitive_addresses (preserve_liveness: bool) (r: HS.rid) (a: Set.set nat) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a))]
val region_liveness_insensitive_regions (rs: Set.set HS.rid) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_regions true rs))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_regions true rs))]
val region_liveness_insensitive_address_liveness_insensitive:
squash (region_liveness_insensitive_locs `loc_includes` address_liveness_insensitive_locs)
val modifies_liveness_insensitive_mreference
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_mreference x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ h `HS.contains` x))
(ensures (h' `HS.contains` x))
(* TODO: pattern *)
val modifies_liveness_insensitive_buffer
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_buffer x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ B.live h x))
(ensures (B.live h' x))
(* TODO: pattern *)
let modifies_liveness_insensitive_mreference_weak
(l : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ h `HS.contains` x))
(ensures (h' `HS.contains` x))
[SMTPatOr [
[SMTPat (h `HS.contains` x); SMTPat (modifies l h h');];
[SMTPat (h' `HS.contains` x); SMTPat (modifies l h h');];
]]
= modifies_liveness_insensitive_mreference loc_none l h h' x
let modifies_liveness_insensitive_buffer_weak
(l : loc)
(h h' : HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires (modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ B.live h x))
(ensures (B.live h' x))
[SMTPatOr [
[SMTPat (B.live h x); SMTPat (modifies l h h');];
[SMTPat (B.live h' x); SMTPat (modifies l h h');];
]]
= modifies_liveness_insensitive_buffer loc_none l h h' x
val modifies_liveness_insensitive_region
(l1 l2 : loc)
(h h' : HS.mem)
(x: HS.rid)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_region_only false x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h x))
(ensures (HS.live_region h' x))
(* TODO: pattern *)
val modifies_liveness_insensitive_region_mreference
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_mreference x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (HS.frameOf x)))
(ensures (HS.live_region h' (HS.frameOf x)))
(* TODO: pattern *)
val modifies_liveness_insensitive_region_buffer
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_buffer x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (B.frameOf x)))
(ensures (HS.live_region h' (B.frameOf x)))
(* TODO: pattern *)
let modifies_liveness_insensitive_region_weak
(l2 : loc)
(h h' : HS.mem)
(x: HS.rid)
: Lemma
(requires (modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h x))
(ensures (HS.live_region h' x))
[SMTPatOr [
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h x)];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' x)];
]]
= modifies_liveness_insensitive_region loc_none l2 h h' x | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.ModifiesGen.fsti.checked",
"FStar.Map.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Heap.fst.checked",
"FStar.Classical.fsti.checked",
"FStar.Buffer.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Modifies.fsti"
} | [
{
"abbrev": true,
"full_module": "FStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
l2: FStar.Modifies.loc ->
h: FStar.Monotonic.HyperStack.mem ->
h': FStar.Monotonic.HyperStack.mem ->
x: FStar.Monotonic.HyperStack.mreference t pre
-> FStar.Pervasives.Lemma
(requires
FStar.Modifies.modifies l2 h h' /\
FStar.Modifies.loc_includes FStar.Modifies.region_liveness_insensitive_locs l2 /\
FStar.Monotonic.HyperStack.live_region h (FStar.Monotonic.HyperStack.frameOf x))
(ensures FStar.Monotonic.HyperStack.live_region h' (FStar.Monotonic.HyperStack.frameOf x))
[
SMTPatOr [
[
SMTPat (FStar.Modifies.modifies l2 h h');
SMTPat (FStar.Monotonic.HyperStack.live_region h
(FStar.Monotonic.HyperStack.frameOf x))
];
[
SMTPat (FStar.Modifies.modifies l2 h h');
SMTPat (FStar.Monotonic.HyperStack.live_region h'
(FStar.Monotonic.HyperStack.frameOf x))
]
]
] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"FStar.Modifies.loc",
"FStar.Monotonic.HyperStack.mem",
"FStar.Preorder.preorder",
"FStar.Monotonic.HyperStack.mreference",
"FStar.Modifies.modifies_liveness_insensitive_region_mreference",
"FStar.Modifies.loc_none",
"Prims.unit",
"Prims.l_and",
"FStar.Modifies.modifies",
"FStar.Modifies.loc_includes",
"FStar.Modifies.region_liveness_insensitive_locs",
"Prims.b2t",
"FStar.Monotonic.HyperStack.live_region",
"FStar.Monotonic.HyperStack.frameOf",
"Prims.squash",
"Prims.Cons",
"FStar.Pervasives.pattern",
"FStar.Pervasives.smt_pat_or",
"Prims.list",
"FStar.Pervasives.smt_pat",
"Prims.bool",
"Prims.Nil"
] | [] | true | false | true | false | false | let modifies_liveness_insensitive_region_mreference_weak
(l2: loc)
(h h': HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires
(modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\
HS.live_region h (HS.frameOf x)))
(ensures (HS.live_region h' (HS.frameOf x)))
[
SMTPatOr
[
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h (HS.frameOf x))];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' (HS.frameOf x))]
]
] =
| modifies_liveness_insensitive_region_mreference loc_none l2 h h' x | false |
Hacl.Spec.BignumQ.Lemmas.fst | Hacl.Spec.BignumQ.Lemmas.lemma_div264_aux | val lemma_div264_aux: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 528)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 264 ==
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240)) | val lemma_div264_aux: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 528)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 264 ==
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240)) | let lemma_div264_aux x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert_norm (pow2 264 == pow2 224 * pow2 40);
assert_norm (pow2 56 == pow2 16 * pow2 40);
assert_norm (pow2 112 == pow2 72 * pow2 40);
assert_norm (pow2 168 == pow2 128 * pow2 40);
assert_norm (pow2 224 == pow2 184 * pow2 40);
assert_norm (pow2 280 == pow2 240 * pow2 40);
assert_norm (0 < pow2 40);
calc (==) {
wide_as_nat5 x / pow2 264;
(==) { FStar.Math.Lemmas.division_multiplication_lemma (wide_as_nat5 x) (pow2 224) (pow2 40) }
(wide_as_nat5 x / pow2 224) / pow2 40;
(==) { lemma_div224 x }
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) / pow2 40;
(==) { _ by (Tactics.mapply (`feq #int #int (fun x -> x / pow2 40)); int_semiring ()) }
(v x4 + (v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240) * pow2 40) / pow2 40;
(==) { FStar.Math.Lemmas.lemma_div_plus (v x4) (v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240) (pow2 40) }
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240;
} | {
"file_name": "code/ed25519/Hacl.Spec.BignumQ.Lemmas.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 356,
"start_col": 0,
"start_line": 336
} | module Hacl.Spec.BignumQ.Lemmas
open FStar.Tactics.CanonCommSemiring
open FStar.Mul
open Lib.IntTypes
module S = Spec.Ed25519
include Hacl.Spec.BignumQ.Definitions
let feq (#a #b:Type) (f:(a -> b)) (x y:a) :
Lemma (requires x == y) (ensures f x == f y) = ()
let eq_eq2 (#a:eqtype) (x y:a) :
Lemma (requires x = y) (ensures x == y) = ()
val lemma_mul_lt:a:nat -> b:nat -> c:nat -> d:nat ->
Lemma
(requires a < b /\ c < d)
(ensures a * c < b * d)
let lemma_mul_lt a b c d = ()
val lemma_as_nat5: f:qelem5 ->
Lemma
(requires qelem_fits5 f (1, 1, 1, 1, 1))
(ensures as_nat5 f < pow2 280)
let lemma_as_nat5 f =
//let (f0, f1, f2, f3, f4) = f in
//assert (as_nat5 f == v f0 + v f1 * pow56 + v f2 * pow112 + v f3 * pow168 + v f4 * pow224);
assert_norm (pow2 56 * pow2 56 = pow2 112);
assert_norm (pow2 56 * pow2 112 = pow2 168);
assert_norm (pow2 56 * pow2 168 = pow2 224);
assert_norm (pow2 56 * pow2 224 = pow2 280)
val lemma_choose_step:
bit:uint64{v bit <= 1}
-> x:uint64
-> y:uint64
-> Lemma
(let mask = bit -. u64 1 in
let z = x ^. (mask &. (x ^. y)) in
if v bit = 1 then z == x else z == y)
let lemma_choose_step bit p1 p2 =
let mask = bit -. u64 1 in
assert (v bit == 0 ==> v mask == pow2 64 - 1);
assert (v bit == 1 ==> v mask == 0);
let dummy = mask &. (p1 ^. p2) in
logand_lemma mask (p1 ^. p2);
assert (v bit == 1 ==> v dummy == 0);
assert (v bit == 0 ==> v dummy == v (p1 ^. p2));
let p1' = p1 ^. dummy in
assert (v dummy == v (if v bit = 1 then u64 0 else (p1 ^. p2)));
logxor_lemma p1 p2
val lemma_subm_conditional:
x0:nat -> x1:nat -> x2:nat -> x3:nat -> x4:nat
-> y0:nat -> y1:nat -> y2:nat -> y3:nat -> y4:nat
-> b0:nat -> b1:nat -> b2:nat -> b3:nat -> b4:nat ->
Lemma (
x0 - y0 + b0 * pow2 56 +
(x1 - y1 - b0 + b1 * pow2 56) * pow2 56 +
(x2 - y2 - b1 + b2 * pow2 56) * pow2 112 +
(x3 - y3 - b2 + b3 * pow2 56) * pow2 168 +
(x4 - y4 - b3 + b4 * pow2 56) * pow2 224 ==
(x0 + x1 * pow2 56 + x2 * pow2 112 + x3 * pow2 168 + x4 * pow2 224) -
(y0 + y1 * pow2 56 + y2 * pow2 112 + y3 * pow2 168 + y4 * pow2 224) + b4 * pow2 280)
let lemma_subm_conditional x0 x1 x2 x3 x4 y0 y1 y2 y3 y4 b0 b1 b2 b3 b4 =
assert_norm (pow2 56 * pow2 56 = pow2 112);
assert_norm (pow2 56 * pow2 112 = pow2 168);
assert_norm (pow2 56 * pow2 168 = pow2 224);
assert_norm (pow2 56 * pow2 224 = pow2 280);
assert (
x0 - y0 + b0 * pow2 56 +
(x1 - y1 - b0 + b1 * pow2 56) * pow2 56 +
(x2 - y2 - b1 + b2 * pow2 56) * pow2 112 +
(x3 - y3 - b2 + b3 * pow2 56) * pow2 168 +
(x4 - y4 - b3 + b4 * pow2 56) * pow2 224 ==
(x0 + x1 * pow2 56 + x2 * pow2 112 + x3 * pow2 168 + x4 * pow2 224) -
(y0 + y1 * pow2 56 + y2 * pow2 112 + y3 * pow2 168 + y4 * pow2 224) + b4 * pow2 280)
by (int_semiring ());
()
val lemma_div224: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 224 ==
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280))
#push-options "--z3rlimit 50"
let lemma_div224 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert
(wide_as_nat5 x ==
v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168 + v x4 * pow2 224 +
v x5 * pow2 280 + v x6 * pow2 336 + v x7 * pow2 392 + v x8 * pow2 448 + v x9 * pow2 504);
assert_norm (pow2 56 * pow2 224 == pow2 280);
assert_norm (pow2 112 * pow2 224 == pow2 336);
assert_norm (pow2 168 * pow2 224 == pow2 392);
assert_norm (pow2 224 * pow2 224 == pow2 448);
assert_norm (pow2 280 * pow2 224 == pow2 504);
calc (==) {
wide_as_nat5 x / pow2 224;
(==) { }
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168 +
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) * pow2 224) / pow2 224;
(==) {
FStar.Math.Lemmas.lemma_div_plus
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168)
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) (pow2 224) }
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168) / pow2 224 +
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280;
(==) { FStar.Math.Lemmas.small_division_lemma_1 (v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168) (pow2 224) }
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280;
}
#pop-options
val lemma_div248_aux: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 512)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 248 ==
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256))
open FStar.Tactics.CanonCommSemiring
#push-options "--z3cliopt smt.arith.nl=false"
let lemma_div248_aux x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert_norm (pow2 248 == pow2 224 * pow2 24);
assert_norm (pow2 56 == pow2 32 * pow2 24);
assert_norm (pow2 112 == pow2 88 * pow2 24);
assert_norm (pow2 168 == pow2 144 * pow2 24);
assert_norm (pow2 224 == pow2 200 * pow2 24);
assert_norm (pow2 280 == pow2 256 * pow2 24);
assert_norm (0 < pow2 24);
calc (==) {
wide_as_nat5 x / pow2 248;
(==) { FStar.Math.Lemmas.division_multiplication_lemma (wide_as_nat5 x) (pow2 224) (pow2 24) }
(wide_as_nat5 x / pow2 224) / pow2 24;
(==) { lemma_div224 x }
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) / pow2 24;
(==) { _ by (Tactics.mapply (`feq #int #int (fun x -> x / pow2 24)); int_semiring ()) } (v x4 + (v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256) * pow2 24) / pow2 24;
(==) { FStar.Math.Lemmas.lemma_div_plus (v x4) (v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256) (pow2 24) }
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256;
}
#pop-options
val lemma_div248_x5: x5:uint64 ->
Lemma ( pow2 32 * (v x5 % pow2 24) + v x5 / pow2 24 * pow2 56 == v x5 * pow2 32)
let lemma_div248_x5 x5 =
assert_norm (pow2 32 * pow2 24 = pow2 56)
val lemma_div248_x6: x6:uint64 ->
Lemma (pow2 32 * (v x6 % pow2 24) * pow2 56 + v x6 / pow2 24 * pow2 112 == v x6 * pow2 88)
let lemma_div248_x6 x6 =
calc (==) {
pow2 32 * (v x6 % pow2 24) * pow2 56 + v x6 / pow2 24 * pow2 112;
(==) { _ by (Tactics.norm [delta_only [`%pow2]; primops]; int_semiring ()) }
((v x6 / pow2 24) * pow2 24 + v x6 % pow2 24) * pow2 88;
(==) { FStar.Math.Lemmas.euclidean_division_definition (v x6) (pow2 24) }
v x6 * pow2 88;
}
val lemma_div248_x7: x7:uint64 ->
Lemma (pow2 32 * (v x7 % pow2 24) * pow2 112 + v x7 / pow2 24 * pow2 168 == v x7 * pow2 144)
let lemma_div248_x7 x7 =
calc (==) {
pow2 32 * (v x7 % pow2 24) * pow2 112 + v x7 / pow2 24 * pow2 168;
(==) { _ by (Tactics.norm [delta_only [`%pow2]; primops]; int_semiring ()) }
((v x7 / pow2 24) * pow2 24 + v x7 % pow2 24) * pow2 144;
(==) { FStar.Math.Lemmas.euclidean_division_definition (v x7) (pow2 24) }
v x7 * pow2 144;
}
val lemma_div248_x8: x8:uint64 ->
Lemma (pow2 32 * (v x8 % pow2 24) * pow2 168 + v x8 / pow2 24 * pow2 224 == v x8 * pow2 200)
let lemma_div248_x8 x8 =
calc (==) {
pow2 32 * (v x8 % pow2 24) * pow2 168 + v x8 / pow2 24 * pow2 224;
(==) { _ by (Tactics.norm [delta_only [`%pow2]; primops]; int_semiring ()) }
((v x8 / pow2 24) * pow2 24 + v x8 % pow2 24) * pow2 200;
(==) { FStar.Math.Lemmas.euclidean_division_definition (v x8) (pow2 24) }
v x8 * pow2 200;
}
val lemma_div248_x9: x9:uint64{v x9 < pow2 24} ->
Lemma (pow2 32 * (v x9 % pow2 24) * pow2 224 == v x9 * pow2 256)
let lemma_div248_x9 x9 =
calc (==) {
pow2 32 * (v x9 % pow2 24) * pow2 224;
(==) { Math.Lemmas.small_mod (v x9) (pow2 24) }
pow2 32 * v x9 * pow2 224;
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
v x9 * pow2 256;
}
val lemma_wide_as_nat_pow512: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 512)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
v x9 < pow2 24))
let lemma_wide_as_nat_pow512 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert_norm (pow2 504 * pow2 8 = pow2 512);
FStar.Math.Lemmas.pow2_minus 512 504;
assert (v x9 < pow2 8);
assert_norm (pow2 8 < pow2 24)
val lemma_div248: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 512)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
let z0 = v x4 / pow2 24 + pow2 32 * (v x5 % pow2 24) in
let z1 = v x5 / pow2 24 + pow2 32 * (v x6 % pow2 24) in
let z2 = v x6 / pow2 24 + pow2 32 * (v x7 % pow2 24) in
let z3 = v x7 / pow2 24 + pow2 32 * (v x8 % pow2 24) in
let z4 = v x8 / pow2 24 + pow2 32 * (v x9 % pow2 24) in
wide_as_nat5 x / pow2 248 == z0 + z1 * pow2 56 + z2 * pow2 112 + z3 * pow2 168 + z4 * pow2 224))
#push-options "--z3rlimit 50"
let lemma_div248 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
lemma_wide_as_nat_pow512 x;
assert (v x9 < pow2 24);
calc (==) {
(let z0 = v x4 / pow2 24 + pow2 32 * (v x5 % pow2 24) in
let z1 = v x5 / pow2 24 + pow2 32 * (v x6 % pow2 24) in
let z2 = v x6 / pow2 24 + pow2 32 * (v x7 % pow2 24) in
let z3 = v x7 / pow2 24 + pow2 32 * (v x8 % pow2 24) in
let z4 = v x8 / pow2 24 + pow2 32 * (v x9 % pow2 24) in
z0 + z1 * pow2 56 + z2 * pow2 112 + z3 * pow2 168 + z4 * pow2 224);
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
v x4 / pow2 24 + pow2 32 * (v x5 % pow2 24) +
v x5 / pow2 24 * pow2 56 + pow2 32 * (v x6 % pow2 24) * pow2 56 +
v x6 / pow2 24 * pow2 112 + pow2 32 * (v x7 % pow2 24) * pow2 112 +
v x7 / pow2 24 * pow2 168 + pow2 32 * (v x8 % pow2 24) * pow2 168 +
v x8 / pow2 24 * pow2 224 + pow2 32 * (v x9 % pow2 24) * pow2 224;
(==) { lemma_div248_x5 x5; lemma_div248_x6 x6 }
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 +
pow2 32 * (v x7 % pow2 24) * pow2 112 +
v x7 / pow2 24 * pow2 168 + pow2 32 * (v x8 % pow2 24) * pow2 168 +
v x8 / pow2 24 * pow2 224 + pow2 32 * (v x9 % pow2 24) * pow2 224;
(==) { lemma_div248_x7 x7; lemma_div248_x8 x8 }
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 +
pow2 32 * (v x9 % pow2 24) * pow2 224;
(==) { lemma_div248_x9 x9 }
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256;
(==) { lemma_div248_aux x }
wide_as_nat5 x / pow2 248;
}
#pop-options
val lemma_add_modq5:
x:qelem5
-> y:qelem5
-> t:qelem5 ->
Lemma
(requires
qelem_fits5 x (1, 1, 1, 1, 1) /\
qelem_fits5 y (1, 1, 1, 1, 1) /\
qelem_fits5 t (1, 1, 1, 1, 1) /\
as_nat5 x < S.q /\ as_nat5 y < S.q /\
as_nat5 t == as_nat5 x + as_nat5 y)
(ensures
(let res = if as_nat5 t >= S.q then as_nat5 t - S.q else as_nat5 t in
res < S.q /\ res == (as_nat5 x + as_nat5 y) % S.q))
let lemma_add_modq5 x y t =
assert (as_nat5 t == as_nat5 x + as_nat5 y);
let res = if as_nat5 t >= S.q then as_nat5 t - S.q else as_nat5 t in
assert (res < S.q);
if as_nat5 t >= S.q then (
FStar.Math.Lemmas.sub_div_mod_1 (as_nat5 t) S.q;
assert (res % S.q == as_nat5 t % S.q))
else
assert (res % S.q == as_nat5 t % S.q);
FStar.Math.Lemmas.small_mod res S.q
val lemma_wide_as_nat_pow528: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 528)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
v x9 < pow2 40))
let lemma_wide_as_nat_pow528 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert_norm (pow2 504 * pow2 24 = pow2 528);
FStar.Math.Lemmas.pow2_minus 528 504;
assert (v x9 < pow2 24);
assert_norm (pow2 24 < pow2 40)
#push-options "--z3cliopt smt.arith.nl=false"
val lemma_div264_aux: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 528)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 264 ==
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240)) | {
"checked_file": "/",
"dependencies": [
"Spec.Ed25519.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.BignumQ.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.CanonCommSemiring.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.BignumQ.Lemmas.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommSemiring",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.Ed25519",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommSemiring",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: Hacl.Spec.BignumQ.Definitions.qelem_wide5
-> FStar.Pervasives.Lemma
(requires
Hacl.Spec.BignumQ.Definitions.qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
Hacl.Spec.BignumQ.Definitions.wide_as_nat5 x < Prims.pow2 528)
(ensures
(let _ = x in
(let
FStar.Pervasives.Native.Mktuple10
#_
#_
#_
#_
#_
#_
#_
#_
#_
#_
_
_
_
_
x4
x5
x6
x7
x8
x9 =
_
in
Hacl.Spec.BignumQ.Definitions.wide_as_nat5 x / Prims.pow2 264 ==
Lib.IntTypes.v x4 / Prims.pow2 40 + Lib.IntTypes.v x5 * Prims.pow2 16 +
Lib.IntTypes.v x6 * Prims.pow2 72 +
Lib.IntTypes.v x7 * Prims.pow2 128 +
Lib.IntTypes.v x8 * Prims.pow2 184 +
Lib.IntTypes.v x9 * Prims.pow2 240)
<:
Type0)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Hacl.Spec.BignumQ.Definitions.qelem_wide5",
"Lib.IntTypes.uint64",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Prims.op_Division",
"Hacl.Spec.BignumQ.Definitions.wide_as_nat5",
"Prims.pow2",
"Prims.op_Addition",
"Lib.IntTypes.v",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"FStar.Mul.op_Star",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"FStar.Math.Lemmas.division_multiplication_lemma",
"Prims.squash",
"Hacl.Spec.BignumQ.Lemmas.lemma_div224",
"FStar.Math.Lemmas.lemma_div_plus",
"FStar.Pervasives.assert_norm",
"Prims.b2t",
"Prims.op_LessThan"
] | [] | false | false | true | false | false | let lemma_div264_aux x =
| let x0, x1, x2, x3, x4, x5, x6, x7, x8, x9 = x in
assert_norm (pow2 264 == pow2 224 * pow2 40);
assert_norm (pow2 56 == pow2 16 * pow2 40);
assert_norm (pow2 112 == pow2 72 * pow2 40);
assert_norm (pow2 168 == pow2 128 * pow2 40);
assert_norm (pow2 224 == pow2 184 * pow2 40);
assert_norm (pow2 280 == pow2 240 * pow2 40);
assert_norm (0 < pow2 40);
calc ( == ) {
wide_as_nat5 x / pow2 264;
( == ) { FStar.Math.Lemmas.division_multiplication_lemma (wide_as_nat5 x) (pow2 224) (pow2 40) }
(wide_as_nat5 x / pow2 224) / pow2 40;
( == ) { lemma_div224 x }
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) /
pow2 40;
( == ) { FStar.Tactics.Effect.synth_by_tactic (fun _ ->
(Tactics.mapply (`feq #int #int (fun x -> x / pow2 40));
int_semiring ())) }
(v x4 +
(v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240) *
pow2 40) /
pow2 40;
( == ) { FStar.Math.Lemmas.lemma_div_plus (v x4)
(v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240)
(pow2 40) }
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 +
v x9 * pow2 240;
} | false |
FStar.Modifies.fsti | FStar.Modifies.modifies_liveness_insensitive_region_buffer_weak | val modifies_liveness_insensitive_region_buffer_weak
(l2: loc)
(h h': HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires
(modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\
HS.live_region h (B.frameOf x)))
(ensures (HS.live_region h' (B.frameOf x)))
[
SMTPatOr
[
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h (B.frameOf x))];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' (B.frameOf x))]
]
] | val modifies_liveness_insensitive_region_buffer_weak
(l2: loc)
(h h': HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires
(modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\
HS.live_region h (B.frameOf x)))
(ensures (HS.live_region h' (B.frameOf x)))
[
SMTPatOr
[
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h (B.frameOf x))];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' (B.frameOf x))]
]
] | let modifies_liveness_insensitive_region_buffer_weak
(l2 : loc)
(h h' : HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires (modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (B.frameOf x)))
(ensures (HS.live_region h' (B.frameOf x)))
[SMTPatOr [
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h (B.frameOf x))];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' (B.frameOf x))];
]]
= modifies_liveness_insensitive_region_buffer loc_none l2 h h' x | {
"file_name": "ulib/FStar.Modifies.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 64,
"end_line": 567,
"start_col": 0,
"start_line": 555
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Modifies
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module B = FStar.Buffer
(*** The modifies clause *)
val loc : Type u#1
val loc_none: loc
val loc_union
(s1 s2: loc)
: GTot loc
(** The following is useful to make Z3 cut matching loops with
modifies_trans and modifies_refl *)
val loc_union_idem
(s: loc)
: Lemma
(loc_union s s == s)
[SMTPat (loc_union s s)]
val loc_union_comm
(s1 s2: loc)
: Lemma
(loc_union s1 s2 == loc_union s2 s1)
[SMTPat (loc_union s1 s2)]
val loc_union_assoc
(s1 s2 s3: loc)
: Lemma
(loc_union s1 (loc_union s2 s3) == loc_union (loc_union s1 s2) s3)
val loc_union_loc_none_l
(s: loc)
: Lemma
(loc_union loc_none s == s)
[SMTPat (loc_union loc_none s)]
val loc_union_loc_none_r
(s: loc)
: Lemma
(loc_union s loc_none == s)
[SMTPat (loc_union s loc_none)]
val loc_buffer
(#t: Type)
(b: B.buffer t)
: GTot loc
val loc_addresses
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: GTot loc
val loc_regions
(preserve_liveness: bool)
(r: Set.set HS.rid)
: GTot loc
let loc_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses true (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_freed_mreference
(#a: Type)
(#p: Preorder.preorder a)
(b: HS.mreference a p)
: GTot loc
= loc_addresses false (HS.frameOf b) (Set.singleton (HS.as_addr b))
let loc_region_only
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (Set.singleton r)
let loc_all_regions_from
(preserve_liveness: bool)
(r: HS.rid)
: GTot loc
= loc_regions preserve_liveness (HS.mod_set (Set.singleton r))
(* Inclusion of memory locations *)
val loc_includes
(s1 s2: loc)
: GTot Type0
val loc_includes_refl
(s: loc)
: Lemma
(loc_includes s s)
[SMTPat (loc_includes s s)]
val loc_includes_trans
(s1 s2 s3: loc)
: Lemma
(requires (loc_includes s1 s2 /\ loc_includes s2 s3))
(ensures (loc_includes s1 s3))
val loc_includes_union_r
(s s1 s2: loc)
: Lemma
(requires (loc_includes s s1 /\ loc_includes s s2))
(ensures (loc_includes s (loc_union s1 s2)))
[SMTPat (loc_includes s (loc_union s1 s2))]
val loc_includes_union_l
(s1 s2 s: loc)
: Lemma
(requires (loc_includes s1 s \/ loc_includes s2 s))
(ensures (loc_includes (loc_union s1 s2) s))
[SMTPat (loc_includes (loc_union s1 s2) s)]
val loc_includes_none
(s: loc)
: Lemma
(loc_includes s loc_none)
[SMTPat (loc_includes s loc_none)]
val loc_includes_buffer
(#t: Type)
(b1 b2: B.buffer t)
: Lemma
(requires (b1 `B.includes` b2))
(ensures (loc_includes (loc_buffer b1) (loc_buffer b2)))
[SMTPatOr [
[SMTPat (B.includes b1 b2)];
[SMTPat (loc_includes(loc_buffer b1) (loc_buffer b2))]
]]
val loc_includes_gsub_buffer_r
(l: loc)
(#t: Type)
(b: B.buffer t)
(i: UInt32.t)
(len: UInt32.t)
: Lemma
(requires (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer b)))
(ensures (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer (B.sub b i len))))
[SMTPat (loc_includes l (loc_buffer (B.sub b i len)))]
val loc_includes_gsub_buffer_l
(#t: Type)
(b: B.buffer t)
(i1: UInt32.t)
(len1: UInt32.t)
(i2: UInt32.t)
(len2: UInt32.t)
: Lemma
(requires (UInt32.v i1 + UInt32.v len1 <= (B.length b) /\ UInt32.v i1 <= UInt32.v i2 /\ UInt32.v i2 + UInt32.v len2 <= UInt32.v i1 + UInt32.v len1))
(ensures (UInt32.v i1 + UInt32.v len1 <= (B.length b) /\ UInt32.v i1 <= UInt32.v i2 /\ UInt32.v i2 + UInt32.v len2 <= UInt32.v i1 + UInt32.v len1 /\ loc_includes (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2))))
[SMTPat (loc_includes (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2)))]
val loc_includes_addresses_buffer
(#t: Type)
(preserve_liveness: bool)
(r: HS.rid)
(s: Set.set nat)
(p: B.buffer t)
: Lemma
(requires (B.frameOf p == r /\ Set.mem (B.as_addr p) s))
(ensures (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p)))
[SMTPat (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p))]
val loc_includes_region_buffer
(#t: Type)
(preserve_liveness: bool)
(s: Set.set HS.rid)
(b: B.buffer t)
: Lemma
(requires (Set.mem (B.frameOf b) s))
(ensures (loc_includes (loc_regions preserve_liveness s) (loc_buffer b)))
[SMTPat (loc_includes (loc_regions preserve_liveness s) (loc_buffer b))]
val loc_includes_region_addresses
(preserve_liveness1: bool)
(preserve_liveness2: bool)
(s: Set.set HS.rid)
(r: HS.rid)
(a: Set.set nat)
: Lemma
(requires (Set.mem r s))
(ensures (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a)))
[SMTPat (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a))]
val loc_includes_region_region
(preserve_liveness1: bool)
(preserve_liveness2: bool)
(s1 s2: Set.set HS.rid)
: Lemma
(requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1))
(ensures (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2)))
[SMTPat (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2))]
val loc_includes_region_union_l
(preserve_liveness: bool)
(l: loc)
(s1 s2: Set.set HS.rid)
: Lemma
(requires (loc_includes l (loc_regions preserve_liveness (Set.intersect s2 (Set.complement s1)))))
(ensures (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2)))
[SMTPat (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2))]
val loc_includes_addresses_addresses
(preserve_liveness1 preserve_liveness2: bool)
(r: HS.rid)
(s1 s2: Set.set nat)
: Lemma
(requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1))
(ensures (loc_includes (loc_addresses preserve_liveness1 r s1) (loc_addresses preserve_liveness2 r s2)))
(* Disjointness of two memory locations *)
val loc_disjoint
(s1 s2: loc)
: GTot Type0
val loc_disjoint_sym
(s1 s2: loc)
: Lemma
(requires (loc_disjoint s1 s2))
(ensures (loc_disjoint s2 s1))
let loc_disjoint_sym'
(s1 s2: loc)
: Lemma
(loc_disjoint s1 s2 <==> loc_disjoint s2 s1)
[SMTPat (loc_disjoint s1 s2)]
= Classical.move_requires (loc_disjoint_sym s1) s2;
Classical.move_requires (loc_disjoint_sym s2) s1
val loc_disjoint_none_r
(s: loc)
: Lemma
(ensures (loc_disjoint s loc_none))
[SMTPat (loc_disjoint s loc_none)]
val loc_disjoint_union_r
(s s1 s2: loc)
: Lemma
(requires (loc_disjoint s s1 /\ loc_disjoint s s2))
(ensures (loc_disjoint s (loc_union s1 s2)))
[SMTPat (loc_disjoint s (loc_union s1 s2))]
val loc_disjoint_includes
(p1 p2 p1' p2' : loc)
: Lemma
(requires (loc_includes p1 p1' /\ loc_includes p2 p2' /\ loc_disjoint p1 p2))
(ensures (loc_disjoint p1' p2'))
[SMTPatOr [
[SMTPat (loc_disjoint p1 p2); SMTPat (loc_disjoint p1' p2')];
[SMTPat (loc_includes p1 p1'); SMTPat (loc_includes p2 p2')];
]]
val loc_disjoint_buffer
(#t1 #t2: Type)
(b1: B.buffer t1)
(b2: B.buffer t2)
: Lemma
(requires (B.disjoint b1 b2))
(ensures (loc_disjoint (loc_buffer b1) (loc_buffer b2)))
[SMTPatOr [
[SMTPat (B.disjoint b1 b2)];
[SMTPat (loc_disjoint (loc_buffer b1) (loc_buffer b2))];
]]
val loc_disjoint_gsub_buffer
(#t: Type)
(b: B.buffer t)
(i1: UInt32.t)
(len1: UInt32.t)
(i2: UInt32.t)
(len2: UInt32.t)
: Lemma
(requires (
UInt32.v i1 + UInt32.v len1 <= (B.length b) /\
UInt32.v i2 + UInt32.v len2 <= (B.length b) /\ (
UInt32.v i1 + UInt32.v len1 <= UInt32.v i2 \/
UInt32.v i2 + UInt32.v len2 <= UInt32.v i1
)))
(ensures (
UInt32.v i1 + UInt32.v len1 <= (B.length b) /\
UInt32.v i2 + UInt32.v len2 <= (B.length b) /\
loc_disjoint (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2))
))
[SMTPat (loc_disjoint (loc_buffer (B.sub b i1 len1)) (loc_buffer (B.sub b i2 len2)))]
val loc_disjoint_addresses
(preserve_liveness1 preserve_liveness2: bool)
(r1 r2: HS.rid)
(n1 n2: Set.set nat)
: Lemma
(requires (r1 <> r2 \/ Set.subset (Set.intersect n1 n2) Set.empty))
(ensures (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2)))
[SMTPat (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2))]
val loc_disjoint_buffer_addresses
(#t: Type)
(p: B.buffer t)
(preserve_liveness: bool)
(r: HS.rid)
(n: Set.set nat)
: Lemma
(requires (r <> B.frameOf p \/ (~ (Set.mem (B.as_addr p) n))))
(ensures (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n)))
[SMTPat (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n))]
val loc_disjoint_regions
(preserve_liveness1 preserve_liveness2: bool)
(rs1 rs2: Set.set HS.rid)
: Lemma
(requires (Set.subset (Set.intersect rs1 rs2) Set.empty))
(ensures (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2)))
[SMTPat (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2))]
(** The modifies clause proper *)
val modifies
(s: loc)
(h1 h2: HS.mem)
: GTot Type0
val modifies_mreference_elim
(#t: Type)
(#pre: Preorder.preorder t)
(b: HS.mreference t pre)
(p: loc)
(h h': HS.mem)
: Lemma
(requires (
loc_disjoint (loc_mreference b) p /\
HS.contains h b /\
modifies p h h'
))
(ensures (
HS.contains h' b /\
HS.sel h b == HS.sel h' b
))
[SMTPatOr [
[ SMTPat (modifies p h h'); SMTPat (HS.sel h b) ] ;
[ SMTPat (modifies p h h'); SMTPat (HS.contains h b) ];
[ SMTPat (modifies p h h'); SMTPat (HS.sel h' b) ] ;
[ SMTPat (modifies p h h'); SMTPat (HS.contains h' b) ]
] ]
val modifies_buffer_elim
(#t1: Type)
(b: B.buffer t1)
(p: loc)
(h h': HS.mem)
: Lemma
(requires (
loc_disjoint (loc_buffer b) p /\
B.live h b /\
modifies p h h'
))
(ensures (
B.live h' b /\ (
B.as_seq h b == B.as_seq h' b
)))
[SMTPatOr [
[ SMTPat (modifies p h h'); SMTPat (B.as_seq h b) ] ;
[ SMTPat (modifies p h h'); SMTPat (B.live h b) ];
[ SMTPat (modifies p h h'); SMTPat (B.as_seq h' b) ] ;
[ SMTPat (modifies p h h'); SMTPat (B.live h' b) ]
] ]
val modifies_refl
(s: loc)
(h: HS.mem)
: Lemma
(modifies s h h)
[SMTPat (modifies s h h)]
val modifies_loc_includes
(s1: loc)
(h h': HS.mem)
(s2: loc)
: Lemma
(requires (modifies s2 h h' /\ loc_includes s1 s2))
(ensures (modifies s1 h h'))
[SMTPatOr [
[SMTPat (modifies s1 h h'); SMTPat (modifies s2 h h')];
[SMTPat (modifies s1 h h'); SMTPat (loc_includes s1 s2)];
[SMTPat (modifies s2 h h'); SMTPat (loc_includes s1 s2)];
]]
/// Some memory locations are tagged as liveness-insensitive: the
/// liveness preservation of a memory location only depends on its
/// disjointness from the liveness-sensitive memory locations of a
/// modifies clause.
val address_liveness_insensitive_locs: loc
val region_liveness_insensitive_locs: loc
val address_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma
(address_liveness_insensitive_locs `loc_includes` (loc_buffer b))
[SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_buffer b))]
val address_liveness_insensitive_addresses (r: HS.rid) (a: Set.set nat) : Lemma
(address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a))
[SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a))]
val region_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_buffer b))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_buffer b))]
val region_liveness_insensitive_addresses (preserve_liveness: bool) (r: HS.rid) (a: Set.set nat) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a))]
val region_liveness_insensitive_regions (rs: Set.set HS.rid) : Lemma
(region_liveness_insensitive_locs `loc_includes` (loc_regions true rs))
[SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_regions true rs))]
val region_liveness_insensitive_address_liveness_insensitive:
squash (region_liveness_insensitive_locs `loc_includes` address_liveness_insensitive_locs)
val modifies_liveness_insensitive_mreference
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_mreference x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ h `HS.contains` x))
(ensures (h' `HS.contains` x))
(* TODO: pattern *)
val modifies_liveness_insensitive_buffer
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_buffer x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ B.live h x))
(ensures (B.live h' x))
(* TODO: pattern *)
let modifies_liveness_insensitive_mreference_weak
(l : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ h `HS.contains` x))
(ensures (h' `HS.contains` x))
[SMTPatOr [
[SMTPat (h `HS.contains` x); SMTPat (modifies l h h');];
[SMTPat (h' `HS.contains` x); SMTPat (modifies l h h');];
]]
= modifies_liveness_insensitive_mreference loc_none l h h' x
let modifies_liveness_insensitive_buffer_weak
(l : loc)
(h h' : HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires (modifies l h h' /\ address_liveness_insensitive_locs `loc_includes` l /\ B.live h x))
(ensures (B.live h' x))
[SMTPatOr [
[SMTPat (B.live h x); SMTPat (modifies l h h');];
[SMTPat (B.live h' x); SMTPat (modifies l h h');];
]]
= modifies_liveness_insensitive_buffer loc_none l h h' x
val modifies_liveness_insensitive_region
(l1 l2 : loc)
(h h' : HS.mem)
(x: HS.rid)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_region_only false x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h x))
(ensures (HS.live_region h' x))
(* TODO: pattern *)
val modifies_liveness_insensitive_region_mreference
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_mreference x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (HS.frameOf x)))
(ensures (HS.live_region h' (HS.frameOf x)))
(* TODO: pattern *)
val modifies_liveness_insensitive_region_buffer
(l1 l2 : loc)
(h h' : HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_buffer x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (B.frameOf x)))
(ensures (HS.live_region h' (B.frameOf x)))
(* TODO: pattern *)
let modifies_liveness_insensitive_region_weak
(l2 : loc)
(h h' : HS.mem)
(x: HS.rid)
: Lemma
(requires (modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h x))
(ensures (HS.live_region h' x))
[SMTPatOr [
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h x)];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' x)];
]]
= modifies_liveness_insensitive_region loc_none l2 h h' x
let modifies_liveness_insensitive_region_mreference_weak
(l2 : loc)
(h h' : HS.mem)
(#t: Type)
(#pre: Preorder.preorder t)
(x: HS.mreference t pre)
: Lemma
(requires (modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (HS.frameOf x)))
(ensures (HS.live_region h' (HS.frameOf x)))
[SMTPatOr [
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h (HS.frameOf x))];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' (HS.frameOf x))];
]]
= modifies_liveness_insensitive_region_mreference loc_none l2 h h' x | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.ModifiesGen.fsti.checked",
"FStar.Map.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Heap.fst.checked",
"FStar.Classical.fsti.checked",
"FStar.Buffer.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Modifies.fsti"
} | [
{
"abbrev": true,
"full_module": "FStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
l2: FStar.Modifies.loc ->
h: FStar.Monotonic.HyperStack.mem ->
h': FStar.Monotonic.HyperStack.mem ->
x: FStar.Buffer.buffer t
-> FStar.Pervasives.Lemma
(requires
FStar.Modifies.modifies l2 h h' /\
FStar.Modifies.loc_includes FStar.Modifies.region_liveness_insensitive_locs l2 /\
FStar.Monotonic.HyperStack.live_region h (FStar.Buffer.frameOf x))
(ensures FStar.Monotonic.HyperStack.live_region h' (FStar.Buffer.frameOf x))
[
SMTPatOr [
[
SMTPat (FStar.Modifies.modifies l2 h h');
SMTPat (FStar.Monotonic.HyperStack.live_region h (FStar.Buffer.frameOf x))
];
[
SMTPat (FStar.Modifies.modifies l2 h h');
SMTPat (FStar.Monotonic.HyperStack.live_region h' (FStar.Buffer.frameOf x))
]
]
] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"FStar.Modifies.loc",
"FStar.Monotonic.HyperStack.mem",
"FStar.Buffer.buffer",
"FStar.Modifies.modifies_liveness_insensitive_region_buffer",
"FStar.Modifies.loc_none",
"Prims.unit",
"Prims.l_and",
"FStar.Modifies.modifies",
"FStar.Modifies.loc_includes",
"FStar.Modifies.region_liveness_insensitive_locs",
"Prims.b2t",
"FStar.Monotonic.HyperStack.live_region",
"FStar.Buffer.frameOf",
"Prims.squash",
"Prims.Cons",
"FStar.Pervasives.pattern",
"FStar.Pervasives.smt_pat_or",
"Prims.list",
"FStar.Pervasives.smt_pat",
"Prims.bool",
"Prims.Nil"
] | [] | true | false | true | false | false | let modifies_liveness_insensitive_region_buffer_weak
(l2: loc)
(h h': HS.mem)
(#t: Type)
(x: B.buffer t)
: Lemma
(requires
(modifies l2 h h' /\ region_liveness_insensitive_locs `loc_includes` l2 /\
HS.live_region h (B.frameOf x)))
(ensures (HS.live_region h' (B.frameOf x)))
[
SMTPatOr
[
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h (B.frameOf x))];
[SMTPat (modifies l2 h h'); SMTPat (HS.live_region h' (B.frameOf x))]
]
] =
| modifies_liveness_insensitive_region_buffer loc_none l2 h h' x | false |
Spec.FFDHE.fst | Spec.FFDHE.ffdhe_p4096 | val ffdhe_p4096:lseq pub_uint8 512 | val ffdhe_p4096:lseq pub_uint8 512 | let ffdhe_p4096: lseq pub_uint8 512 = of_list list_ffdhe_p4096 | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 62,
"end_line": 218,
"start_col": 0,
"start_line": 218
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy; 0x57uy; 0xC9uy; 0x35uy;
0x98uy; 0x4Fuy; 0x0Cuy; 0x70uy; 0xE0uy; 0xE6uy; 0x8Buy; 0x77uy;
0xE2uy; 0xA6uy; 0x89uy; 0xDAuy; 0xF3uy; 0xEFuy; 0xE8uy; 0x72uy;
0x1Duy; 0xF1uy; 0x58uy; 0xA1uy; 0x36uy; 0xADuy; 0xE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Fuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p3072: List.Tot.llist pub_uint8 384 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy; 0x57uy; 0xC9uy; 0x35uy;
0x98uy; 0x4Fuy; 0x0Cuy; 0x70uy; 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D5uy; 0x9Duy; 0x7Cuy;
0x25uy; 0xE4uy; 0x1Duy; 0x2Buy; 0x66uy; 0xC6uy; 0x2Euy; 0x37uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 384);
l
let ffdhe_p3072: lseq pub_uint8 384 = of_list list_ffdhe_p3072
// The estimated symmetric-equivalent strength of this group is 125 bits.
let ffdhe_params_3072 : ffdhe_params_t =
Mk_ffdhe_params 384 ffdhe_p3072 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p4096: List.Tot.llist pub_uint8 512 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy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Fuy; 0x88uy; 0xA4uy; 0x6Buy;
0x4Duy; 0xB5uy; 0xA8uy; 0x51uy; 0xF4uy; 0x41uy; 0x82uy; 0xE1uy;
0xC6uy; 0x8Auy; 0x00uy; 0x7Euy; 0x5Euy; 0x65uy; 0x5Fuy; 0x6Auy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 512);
l | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.PUB) 512 | Prims.Tot | [
"total"
] | [] | [
"Lib.Sequence.of_list",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.PUB",
"Spec.FFDHE.list_ffdhe_p4096"
] | [] | false | false | false | false | false | let ffdhe_p4096:lseq pub_uint8 512 =
| of_list list_ffdhe_p4096 | false |
IntSort.fst | IntSort.sorted | val sorted: list int -> Tot bool | val sorted: list int -> Tot bool | let rec sorted l = match l with
| [] | [_] -> true
| x::y::xs -> (x <= y) && (sorted (y::xs)) | {
"file_name": "examples/algorithms/IntSort.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 46,
"end_line": 23,
"start_col": 0,
"start_line": 21
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module IntSort
open FStar.List.Tot
(* Check that a list is sorted *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "IntSort.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | l: Prims.list Prims.int -> Prims.bool | Prims.Tot | [
"total"
] | [] | [
"Prims.list",
"Prims.int",
"Prims.op_AmpAmp",
"Prims.op_LessThanOrEqual",
"IntSort.sorted",
"Prims.Cons",
"Prims.bool"
] | [
"recursion"
] | false | false | false | true | false | let rec sorted l =
| match l with
| [] | [_] -> true
| x :: y :: xs -> (x <= y) && (sorted (y :: xs)) | false |
IntSort.fst | IntSort.test_sorted2 | val test_sorted2: unit -> Tot (m:list int{sorted m}) | val test_sorted2: unit -> Tot (m:list int{sorted m}) | let test_sorted2 () = Nil | {
"file_name": "examples/algorithms/IntSort.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 25,
"end_line": 30,
"start_col": 0,
"start_line": 30
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module IntSort
open FStar.List.Tot
(* Check that a list is sorted *)
val sorted: list int -> Tot bool
let rec sorted l = match l with
| [] | [_] -> true
| x::y::xs -> (x <= y) && (sorted (y::xs))
val test_sorted: x:int -> l:list int ->
Lemma ((sorted (x::l) /\ Cons? l) ==> x <= Cons?.hd l)
let test_sorted x l = () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "IntSort.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit -> m: Prims.list Prims.int {IntSort.sorted m} | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Prims.Nil",
"Prims.int",
"Prims.list",
"Prims.b2t",
"IntSort.sorted"
] | [] | false | false | false | false | false | let test_sorted2 () =
| Nil | false |
Hacl.Spec.BignumQ.Lemmas.fst | Hacl.Spec.BignumQ.Lemmas.lemma_div248_aux | val lemma_div248_aux: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 512)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 248 ==
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256)) | val lemma_div248_aux: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 512)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 248 ==
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256)) | let lemma_div248_aux x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert_norm (pow2 248 == pow2 224 * pow2 24);
assert_norm (pow2 56 == pow2 32 * pow2 24);
assert_norm (pow2 112 == pow2 88 * pow2 24);
assert_norm (pow2 168 == pow2 144 * pow2 24);
assert_norm (pow2 224 == pow2 200 * pow2 24);
assert_norm (pow2 280 == pow2 256 * pow2 24);
assert_norm (0 < pow2 24);
calc (==) {
wide_as_nat5 x / pow2 248;
(==) { FStar.Math.Lemmas.division_multiplication_lemma (wide_as_nat5 x) (pow2 224) (pow2 24) }
(wide_as_nat5 x / pow2 224) / pow2 24;
(==) { lemma_div224 x }
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) / pow2 24;
(==) { _ by (Tactics.mapply (`feq #int #int (fun x -> x / pow2 24)); int_semiring ()) } (v x4 + (v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256) * pow2 24) / pow2 24;
(==) { FStar.Math.Lemmas.lemma_div_plus (v x4) (v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256) (pow2 24) }
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256;
} | {
"file_name": "code/ed25519/Hacl.Spec.BignumQ.Lemmas.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 159,
"start_col": 0,
"start_line": 140
} | module Hacl.Spec.BignumQ.Lemmas
open FStar.Tactics.CanonCommSemiring
open FStar.Mul
open Lib.IntTypes
module S = Spec.Ed25519
include Hacl.Spec.BignumQ.Definitions
let feq (#a #b:Type) (f:(a -> b)) (x y:a) :
Lemma (requires x == y) (ensures f x == f y) = ()
let eq_eq2 (#a:eqtype) (x y:a) :
Lemma (requires x = y) (ensures x == y) = ()
val lemma_mul_lt:a:nat -> b:nat -> c:nat -> d:nat ->
Lemma
(requires a < b /\ c < d)
(ensures a * c < b * d)
let lemma_mul_lt a b c d = ()
val lemma_as_nat5: f:qelem5 ->
Lemma
(requires qelem_fits5 f (1, 1, 1, 1, 1))
(ensures as_nat5 f < pow2 280)
let lemma_as_nat5 f =
//let (f0, f1, f2, f3, f4) = f in
//assert (as_nat5 f == v f0 + v f1 * pow56 + v f2 * pow112 + v f3 * pow168 + v f4 * pow224);
assert_norm (pow2 56 * pow2 56 = pow2 112);
assert_norm (pow2 56 * pow2 112 = pow2 168);
assert_norm (pow2 56 * pow2 168 = pow2 224);
assert_norm (pow2 56 * pow2 224 = pow2 280)
val lemma_choose_step:
bit:uint64{v bit <= 1}
-> x:uint64
-> y:uint64
-> Lemma
(let mask = bit -. u64 1 in
let z = x ^. (mask &. (x ^. y)) in
if v bit = 1 then z == x else z == y)
let lemma_choose_step bit p1 p2 =
let mask = bit -. u64 1 in
assert (v bit == 0 ==> v mask == pow2 64 - 1);
assert (v bit == 1 ==> v mask == 0);
let dummy = mask &. (p1 ^. p2) in
logand_lemma mask (p1 ^. p2);
assert (v bit == 1 ==> v dummy == 0);
assert (v bit == 0 ==> v dummy == v (p1 ^. p2));
let p1' = p1 ^. dummy in
assert (v dummy == v (if v bit = 1 then u64 0 else (p1 ^. p2)));
logxor_lemma p1 p2
val lemma_subm_conditional:
x0:nat -> x1:nat -> x2:nat -> x3:nat -> x4:nat
-> y0:nat -> y1:nat -> y2:nat -> y3:nat -> y4:nat
-> b0:nat -> b1:nat -> b2:nat -> b3:nat -> b4:nat ->
Lemma (
x0 - y0 + b0 * pow2 56 +
(x1 - y1 - b0 + b1 * pow2 56) * pow2 56 +
(x2 - y2 - b1 + b2 * pow2 56) * pow2 112 +
(x3 - y3 - b2 + b3 * pow2 56) * pow2 168 +
(x4 - y4 - b3 + b4 * pow2 56) * pow2 224 ==
(x0 + x1 * pow2 56 + x2 * pow2 112 + x3 * pow2 168 + x4 * pow2 224) -
(y0 + y1 * pow2 56 + y2 * pow2 112 + y3 * pow2 168 + y4 * pow2 224) + b4 * pow2 280)
let lemma_subm_conditional x0 x1 x2 x3 x4 y0 y1 y2 y3 y4 b0 b1 b2 b3 b4 =
assert_norm (pow2 56 * pow2 56 = pow2 112);
assert_norm (pow2 56 * pow2 112 = pow2 168);
assert_norm (pow2 56 * pow2 168 = pow2 224);
assert_norm (pow2 56 * pow2 224 = pow2 280);
assert (
x0 - y0 + b0 * pow2 56 +
(x1 - y1 - b0 + b1 * pow2 56) * pow2 56 +
(x2 - y2 - b1 + b2 * pow2 56) * pow2 112 +
(x3 - y3 - b2 + b3 * pow2 56) * pow2 168 +
(x4 - y4 - b3 + b4 * pow2 56) * pow2 224 ==
(x0 + x1 * pow2 56 + x2 * pow2 112 + x3 * pow2 168 + x4 * pow2 224) -
(y0 + y1 * pow2 56 + y2 * pow2 112 + y3 * pow2 168 + y4 * pow2 224) + b4 * pow2 280)
by (int_semiring ());
()
val lemma_div224: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 224 ==
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280))
#push-options "--z3rlimit 50"
let lemma_div224 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert
(wide_as_nat5 x ==
v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168 + v x4 * pow2 224 +
v x5 * pow2 280 + v x6 * pow2 336 + v x7 * pow2 392 + v x8 * pow2 448 + v x9 * pow2 504);
assert_norm (pow2 56 * pow2 224 == pow2 280);
assert_norm (pow2 112 * pow2 224 == pow2 336);
assert_norm (pow2 168 * pow2 224 == pow2 392);
assert_norm (pow2 224 * pow2 224 == pow2 448);
assert_norm (pow2 280 * pow2 224 == pow2 504);
calc (==) {
wide_as_nat5 x / pow2 224;
(==) { }
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168 +
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) * pow2 224) / pow2 224;
(==) {
FStar.Math.Lemmas.lemma_div_plus
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168)
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) (pow2 224) }
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168) / pow2 224 +
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280;
(==) { FStar.Math.Lemmas.small_division_lemma_1 (v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168) (pow2 224) }
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280;
}
#pop-options
val lemma_div248_aux: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 512)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 248 ==
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256))
open FStar.Tactics.CanonCommSemiring | {
"checked_file": "/",
"dependencies": [
"Spec.Ed25519.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.BignumQ.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.CanonCommSemiring.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.BignumQ.Lemmas.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommSemiring",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.Ed25519",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommSemiring",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: Hacl.Spec.BignumQ.Definitions.qelem_wide5
-> FStar.Pervasives.Lemma
(requires
Hacl.Spec.BignumQ.Definitions.qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
Hacl.Spec.BignumQ.Definitions.wide_as_nat5 x < Prims.pow2 512)
(ensures
(let _ = x in
(let
FStar.Pervasives.Native.Mktuple10
#_
#_
#_
#_
#_
#_
#_
#_
#_
#_
_
_
_
_
x4
x5
x6
x7
x8
x9 =
_
in
Hacl.Spec.BignumQ.Definitions.wide_as_nat5 x / Prims.pow2 248 ==
Lib.IntTypes.v x4 / Prims.pow2 24 + Lib.IntTypes.v x5 * Prims.pow2 32 +
Lib.IntTypes.v x6 * Prims.pow2 88 +
Lib.IntTypes.v x7 * Prims.pow2 144 +
Lib.IntTypes.v x8 * Prims.pow2 200 +
Lib.IntTypes.v x9 * Prims.pow2 256)
<:
Type0)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Hacl.Spec.BignumQ.Definitions.qelem_wide5",
"Lib.IntTypes.uint64",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Prims.op_Division",
"Hacl.Spec.BignumQ.Definitions.wide_as_nat5",
"Prims.pow2",
"Prims.op_Addition",
"Lib.IntTypes.v",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"FStar.Mul.op_Star",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"FStar.Math.Lemmas.division_multiplication_lemma",
"Prims.squash",
"Hacl.Spec.BignumQ.Lemmas.lemma_div224",
"FStar.Math.Lemmas.lemma_div_plus",
"FStar.Pervasives.assert_norm",
"Prims.b2t",
"Prims.op_LessThan"
] | [] | false | false | true | false | false | let lemma_div248_aux x =
| let x0, x1, x2, x3, x4, x5, x6, x7, x8, x9 = x in
assert_norm (pow2 248 == pow2 224 * pow2 24);
assert_norm (pow2 56 == pow2 32 * pow2 24);
assert_norm (pow2 112 == pow2 88 * pow2 24);
assert_norm (pow2 168 == pow2 144 * pow2 24);
assert_norm (pow2 224 == pow2 200 * pow2 24);
assert_norm (pow2 280 == pow2 256 * pow2 24);
assert_norm (0 < pow2 24);
calc ( == ) {
wide_as_nat5 x / pow2 248;
( == ) { FStar.Math.Lemmas.division_multiplication_lemma (wide_as_nat5 x) (pow2 224) (pow2 24) }
(wide_as_nat5 x / pow2 224) / pow2 24;
( == ) { lemma_div224 x }
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) /
pow2 24;
( == ) { FStar.Tactics.Effect.synth_by_tactic (fun _ ->
(Tactics.mapply (`feq #int #int (fun x -> x / pow2 24));
int_semiring ())) }
(v x4 +
(v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256) *
pow2 24) /
pow2 24;
( == ) { FStar.Math.Lemmas.lemma_div_plus (v x4)
(v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256)
(pow2 24) }
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 +
v x9 * pow2 256;
} | false |
IntSort.fst | IntSort.sorted_smaller | val sorted_smaller: x:int
-> y:int
-> l:list int
-> Lemma (requires (sorted (x::l) /\ mem y l))
(ensures (x <= y))
[SMTPat (sorted (x::l)); SMTPat (mem y l)] | val sorted_smaller: x:int
-> y:int
-> l:list int
-> Lemma (requires (sorted (x::l) /\ mem y l))
(ensures (x <= y))
[SMTPat (sorted (x::l)); SMTPat (mem y l)] | let rec sorted_smaller x y l = match l with
| [] -> ()
| z::zs -> if z=y then () else sorted_smaller x y zs | {
"file_name": "examples/algorithms/IntSort.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 56,
"end_line": 42,
"start_col": 0,
"start_line": 40
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module IntSort
open FStar.List.Tot
(* Check that a list is sorted *)
val sorted: list int -> Tot bool
let rec sorted l = match l with
| [] | [_] -> true
| x::y::xs -> (x <= y) && (sorted (y::xs))
val test_sorted: x:int -> l:list int ->
Lemma ((sorted (x::l) /\ Cons? l) ==> x <= Cons?.hd l)
let test_sorted x l = ()
val test_sorted2: unit -> Tot (m:list int{sorted m})
let test_sorted2 () = Nil
(* Fact about sorted *)
val sorted_smaller: x:int
-> y:int
-> l:list int
-> Lemma (requires (sorted (x::l) /\ mem y l))
(ensures (x <= y)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "IntSort.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: Prims.int -> y: Prims.int -> l: Prims.list Prims.int
-> FStar.Pervasives.Lemma (requires IntSort.sorted (x :: l) /\ FStar.List.Tot.Base.mem y l)
(ensures x <= y)
[SMTPat (IntSort.sorted (x :: l)); SMTPat (FStar.List.Tot.Base.mem y l)] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.int",
"Prims.list",
"Prims.op_Equality",
"Prims.bool",
"IntSort.sorted_smaller",
"Prims.unit"
] | [
"recursion"
] | false | false | true | false | false | let rec sorted_smaller x y l =
| match l with
| [] -> ()
| z :: zs -> if z = y then () else sorted_smaller x y zs | false |
Spec.FFDHE.fst | Spec.FFDHE.list_ffdhe_p4096 | val list_ffdhe_p4096:List.Tot.llist pub_uint8 512 | val list_ffdhe_p4096:List.Tot.llist pub_uint8 512 | let list_ffdhe_p4096: List.Tot.llist pub_uint8 512 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xF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y; 0x40uy; 0x04uy;
0x87uy; 0xF5uy; 0x5Buy; 0xA5uy; 0x7Euy; 0x31uy; 0xCCuy; 0x7Auy;
0x71uy; 0x35uy; 0xC8uy; 0x86uy; 0xEFuy; 0xB4uy; 0x31uy; 0x8Auy;
0xEDuy; 0x6Auy; 0x1Euy; 0x01uy; 0x2Duy; 0x9Euy; 0x68uy; 0x32uy;
0xA9uy; 0x07uy; 0x60uy; 0x0Auy; 0x91uy; 0x81uy; 0x30uy; 0xC4uy;
0x6Duy; 0xC7uy; 0x78uy; 0xF9uy; 0x71uy; 0xADuy; 0x00uy; 0x38uy;
0x09uy; 0x29uy; 0x99uy; 0xA3uy; 0x33uy; 0xCBuy; 0x8Buy; 0x7Auy;
0x1Auy; 0x1Duy; 0xB9uy; 0x3Duy; 0x71uy; 0x40uy; 0x00uy; 0x3Cuy;
0x2Auy; 0x4Euy; 0xCEuy; 0xA9uy; 0xF9uy; 0x8Duy; 0x0Auy; 0xCCuy;
0x0Auy; 0x82uy; 0x91uy; 0xCDuy; 0xCEuy; 0xC9uy; 0x7Duy; 0xCFuy;
0x8Euy; 0xC9uy; 0xB5uy; 0x5Auy; 0x7Fuy; 0x88uy; 0xA4uy; 0x6Buy;
0x4Duy; 0xB5uy; 0xA8uy; 0x51uy; 0xF4uy; 0x41uy; 0x82uy; 0xE1uy;
0xC6uy; 0x8Auy; 0x00uy; 0x7Euy; 0x5Euy; 0x65uy; 0x5Fuy; 0x6Auy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 512);
l | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 216,
"start_col": 0,
"start_line": 147
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0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y; 0x6Fuy; 0xADuy; 0x73uy;
0x3Buy; 0xB5uy; 0xFCuy; 0xBCuy; 0x2Euy; 0xC2uy; 0x20uy; 0x05uy;
0xC5uy; 0x8Euy; 0xF1uy; 0x83uy; 0x7Duy; 0x16uy; 0x83uy; 0xB2uy;
0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p3072: List.Tot.llist pub_uint8 384 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC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x9Euy;
0xE8uy; 0x6Duy; 0x2Buy; 0xC5uy; 0x22uy; 0x36uy; 0x3Auy; 0x0Duy;
0xABuy; 0xC5uy; 0x21uy; 0x97uy; 0x9Buy; 0x0Duy; 0xEAuy; 0xDAuy;
0x1Duy; 0xBFuy; 0x9Auy; 0x42uy; 0xD5uy; 0xC4uy; 0x48uy; 0x4Euy;
0x0Auy; 0xBCuy; 0xD0uy; 0x6Buy; 0xFAuy; 0x53uy; 0xDDuy; 0xEFuy;
0x3Cuy; 0x1Buy; 0x20uy; 0xEEuy; 0x3Fuy; 0xD5uy; 0x9Duy; 0x7Cuy;
0x25uy; 0xE4uy; 0x1Duy; 0x2Buy; 0x66uy; 0xC6uy; 0x2Euy; 0x37uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 384);
l
let ffdhe_p3072: lseq pub_uint8 384 = of_list list_ffdhe_p3072
// The estimated symmetric-equivalent strength of this group is 125 bits.
let ffdhe_params_3072 : ffdhe_params_t =
Mk_ffdhe_params 384 ffdhe_p3072 1 ffdhe_g2
[@"opaque_to_smt"] | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.List.Tot.Properties.llist (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.PUB) 512 | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.int",
"FStar.List.Tot.Base.length",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.PUB",
"Prims.list",
"Prims.Cons",
"FStar.UInt8.__uint_to_t",
"Prims.Nil"
] | [] | false | false | false | false | false | let list_ffdhe_p4096:List.Tot.llist pub_uint8 512 =
| [@@ inline_let ]let l =
[
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xADuy; 0xF8uy; 0x54uy; 0x58uy;
0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy; 0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy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Duy; 0x9Euy; 0x68uy; 0x32uy;
0xA9uy; 0x07uy; 0x60uy; 0x0Auy; 0x91uy; 0x81uy; 0x30uy; 0xC4uy; 0x6Duy; 0xC7uy; 0x78uy; 0xF9uy;
0x71uy; 0xADuy; 0x00uy; 0x38uy; 0x09uy; 0x29uy; 0x99uy; 0xA3uy; 0x33uy; 0xCBuy; 0x8Buy; 0x7Auy;
0x1Auy; 0x1Duy; 0xB9uy; 0x3Duy; 0x71uy; 0x40uy; 0x00uy; 0x3Cuy; 0x2Auy; 0x4Euy; 0xCEuy; 0xA9uy;
0xF9uy; 0x8Duy; 0x0Auy; 0xCCuy; 0x0Auy; 0x82uy; 0x91uy; 0xCDuy; 0xCEuy; 0xC9uy; 0x7Duy; 0xCFuy;
0x8Euy; 0xC9uy; 0xB5uy; 0x5Auy; 0x7Fuy; 0x88uy; 0xA4uy; 0x6Buy; 0x4Duy; 0xB5uy; 0xA8uy; 0x51uy;
0xF4uy; 0x41uy; 0x82uy; 0xE1uy; 0xC6uy; 0x8Auy; 0x00uy; 0x7Euy; 0x5Euy; 0x65uy; 0x5Fuy; 0x6Auy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
]
in
assert_norm (List.Tot.length l == 512);
l | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.nat_mod_comm_monoid | val nat_mod_comm_monoid : Lib.Exponentiation.Definition.comm_monoid (Lib.NatMod.nat_mod Spec.P256.PointOps.prime) | let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 58,
"end_line": 12,
"start_col": 0,
"start_line": 12
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0" | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Lib.Exponentiation.Definition.comm_monoid (Lib.NatMod.nat_mod Spec.P256.PointOps.prime) | Prims.Tot | [
"total"
] | [] | [
"Lib.NatMod.mk_nat_mod_comm_monoid",
"Spec.P256.PointOps.prime"
] | [] | false | false | false | true | false | let nat_mod_comm_monoid =
| M.mk_nat_mod_comm_monoid S.prime | false |
|
Hacl.Spec.BignumQ.Lemmas.fst | Hacl.Spec.BignumQ.Lemmas.lemma_div224 | val lemma_div224: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 224 ==
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280)) | val lemma_div224: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 224 ==
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280)) | let lemma_div224 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert
(wide_as_nat5 x ==
v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168 + v x4 * pow2 224 +
v x5 * pow2 280 + v x6 * pow2 336 + v x7 * pow2 392 + v x8 * pow2 448 + v x9 * pow2 504);
assert_norm (pow2 56 * pow2 224 == pow2 280);
assert_norm (pow2 112 * pow2 224 == pow2 336);
assert_norm (pow2 168 * pow2 224 == pow2 392);
assert_norm (pow2 224 * pow2 224 == pow2 448);
assert_norm (pow2 280 * pow2 224 == pow2 504);
calc (==) {
wide_as_nat5 x / pow2 224;
(==) { }
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168 +
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) * pow2 224) / pow2 224;
(==) {
FStar.Math.Lemmas.lemma_div_plus
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168)
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) (pow2 224) }
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168) / pow2 224 +
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280;
(==) { FStar.Math.Lemmas.small_division_lemma_1 (v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168) (pow2 224) }
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280;
} | {
"file_name": "code/ed25519/Hacl.Spec.BignumQ.Lemmas.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 5,
"end_line": 124,
"start_col": 0,
"start_line": 100
} | module Hacl.Spec.BignumQ.Lemmas
open FStar.Tactics.CanonCommSemiring
open FStar.Mul
open Lib.IntTypes
module S = Spec.Ed25519
include Hacl.Spec.BignumQ.Definitions
let feq (#a #b:Type) (f:(a -> b)) (x y:a) :
Lemma (requires x == y) (ensures f x == f y) = ()
let eq_eq2 (#a:eqtype) (x y:a) :
Lemma (requires x = y) (ensures x == y) = ()
val lemma_mul_lt:a:nat -> b:nat -> c:nat -> d:nat ->
Lemma
(requires a < b /\ c < d)
(ensures a * c < b * d)
let lemma_mul_lt a b c d = ()
val lemma_as_nat5: f:qelem5 ->
Lemma
(requires qelem_fits5 f (1, 1, 1, 1, 1))
(ensures as_nat5 f < pow2 280)
let lemma_as_nat5 f =
//let (f0, f1, f2, f3, f4) = f in
//assert (as_nat5 f == v f0 + v f1 * pow56 + v f2 * pow112 + v f3 * pow168 + v f4 * pow224);
assert_norm (pow2 56 * pow2 56 = pow2 112);
assert_norm (pow2 56 * pow2 112 = pow2 168);
assert_norm (pow2 56 * pow2 168 = pow2 224);
assert_norm (pow2 56 * pow2 224 = pow2 280)
val lemma_choose_step:
bit:uint64{v bit <= 1}
-> x:uint64
-> y:uint64
-> Lemma
(let mask = bit -. u64 1 in
let z = x ^. (mask &. (x ^. y)) in
if v bit = 1 then z == x else z == y)
let lemma_choose_step bit p1 p2 =
let mask = bit -. u64 1 in
assert (v bit == 0 ==> v mask == pow2 64 - 1);
assert (v bit == 1 ==> v mask == 0);
let dummy = mask &. (p1 ^. p2) in
logand_lemma mask (p1 ^. p2);
assert (v bit == 1 ==> v dummy == 0);
assert (v bit == 0 ==> v dummy == v (p1 ^. p2));
let p1' = p1 ^. dummy in
assert (v dummy == v (if v bit = 1 then u64 0 else (p1 ^. p2)));
logxor_lemma p1 p2
val lemma_subm_conditional:
x0:nat -> x1:nat -> x2:nat -> x3:nat -> x4:nat
-> y0:nat -> y1:nat -> y2:nat -> y3:nat -> y4:nat
-> b0:nat -> b1:nat -> b2:nat -> b3:nat -> b4:nat ->
Lemma (
x0 - y0 + b0 * pow2 56 +
(x1 - y1 - b0 + b1 * pow2 56) * pow2 56 +
(x2 - y2 - b1 + b2 * pow2 56) * pow2 112 +
(x3 - y3 - b2 + b3 * pow2 56) * pow2 168 +
(x4 - y4 - b3 + b4 * pow2 56) * pow2 224 ==
(x0 + x1 * pow2 56 + x2 * pow2 112 + x3 * pow2 168 + x4 * pow2 224) -
(y0 + y1 * pow2 56 + y2 * pow2 112 + y3 * pow2 168 + y4 * pow2 224) + b4 * pow2 280)
let lemma_subm_conditional x0 x1 x2 x3 x4 y0 y1 y2 y3 y4 b0 b1 b2 b3 b4 =
assert_norm (pow2 56 * pow2 56 = pow2 112);
assert_norm (pow2 56 * pow2 112 = pow2 168);
assert_norm (pow2 56 * pow2 168 = pow2 224);
assert_norm (pow2 56 * pow2 224 = pow2 280);
assert (
x0 - y0 + b0 * pow2 56 +
(x1 - y1 - b0 + b1 * pow2 56) * pow2 56 +
(x2 - y2 - b1 + b2 * pow2 56) * pow2 112 +
(x3 - y3 - b2 + b3 * pow2 56) * pow2 168 +
(x4 - y4 - b3 + b4 * pow2 56) * pow2 224 ==
(x0 + x1 * pow2 56 + x2 * pow2 112 + x3 * pow2 168 + x4 * pow2 224) -
(y0 + y1 * pow2 56 + y2 * pow2 112 + y3 * pow2 168 + y4 * pow2 224) + b4 * pow2 280)
by (int_semiring ());
()
val lemma_div224: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 224 ==
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280)) | {
"checked_file": "/",
"dependencies": [
"Spec.Ed25519.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.BignumQ.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.CanonCommSemiring.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.BignumQ.Lemmas.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.Ed25519",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommSemiring",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: Hacl.Spec.BignumQ.Definitions.qelem_wide5
-> FStar.Pervasives.Lemma
(requires Hacl.Spec.BignumQ.Definitions.qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let _ = x in
(let
FStar.Pervasives.Native.Mktuple10
#_
#_
#_
#_
#_
#_
#_
#_
#_
#_
_
_
_
_
x4
x5
x6
x7
x8
x9 =
_
in
Hacl.Spec.BignumQ.Definitions.wide_as_nat5 x / Prims.pow2 224 ==
Lib.IntTypes.v x4 + Lib.IntTypes.v x5 * Prims.pow2 56 +
Lib.IntTypes.v x6 * Prims.pow2 112 +
Lib.IntTypes.v x7 * Prims.pow2 168 +
Lib.IntTypes.v x8 * Prims.pow2 224 +
Lib.IntTypes.v x9 * Prims.pow2 280)
<:
Type0)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Hacl.Spec.BignumQ.Definitions.qelem_wide5",
"Lib.IntTypes.uint64",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Prims.op_Division",
"Hacl.Spec.BignumQ.Definitions.wide_as_nat5",
"Prims.pow2",
"Prims.op_Addition",
"Lib.IntTypes.v",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"FStar.Mul.op_Star",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"Prims.squash",
"FStar.Math.Lemmas.lemma_div_plus",
"FStar.Math.Lemmas.small_division_lemma_1",
"FStar.Pervasives.assert_norm",
"Prims._assert"
] | [] | false | false | true | false | false | let lemma_div224 x =
| let x0, x1, x2, x3, x4, x5, x6, x7, x8, x9 = x in
assert (wide_as_nat5 x ==
v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168 + v x4 * pow2 224 + v x5 * pow2 280 +
v x6 * pow2 336 +
v x7 * pow2 392 +
v x8 * pow2 448 +
v x9 * pow2 504);
assert_norm (pow2 56 * pow2 224 == pow2 280);
assert_norm (pow2 112 * pow2 224 == pow2 336);
assert_norm (pow2 168 * pow2 224 == pow2 392);
assert_norm (pow2 224 * pow2 224 == pow2 448);
assert_norm (pow2 280 * pow2 224 == pow2 504);
calc ( == ) {
wide_as_nat5 x / pow2 224;
( == ) { () }
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168 +
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) *
pow2 224) /
pow2 224;
( == ) { FStar.Math.Lemmas.lemma_div_plus (v x0 + v x1 * pow2 56 + v x2 * pow2 112 +
v x3 * pow2 168)
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280)
(pow2 224) }
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168) / pow2 224 + v x4 + v x5 * pow2 56 +
v x6 * pow2 112 +
v x7 * pow2 168 +
v x8 * pow2 224 +
v x9 * pow2 280;
( == ) { FStar.Math.Lemmas.small_division_lemma_1 (v x0 + v x1 * pow2 56 + v x2 * pow2 112 +
v x3 * pow2 168)
(pow2 224) }
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280;
} | false |
Hacl.Spec.BignumQ.Lemmas.fst | Hacl.Spec.BignumQ.Lemmas.lemma_mod_264 | val lemma_mod_264: t:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 t (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) = t in
let res = (t0, t1, t2, t3, t4 &. u64 0xffffffffff) in
qelem_fits5 res (1, 1, 1, 1, 1) /\
as_nat5 res == (wide_as_nat5 t) % pow2 264)) | val lemma_mod_264: t:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 t (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) = t in
let res = (t0, t1, t2, t3, t4 &. u64 0xffffffffff) in
qelem_fits5 res (1, 1, 1, 1, 1) /\
as_nat5 res == (wide_as_nat5 t) % pow2 264)) | let lemma_mod_264 t =
let (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) = t in
let t4' = t4 &. u64 0xffffffffff in
let res = (t0, t1, t2, t3, t4') in
assert_norm (pow2 40 < pow2 64);
assert_norm (pow2 40 - 1 == 0xffffffffff);
mod_mask_lemma t4 40ul;
assert (v (mod_mask #U64 #SEC 40ul) == 0xffffffffff);
assert (v (t4 &. u64 0xffffffffff) == v t4 % pow2 40);
calc (==) {
(wide_as_nat5 t) % pow2 264;
(==) { lemma_mod_264_aux t }
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + v t4 * pow2 224) % pow2 264;
(==) { FStar.Math.Lemmas.lemma_mod_add_distr (v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168) (v t4 * pow2 224) (pow2 264) }
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + (v t4 * pow2 224) % pow2 264) % pow2 264;
(==) { FStar.Math.Lemmas.pow2_multiplication_modulo_lemma_2 (v t4) 264 224 }
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + (v t4 % pow2 40) * pow2 224) % pow2 264;
(==) { lemma_as_nat_pow264 res; FStar.Math.Lemmas.modulo_lemma (as_nat5 res) (pow2 264) }
v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + (v t4 % pow2 40) * pow2 224;
} | {
"file_name": "code/ed25519/Hacl.Spec.BignumQ.Lemmas.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 5,
"end_line": 546,
"start_col": 0,
"start_line": 526
} | module Hacl.Spec.BignumQ.Lemmas
open FStar.Tactics.CanonCommSemiring
open FStar.Mul
open Lib.IntTypes
module S = Spec.Ed25519
include Hacl.Spec.BignumQ.Definitions
let feq (#a #b:Type) (f:(a -> b)) (x y:a) :
Lemma (requires x == y) (ensures f x == f y) = ()
let eq_eq2 (#a:eqtype) (x y:a) :
Lemma (requires x = y) (ensures x == y) = ()
val lemma_mul_lt:a:nat -> b:nat -> c:nat -> d:nat ->
Lemma
(requires a < b /\ c < d)
(ensures a * c < b * d)
let lemma_mul_lt a b c d = ()
val lemma_as_nat5: f:qelem5 ->
Lemma
(requires qelem_fits5 f (1, 1, 1, 1, 1))
(ensures as_nat5 f < pow2 280)
let lemma_as_nat5 f =
//let (f0, f1, f2, f3, f4) = f in
//assert (as_nat5 f == v f0 + v f1 * pow56 + v f2 * pow112 + v f3 * pow168 + v f4 * pow224);
assert_norm (pow2 56 * pow2 56 = pow2 112);
assert_norm (pow2 56 * pow2 112 = pow2 168);
assert_norm (pow2 56 * pow2 168 = pow2 224);
assert_norm (pow2 56 * pow2 224 = pow2 280)
val lemma_choose_step:
bit:uint64{v bit <= 1}
-> x:uint64
-> y:uint64
-> Lemma
(let mask = bit -. u64 1 in
let z = x ^. (mask &. (x ^. y)) in
if v bit = 1 then z == x else z == y)
let lemma_choose_step bit p1 p2 =
let mask = bit -. u64 1 in
assert (v bit == 0 ==> v mask == pow2 64 - 1);
assert (v bit == 1 ==> v mask == 0);
let dummy = mask &. (p1 ^. p2) in
logand_lemma mask (p1 ^. p2);
assert (v bit == 1 ==> v dummy == 0);
assert (v bit == 0 ==> v dummy == v (p1 ^. p2));
let p1' = p1 ^. dummy in
assert (v dummy == v (if v bit = 1 then u64 0 else (p1 ^. p2)));
logxor_lemma p1 p2
val lemma_subm_conditional:
x0:nat -> x1:nat -> x2:nat -> x3:nat -> x4:nat
-> y0:nat -> y1:nat -> y2:nat -> y3:nat -> y4:nat
-> b0:nat -> b1:nat -> b2:nat -> b3:nat -> b4:nat ->
Lemma (
x0 - y0 + b0 * pow2 56 +
(x1 - y1 - b0 + b1 * pow2 56) * pow2 56 +
(x2 - y2 - b1 + b2 * pow2 56) * pow2 112 +
(x3 - y3 - b2 + b3 * pow2 56) * pow2 168 +
(x4 - y4 - b3 + b4 * pow2 56) * pow2 224 ==
(x0 + x1 * pow2 56 + x2 * pow2 112 + x3 * pow2 168 + x4 * pow2 224) -
(y0 + y1 * pow2 56 + y2 * pow2 112 + y3 * pow2 168 + y4 * pow2 224) + b4 * pow2 280)
let lemma_subm_conditional x0 x1 x2 x3 x4 y0 y1 y2 y3 y4 b0 b1 b2 b3 b4 =
assert_norm (pow2 56 * pow2 56 = pow2 112);
assert_norm (pow2 56 * pow2 112 = pow2 168);
assert_norm (pow2 56 * pow2 168 = pow2 224);
assert_norm (pow2 56 * pow2 224 = pow2 280);
assert (
x0 - y0 + b0 * pow2 56 +
(x1 - y1 - b0 + b1 * pow2 56) * pow2 56 +
(x2 - y2 - b1 + b2 * pow2 56) * pow2 112 +
(x3 - y3 - b2 + b3 * pow2 56) * pow2 168 +
(x4 - y4 - b3 + b4 * pow2 56) * pow2 224 ==
(x0 + x1 * pow2 56 + x2 * pow2 112 + x3 * pow2 168 + x4 * pow2 224) -
(y0 + y1 * pow2 56 + y2 * pow2 112 + y3 * pow2 168 + y4 * pow2 224) + b4 * pow2 280)
by (int_semiring ());
()
val lemma_div224: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 224 ==
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280))
#push-options "--z3rlimit 50"
let lemma_div224 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert
(wide_as_nat5 x ==
v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168 + v x4 * pow2 224 +
v x5 * pow2 280 + v x6 * pow2 336 + v x7 * pow2 392 + v x8 * pow2 448 + v x9 * pow2 504);
assert_norm (pow2 56 * pow2 224 == pow2 280);
assert_norm (pow2 112 * pow2 224 == pow2 336);
assert_norm (pow2 168 * pow2 224 == pow2 392);
assert_norm (pow2 224 * pow2 224 == pow2 448);
assert_norm (pow2 280 * pow2 224 == pow2 504);
calc (==) {
wide_as_nat5 x / pow2 224;
(==) { }
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168 +
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) * pow2 224) / pow2 224;
(==) {
FStar.Math.Lemmas.lemma_div_plus
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168)
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) (pow2 224) }
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168) / pow2 224 +
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280;
(==) { FStar.Math.Lemmas.small_division_lemma_1 (v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168) (pow2 224) }
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280;
}
#pop-options
val lemma_div248_aux: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 512)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 248 ==
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256))
open FStar.Tactics.CanonCommSemiring
#push-options "--z3cliopt smt.arith.nl=false"
let lemma_div248_aux x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert_norm (pow2 248 == pow2 224 * pow2 24);
assert_norm (pow2 56 == pow2 32 * pow2 24);
assert_norm (pow2 112 == pow2 88 * pow2 24);
assert_norm (pow2 168 == pow2 144 * pow2 24);
assert_norm (pow2 224 == pow2 200 * pow2 24);
assert_norm (pow2 280 == pow2 256 * pow2 24);
assert_norm (0 < pow2 24);
calc (==) {
wide_as_nat5 x / pow2 248;
(==) { FStar.Math.Lemmas.division_multiplication_lemma (wide_as_nat5 x) (pow2 224) (pow2 24) }
(wide_as_nat5 x / pow2 224) / pow2 24;
(==) { lemma_div224 x }
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) / pow2 24;
(==) { _ by (Tactics.mapply (`feq #int #int (fun x -> x / pow2 24)); int_semiring ()) } (v x4 + (v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256) * pow2 24) / pow2 24;
(==) { FStar.Math.Lemmas.lemma_div_plus (v x4) (v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256) (pow2 24) }
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256;
}
#pop-options
val lemma_div248_x5: x5:uint64 ->
Lemma ( pow2 32 * (v x5 % pow2 24) + v x5 / pow2 24 * pow2 56 == v x5 * pow2 32)
let lemma_div248_x5 x5 =
assert_norm (pow2 32 * pow2 24 = pow2 56)
val lemma_div248_x6: x6:uint64 ->
Lemma (pow2 32 * (v x6 % pow2 24) * pow2 56 + v x6 / pow2 24 * pow2 112 == v x6 * pow2 88)
let lemma_div248_x6 x6 =
calc (==) {
pow2 32 * (v x6 % pow2 24) * pow2 56 + v x6 / pow2 24 * pow2 112;
(==) { _ by (Tactics.norm [delta_only [`%pow2]; primops]; int_semiring ()) }
((v x6 / pow2 24) * pow2 24 + v x6 % pow2 24) * pow2 88;
(==) { FStar.Math.Lemmas.euclidean_division_definition (v x6) (pow2 24) }
v x6 * pow2 88;
}
val lemma_div248_x7: x7:uint64 ->
Lemma (pow2 32 * (v x7 % pow2 24) * pow2 112 + v x7 / pow2 24 * pow2 168 == v x7 * pow2 144)
let lemma_div248_x7 x7 =
calc (==) {
pow2 32 * (v x7 % pow2 24) * pow2 112 + v x7 / pow2 24 * pow2 168;
(==) { _ by (Tactics.norm [delta_only [`%pow2]; primops]; int_semiring ()) }
((v x7 / pow2 24) * pow2 24 + v x7 % pow2 24) * pow2 144;
(==) { FStar.Math.Lemmas.euclidean_division_definition (v x7) (pow2 24) }
v x7 * pow2 144;
}
val lemma_div248_x8: x8:uint64 ->
Lemma (pow2 32 * (v x8 % pow2 24) * pow2 168 + v x8 / pow2 24 * pow2 224 == v x8 * pow2 200)
let lemma_div248_x8 x8 =
calc (==) {
pow2 32 * (v x8 % pow2 24) * pow2 168 + v x8 / pow2 24 * pow2 224;
(==) { _ by (Tactics.norm [delta_only [`%pow2]; primops]; int_semiring ()) }
((v x8 / pow2 24) * pow2 24 + v x8 % pow2 24) * pow2 200;
(==) { FStar.Math.Lemmas.euclidean_division_definition (v x8) (pow2 24) }
v x8 * pow2 200;
}
val lemma_div248_x9: x9:uint64{v x9 < pow2 24} ->
Lemma (pow2 32 * (v x9 % pow2 24) * pow2 224 == v x9 * pow2 256)
let lemma_div248_x9 x9 =
calc (==) {
pow2 32 * (v x9 % pow2 24) * pow2 224;
(==) { Math.Lemmas.small_mod (v x9) (pow2 24) }
pow2 32 * v x9 * pow2 224;
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
v x9 * pow2 256;
}
val lemma_wide_as_nat_pow512: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 512)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
v x9 < pow2 24))
let lemma_wide_as_nat_pow512 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert_norm (pow2 504 * pow2 8 = pow2 512);
FStar.Math.Lemmas.pow2_minus 512 504;
assert (v x9 < pow2 8);
assert_norm (pow2 8 < pow2 24)
val lemma_div248: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 512)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
let z0 = v x4 / pow2 24 + pow2 32 * (v x5 % pow2 24) in
let z1 = v x5 / pow2 24 + pow2 32 * (v x6 % pow2 24) in
let z2 = v x6 / pow2 24 + pow2 32 * (v x7 % pow2 24) in
let z3 = v x7 / pow2 24 + pow2 32 * (v x8 % pow2 24) in
let z4 = v x8 / pow2 24 + pow2 32 * (v x9 % pow2 24) in
wide_as_nat5 x / pow2 248 == z0 + z1 * pow2 56 + z2 * pow2 112 + z3 * pow2 168 + z4 * pow2 224))
#push-options "--z3rlimit 50"
let lemma_div248 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
lemma_wide_as_nat_pow512 x;
assert (v x9 < pow2 24);
calc (==) {
(let z0 = v x4 / pow2 24 + pow2 32 * (v x5 % pow2 24) in
let z1 = v x5 / pow2 24 + pow2 32 * (v x6 % pow2 24) in
let z2 = v x6 / pow2 24 + pow2 32 * (v x7 % pow2 24) in
let z3 = v x7 / pow2 24 + pow2 32 * (v x8 % pow2 24) in
let z4 = v x8 / pow2 24 + pow2 32 * (v x9 % pow2 24) in
z0 + z1 * pow2 56 + z2 * pow2 112 + z3 * pow2 168 + z4 * pow2 224);
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
v x4 / pow2 24 + pow2 32 * (v x5 % pow2 24) +
v x5 / pow2 24 * pow2 56 + pow2 32 * (v x6 % pow2 24) * pow2 56 +
v x6 / pow2 24 * pow2 112 + pow2 32 * (v x7 % pow2 24) * pow2 112 +
v x7 / pow2 24 * pow2 168 + pow2 32 * (v x8 % pow2 24) * pow2 168 +
v x8 / pow2 24 * pow2 224 + pow2 32 * (v x9 % pow2 24) * pow2 224;
(==) { lemma_div248_x5 x5; lemma_div248_x6 x6 }
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 +
pow2 32 * (v x7 % pow2 24) * pow2 112 +
v x7 / pow2 24 * pow2 168 + pow2 32 * (v x8 % pow2 24) * pow2 168 +
v x8 / pow2 24 * pow2 224 + pow2 32 * (v x9 % pow2 24) * pow2 224;
(==) { lemma_div248_x7 x7; lemma_div248_x8 x8 }
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 +
pow2 32 * (v x9 % pow2 24) * pow2 224;
(==) { lemma_div248_x9 x9 }
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256;
(==) { lemma_div248_aux x }
wide_as_nat5 x / pow2 248;
}
#pop-options
val lemma_add_modq5:
x:qelem5
-> y:qelem5
-> t:qelem5 ->
Lemma
(requires
qelem_fits5 x (1, 1, 1, 1, 1) /\
qelem_fits5 y (1, 1, 1, 1, 1) /\
qelem_fits5 t (1, 1, 1, 1, 1) /\
as_nat5 x < S.q /\ as_nat5 y < S.q /\
as_nat5 t == as_nat5 x + as_nat5 y)
(ensures
(let res = if as_nat5 t >= S.q then as_nat5 t - S.q else as_nat5 t in
res < S.q /\ res == (as_nat5 x + as_nat5 y) % S.q))
let lemma_add_modq5 x y t =
assert (as_nat5 t == as_nat5 x + as_nat5 y);
let res = if as_nat5 t >= S.q then as_nat5 t - S.q else as_nat5 t in
assert (res < S.q);
if as_nat5 t >= S.q then (
FStar.Math.Lemmas.sub_div_mod_1 (as_nat5 t) S.q;
assert (res % S.q == as_nat5 t % S.q))
else
assert (res % S.q == as_nat5 t % S.q);
FStar.Math.Lemmas.small_mod res S.q
val lemma_wide_as_nat_pow528: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 528)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
v x9 < pow2 40))
let lemma_wide_as_nat_pow528 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert_norm (pow2 504 * pow2 24 = pow2 528);
FStar.Math.Lemmas.pow2_minus 528 504;
assert (v x9 < pow2 24);
assert_norm (pow2 24 < pow2 40)
#push-options "--z3cliopt smt.arith.nl=false"
val lemma_div264_aux: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 528)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 264 ==
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240))
let lemma_div264_aux x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert_norm (pow2 264 == pow2 224 * pow2 40);
assert_norm (pow2 56 == pow2 16 * pow2 40);
assert_norm (pow2 112 == pow2 72 * pow2 40);
assert_norm (pow2 168 == pow2 128 * pow2 40);
assert_norm (pow2 224 == pow2 184 * pow2 40);
assert_norm (pow2 280 == pow2 240 * pow2 40);
assert_norm (0 < pow2 40);
calc (==) {
wide_as_nat5 x / pow2 264;
(==) { FStar.Math.Lemmas.division_multiplication_lemma (wide_as_nat5 x) (pow2 224) (pow2 40) }
(wide_as_nat5 x / pow2 224) / pow2 40;
(==) { lemma_div224 x }
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) / pow2 40;
(==) { _ by (Tactics.mapply (`feq #int #int (fun x -> x / pow2 40)); int_semiring ()) }
(v x4 + (v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240) * pow2 40) / pow2 40;
(==) { FStar.Math.Lemmas.lemma_div_plus (v x4) (v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240) (pow2 40) }
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240;
}
val lemma_div264_x5: x5:uint64 ->
Lemma (pow2 16 * (v x5 % pow2 40) + v x5 / pow2 40 * pow2 56 == v x5 * pow2 16)
let lemma_div264_x5 x5 =
assert_norm (0 < pow2 24);
calc (==) {
pow2 16 * (v x5 % pow2 40) + v x5 / pow2 40 * pow2 56;
(==) { _ by (Tactics.norm [delta_only [`%pow2]; primops]; int_semiring ()) }
((v x5 / pow2 40) * pow2 40 + v x5 % pow2 40) * pow2 16;
(==) { FStar.Math.Lemmas.euclidean_division_definition (v x5) (pow2 40) }
v x5 * pow2 16;
}
val lemma_div264_x6: x6:uint64 ->
Lemma (pow2 16 * (v x6 % pow2 40) * pow2 56 + v x6 / pow2 40 * pow2 112 == v x6 * pow2 72)
let lemma_div264_x6 x6 =
calc (==) {
pow2 16 * (v x6 % pow2 40) * pow2 56 + v x6 / pow2 40 * pow2 112;
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
((v x6 / pow2 40) * pow2 40 + v x6 % pow2 40) * pow2 72;
(==) { Math.Lemmas.euclidean_division_definition (v x6) (pow2 40) }
v x6 * pow2 72;
}
val lemma_div264_x7: x7:uint64 ->
Lemma (pow2 16 * (v x7 % pow2 40) * pow2 112 + v x7 / pow2 40 * pow2 168 == v x7 * pow2 128)
let lemma_div264_x7 x7 =
calc (==) {
pow2 16 * (v x7 % pow2 40) * pow2 112 + v x7 / pow2 40 * pow2 168;
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
((v x7 / pow2 40) * pow2 40 + v x7 % pow2 40) * pow2 128;
(==) { Math.Lemmas.euclidean_division_definition (v x7) (pow2 40) }
v x7 * pow2 128;
}
val lemma_div264_x8: x8:uint64 ->
Lemma (pow2 16 * (v x8 % pow2 40) * pow2 168 + v x8 / pow2 40 * pow2 224 == v x8 * pow2 184)
let lemma_div264_x8 x8 =
calc (==) {
pow2 16 * (v x8 % pow2 40) * pow2 168 + v x8 / pow2 40 * pow2 224;
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
((v x8 / pow2 40) * pow2 40 + v x8 % pow2 40) * pow2 184;
(==) { Math.Lemmas.euclidean_division_definition (v x8) (pow2 40) }
v x8 * pow2 184;
}
val lemma_div264_x9: x9:uint64{v x9 < pow2 40} ->
Lemma (pow2 16 * (v x9 % pow2 40) * pow2 224 == v x9 * pow2 240)
let lemma_div264_x9 x9 =
calc (==) {
pow2 16 * (v x9 % pow2 40) * pow2 224;
(==) { Math.Lemmas.small_mod (v x9) (pow2 40) }
pow2 16 * v x9 * pow2 224;
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
v x9 * pow2 240;
}
val lemma_div264: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 528)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
let z0 = v x4 / pow2 40 + pow2 16 * (v x5 % pow2 40) in
let z1 = v x5 / pow2 40 + pow2 16 * (v x6 % pow2 40) in
let z2 = v x6 / pow2 40 + pow2 16 * (v x7 % pow2 40) in
let z3 = v x7 / pow2 40 + pow2 16 * (v x8 % pow2 40) in
let z4 = v x8 / pow2 40 + pow2 16 * (v x9 % pow2 40) in
wide_as_nat5 x / pow2 264 == z0 + z1 * pow2 56 + z2 * pow2 112 + z3 * pow2 168 + z4 * pow2 224))
#push-options "--z3rlimit 50"
let lemma_div264 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
lemma_wide_as_nat_pow528 x;
assert (v x9 < pow2 40);
calc (==) {
(let z0 = v x4 / pow2 40 + pow2 16 * (v x5 % pow2 40) in
let z1 = v x5 / pow2 40 + pow2 16 * (v x6 % pow2 40) in
let z2 = v x6 / pow2 40 + pow2 16 * (v x7 % pow2 40) in
let z3 = v x7 / pow2 40 + pow2 16 * (v x8 % pow2 40) in
let z4 = v x8 / pow2 40 + pow2 16 * (v x9 % pow2 40) in
z0 + z1 * pow2 56 + z2 * pow2 112 + z3 * pow2 168 + z4 * pow2 224);
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
v x4 / pow2 40 + pow2 16 * (v x5 % pow2 40) +
v x5 / pow2 40 * pow2 56 + pow2 16 * (v x6 % pow2 40) * pow2 56 +
v x6 / pow2 40 * pow2 112 + pow2 16 * (v x7 % pow2 40) * pow2 112 +
v x7 / pow2 40 * pow2 168 + pow2 16 * (v x8 % pow2 40) * pow2 168 +
v x8 / pow2 40 * pow2 224 + pow2 16 * (v x9 % pow2 40) * pow2 224;
(==) { lemma_div264_x5 x5; lemma_div264_x6 x6 }
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 +
pow2 16 * (v x7 % pow2 40) * pow2 112 +
v x7 / pow2 40 * pow2 168 + pow2 16 * (v x8 % pow2 40) * pow2 168 +
v x8 / pow2 40 * pow2 224 + pow2 16 * (v x9 % pow2 40) * pow2 224;
(==) { lemma_div264_x7 x7; lemma_div264_x8 x8 }
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 +
pow2 16 * (v x9 % pow2 40) * pow2 224;
(==) { lemma_div264_x9 x9 }
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240;
(==) { lemma_div264_aux x }
wide_as_nat5 x / pow2 264;
}
#pop-options
#pop-options // "--z3cliopt smt.arith.nl=false"
val lemma_mod_264_aux: t:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 t (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) = t in
(wide_as_nat5 t) % pow2 264 ==
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + v t4 * pow2 224) % pow2 264))
#push-options "--z3rlimit 150"
let lemma_mod_264_aux t =
let (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) = t in
let res = (t0, t1, t2, t3, t4 &. u64 0xffffffffff) in
assert_norm (pow2 16 * pow2 264 == pow2 280);
assert_norm (pow2 72 * pow2 264 == pow2 336);
assert_norm (pow2 128 * pow2 264 == pow2 392);
assert_norm (pow2 184 * pow2 264 == pow2 448);
assert_norm (pow2 240 * pow2 264 == pow2 504);
calc (==) {
(wide_as_nat5 t) % pow2 264;
(==) { }
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + v t4 * pow2 224 +
(v t5 * pow2 16 + v t6 * pow2 72 + v t7 * pow2 128 + v t8 * pow2 184 + v t9 * pow2 240) * pow2 264) % pow2 264;
(==) { FStar.Math.Lemmas.lemma_mod_add_distr (v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + v t4 * pow2 224)
((v t5 * pow2 16 + v t6 * pow2 72 + v t7 * pow2 128 + v t8 * pow2 184 + v t9 * pow2 240) * pow2 264) (pow2 264)}
((v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + v t4 * pow2 224) +
((v t5 * pow2 16 + v t6 * pow2 72 + v t7 * pow2 128 + v t8 * pow2 184 + v t9 * pow2 240) * pow2 264) % pow2 264) % pow2 264;
(==) { FStar.Math.Lemmas.cancel_mul_mod (v t5 * pow2 16 + v t6 * pow2 72 + v t7 * pow2 128 + v t8 * pow2 184 + v t9 * pow2 240) (pow2 264) }
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + v t4 * pow2 224) % pow2 264;
}
#pop-options
val lemma_as_nat_pow264: x:qelem5 ->
Lemma
(requires
(let (x0, x1, x2, x3, x4) = x in
qelem_fits5 x (1, 1, 1, 1, 1) /\
v x4 < pow2 40))
(ensures as_nat5 x < pow2 264)
let lemma_as_nat_pow264 x =
let (x0, x1, x2, x3, x4) = x in
assert_norm (pow2 40 * pow2 224 = pow2 264)
val lemma_mod_264: t:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 t (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) = t in
let res = (t0, t1, t2, t3, t4 &. u64 0xffffffffff) in
qelem_fits5 res (1, 1, 1, 1, 1) /\
as_nat5 res == (wide_as_nat5 t) % pow2 264)) | {
"checked_file": "/",
"dependencies": [
"Spec.Ed25519.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.BignumQ.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.CanonCommSemiring.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.BignumQ.Lemmas.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommSemiring",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.Ed25519",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommSemiring",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t: Hacl.Spec.BignumQ.Definitions.qelem_wide5
-> FStar.Pervasives.Lemma
(requires Hacl.Spec.BignumQ.Definitions.qelem_wide_fits5 t (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let _ = t in
(let
FStar.Pervasives.Native.Mktuple10 #_ #_ #_ #_ #_ #_ #_ #_ #_ #_ t0 t1 t2 t3 t4 _ _ _ _ _
=
_
in
let res = t0, t1, t2, t3, t4 &. Lib.IntTypes.u64 0xffffffffff in
Hacl.Spec.BignumQ.Definitions.qelem_fits5 res (1, 1, 1, 1, 1) /\
Hacl.Spec.BignumQ.Definitions.as_nat5 res ==
Hacl.Spec.BignumQ.Definitions.wide_as_nat5 t % Prims.pow2 264)
<:
Type0)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Hacl.Spec.BignumQ.Definitions.qelem_wide5",
"Lib.IntTypes.uint64",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Prims.op_Modulus",
"Hacl.Spec.BignumQ.Definitions.wide_as_nat5",
"Prims.pow2",
"Prims.op_Addition",
"Lib.IntTypes.v",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"FStar.Mul.op_Star",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"Hacl.Spec.BignumQ.Lemmas.lemma_mod_264_aux",
"Prims.squash",
"FStar.Math.Lemmas.lemma_mod_add_distr",
"FStar.Math.Lemmas.pow2_multiplication_modulo_lemma_2",
"FStar.Math.Lemmas.modulo_lemma",
"Hacl.Spec.BignumQ.Definitions.as_nat5",
"Hacl.Spec.BignumQ.Lemmas.lemma_as_nat_pow264",
"Prims._assert",
"Lib.IntTypes.op_Amp_Dot",
"Lib.IntTypes.u64",
"Lib.IntTypes.mod_mask",
"FStar.UInt32.__uint_to_t",
"Lib.IntTypes.mod_mask_lemma",
"FStar.Pervasives.assert_norm",
"Prims.op_Subtraction",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.Pervasives.Native.tuple5",
"Lib.IntTypes.int_t",
"FStar.Pervasives.Native.Mktuple5"
] | [] | false | false | true | false | false | let lemma_mod_264 t =
| let t0, t1, t2, t3, t4, t5, t6, t7, t8, t9 = t in
let t4' = t4 &. u64 0xffffffffff in
let res = (t0, t1, t2, t3, t4') in
assert_norm (pow2 40 < pow2 64);
assert_norm (pow2 40 - 1 == 0xffffffffff);
mod_mask_lemma t4 40ul;
assert (v (mod_mask #U64 #SEC 40ul) == 0xffffffffff);
assert (v (t4 &. u64 0xffffffffff) == v t4 % pow2 40);
calc ( == ) {
(wide_as_nat5 t) % pow2 264;
( == ) { lemma_mod_264_aux t }
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + v t4 * pow2 224) % pow2 264;
( == ) { FStar.Math.Lemmas.lemma_mod_add_distr (v t0 + v t1 * pow2 56 + v t2 * pow2 112 +
v t3 * pow2 168)
(v t4 * pow2 224)
(pow2 264) }
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + (v t4 * pow2 224) % pow2 264) %
pow2 264;
( == ) { FStar.Math.Lemmas.pow2_multiplication_modulo_lemma_2 (v t4) 264 224 }
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + (v t4 % pow2 40) * pow2 224) %
pow2 264;
( == ) { (lemma_as_nat_pow264 res;
FStar.Math.Lemmas.modulo_lemma (as_nat5 res) (pow2 264)) }
v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + (v t4 % pow2 40) * pow2 224;
} | false |
LowParse.Low.DER.fst | LowParse.Low.DER.serialize32_bounded_der_length32' | val serialize32_bounded_der_length32'
(min: der_length_t)
(max: der_length_t{min <= max /\ max < 4294967296})
(y': bounded_int32 (min) (max))
(#rrel #rel: _)
(b: B.mbuffer U8.t rrel rel)
(pos: U32.t)
: HST.Stack U32.t
(requires
(fun h ->
let len = Seq.length (serialize (serialize_bounded_der_length32 (min) (max)) y') in
B.live h b /\ U32.v pos + len <= B.length b /\
writable b (U32.v pos) (U32.v pos + len) h))
(ensures
(fun h len h' ->
let sx = serialize (serialize_bounded_der_length32 (min) (max)) y' in
Seq.length sx == U32.v len /\
(B.modifies (B.loc_buffer_from_to b pos (pos `U32.add` len)) h h' /\ B.live h b /\
(Seq.slice (B.as_seq h' b) (U32.v pos) (U32.v pos + U32.v len)) `Seq.equal` sx))) | val serialize32_bounded_der_length32'
(min: der_length_t)
(max: der_length_t{min <= max /\ max < 4294967296})
(y': bounded_int32 (min) (max))
(#rrel #rel: _)
(b: B.mbuffer U8.t rrel rel)
(pos: U32.t)
: HST.Stack U32.t
(requires
(fun h ->
let len = Seq.length (serialize (serialize_bounded_der_length32 (min) (max)) y') in
B.live h b /\ U32.v pos + len <= B.length b /\
writable b (U32.v pos) (U32.v pos + len) h))
(ensures
(fun h len h' ->
let sx = serialize (serialize_bounded_der_length32 (min) (max)) y' in
Seq.length sx == U32.v len /\
(B.modifies (B.loc_buffer_from_to b pos (pos `U32.add` len)) h h' /\ B.live h b /\
(Seq.slice (B.as_seq h' b) (U32.v pos) (U32.v pos + U32.v len)) `Seq.equal` sx))) | let serialize32_bounded_der_length32'
(min: der_length_t)
(max: der_length_t { min <= max /\ max < 4294967296 } )
(y' : bounded_int32 (min) (max))
(#rrel #rel: _)
(b: B.mbuffer U8.t rrel rel)
(pos: U32.t)
: HST.Stack U32.t
(requires (fun h ->
let len = Seq.length (serialize (serialize_bounded_der_length32 ( min) (max)) y') in
B.live h b /\
U32.v pos + len <= B.length b /\
writable b (U32.v pos) (U32.v pos + len) h
))
(ensures (fun h len h' ->
let sx = serialize (serialize_bounded_der_length32 (min) (max)) y' in
Seq.length sx == U32.v len /\ (
B.modifies (B.loc_buffer_from_to b pos (pos `U32.add` len)) h h' /\
B.live h b /\
Seq.slice (B.as_seq h' b) (U32.v pos) (U32.v pos + U32.v len) `Seq.equal` sx
)))
= [@inline_let]
let gpos = Ghost.hide (U32.v pos) in
[@inline_let]
let gpos' = Ghost.hide (U32.v pos + Seq.length (serialize (serialize_bounded_der_length32 min max) y')) in
[@inline_let]
let _ =
serialize_bounded_der_length32_unfold (min) (max) y'
in
let x = tag_of_der_length32_impl y' in
if x `U8.lt` 128uy
then begin
mbuffer_upd b gpos gpos' pos x;
1ul
end else
if x = 129uy
then begin
mbuffer_upd b gpos gpos' pos x;
mbuffer_upd b gpos gpos' (pos `U32.add` 1ul) (Cast.uint32_to_uint8 y');
2ul
end else
if x = 130uy
then begin
mbuffer_upd b gpos gpos' pos x;
let h = HST.get () in
writable_weaken b (Ghost.reveal gpos) (Ghost.reveal gpos') h (U32.v pos + 1) (U32.v pos + 3);
let z = serialize32_bounded_integer_2 () y' b (pos `U32.add` 1ul) in
let h' = HST.get () in
Seq.lemma_split (Seq.slice (B.as_seq h' b) (U32.v pos) (U32.v pos + 3)) 1;
B.modifies_buffer_from_to_elim b pos (pos `U32.add` 1ul) (B.loc_buffer_from_to b (pos `U32.add` 1ul) (pos `U32.add` 3ul)) h h' ;
3ul // 1ul `U32.add` z
end else
if x = 131uy
then begin
mbuffer_upd b gpos gpos' pos x;
let h = HST.get () in
writable_weaken b (Ghost.reveal gpos) (Ghost.reveal gpos') h (U32.v pos + 1) (U32.v pos + 4);
let z = serialize32_bounded_integer_3 () y' b (pos `U32.add` 1ul) in
let h' = HST.get () in
Seq.lemma_split (Seq.slice (B.as_seq h' b) (U32.v pos) (U32.v pos + 4)) 1;
B.modifies_buffer_from_to_elim b pos (pos `U32.add` 1ul) (B.loc_buffer_from_to b (pos `U32.add` 1ul) (pos `U32.add` 4ul)) h h' ;
4ul // 1ul `U32.add` z
end else begin
mbuffer_upd b gpos gpos' pos x;
let h = HST.get () in
writable_weaken b (Ghost.reveal gpos) (Ghost.reveal gpos') h (U32.v pos + 1) (U32.v pos + 5);
let z = serialize32_bounded_integer_4 () y' b (pos `U32.add` 1ul) in
let h' = HST.get () in
Seq.lemma_split (Seq.slice (B.as_seq h' b) (U32.v pos) (U32.v pos + 5)) 1;
B.modifies_buffer_from_to_elim b pos (pos `U32.add` 1ul) (B.loc_buffer_from_to b (pos `U32.add` 1ul) (pos `U32.add` 5ul)) h h' ;
5ul // 1ul `U32.add` z
end | {
"file_name": "src/lowparse/LowParse.Low.DER.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 5,
"end_line": 309,
"start_col": 0,
"start_line": 238
} | module LowParse.Low.DER
include LowParse.Spec.DER
include LowParse.Low.Int // for parse_u8
include LowParse.Low.BoundedInt // for bounded_integer
open FStar.Mul
module U8 = FStar.UInt8
module U32 = FStar.UInt32
module HST = FStar.HyperStack.ST
module B = LowStar.Buffer
module Cast = FStar.Int.Cast
module U64 = FStar.UInt64
#reset-options "--z3cliopt smt.arith.nl=false --max_fuel 0 --max_ifuel 0"
#push-options "--z3rlimit 32"
inline_for_extraction
let validate_der_length_payload32
(x: U8.t { der_length_payload_size_of_tag x <= 4 } )
: Tot (validator (parse_der_length_payload32 x))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let] let _ =
valid_facts (parse_der_length_payload32 x) h input (uint64_to_uint32 pos);
assert (U64.v pos <= U32.v input.len);
parse_der_length_payload32_unfold x (bytes_of_slice_from h input (uint64_to_uint32 pos));
assert_norm (pow2 (8 * 1) == 256);
assert_norm (pow2 (8 * 2) == 65536);
assert_norm (pow2 (8 * 3) == 16777216);
assert_norm (pow2 (8 * 4) == 4294967296)
in
if x `U8.lt` 128uy
then pos
else if x = 128uy || x = 255uy
then validator_error_generic
else if x = 129uy
then
[@inline_let] let _ = valid_facts parse_u8 h input (uint64_to_uint32 pos) in
let v = validate_u8 () input pos in
if is_error v
then v
else
let z = read_u8 input (uint64_to_uint32 pos) in
if z `U8.lt` 128uy
then validator_error_generic
else v
else
let len = x `U8.sub` 128uy in
[@inline_let] let _ = valid_facts (parse_bounded_integer (U8.v len)) h input (uint64_to_uint32 pos) in
if len = 2uy
then
let v = validate_bounded_integer 2 input pos in
if is_error v
then v
else
let y = read_bounded_integer_2 () input (uint64_to_uint32 pos) in
if y `U32.lt `256ul
then validator_error_generic
else v
else if len = 3uy
then
let v = validate_bounded_integer 3 input pos in
if is_error v
then v
else
let y = read_bounded_integer_3 () input (uint64_to_uint32 pos) in
if y `U32.lt `65536ul
then validator_error_generic
else v
else
let v = validate_bounded_integer 4 input pos in
if is_error v
then v
else
let y = read_bounded_integer_4 () input (uint64_to_uint32 pos) in
if y `U32.lt` 16777216ul
then validator_error_generic
else v
inline_for_extraction
let jump_der_length_payload32
(x: U8.t { der_length_payload_size_of_tag x <= 4 } )
: Tot (jumper (parse_der_length_payload32 x))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let] let _ =
valid_facts (parse_der_length_payload32 x) h input pos;
parse_der_length_payload32_unfold x (bytes_of_slice_from h input pos);
assert_norm (pow2 (8 * 1) == 256);
assert_norm (pow2 (8 * 2) == 65536);
assert_norm (pow2 (8 * 3) == 16777216);
assert_norm (pow2 (8 * 4) == 4294967296)
in
if x `U8.lt` 128uy
then pos
else
[@inline_let]
let len = x `U8.sub` 128uy in
[@inline_let] let _ =
valid_facts parse_u8 h input pos;
parser_kind_prop_equiv parse_u8_kind parse_u8;
valid_facts (parse_bounded_integer (U8.v len)) h input pos;
parser_kind_prop_equiv (parse_bounded_integer_kind (U8.v len)) (parse_bounded_integer (U8.v len))
in
pos `U32.add` Cast.uint8_to_uint32 len
inline_for_extraction
let read_der_length_payload32
(x: U8.t { der_length_payload_size_of_tag x <= 4 } )
: Tot (leaf_reader (parse_der_length_payload32 x))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let] let _ =
valid_facts (parse_der_length_payload32 x) h input pos;
parse_der_length_payload32_unfold x (bytes_of_slice_from h input pos);
assert_norm (pow2 (8 * 1) == 256);
assert_norm (pow2 (8 * 2) == 65536);
assert_norm (pow2 (8 * 3) == 16777216);
assert_norm (pow2 (8 * 4) == 4294967296)
in
if x `U8.lt` 128uy
then
[@inline_let]
let res = Cast.uint8_to_uint32 x in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x)
else if x = 129uy
then
[@inline_let] let _ = valid_facts parse_u8 h input pos in
let z = read_u8 input pos in
[@inline_let] let res = Cast.uint8_to_uint32 z in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x)
else
let len = x `U8.sub` 128uy in
[@inline_let] let _ = valid_facts (parse_bounded_integer (U8.v len)) h input pos in
if len = 2uy
then
let res = read_bounded_integer_2 () input pos in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x)
else if len = 3uy
then
let res = read_bounded_integer_3 () input pos in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x)
else
let res = read_bounded_integer_4 () input pos in
[@inline_let] let _ = assert (tag_of_der_length32 res == x) in
(res <: refine_with_tag tag_of_der_length32 x)
inline_for_extraction
let validate_bounded_der_length32
(vmin: der_length_t)
(min: U32.t { U32.v min == vmin } )
(vmax: der_length_t)
(max: U32.t { U32.v max == vmax /\ U32.v min <= U32.v max } )
: Tot (
validator (parse_bounded_der_length32 (vmin) (vmax)))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let]
let _ =
valid_facts (parse_bounded_der_length32 (U32.v min) (U32.v max)) h input (uint64_to_uint32 pos);
parse_bounded_der_length32_unfold (U32.v min) (U32.v max) (bytes_of_slice_from h input (uint64_to_uint32 pos));
valid_facts parse_u8 h input (uint64_to_uint32 pos)
in
let v = validate_u8 () input pos in
if is_error v
then v
else
let x = read_u8 input (uint64_to_uint32 pos) in
let len = der_length_payload_size_of_tag8 x in
let tg1 = tag_of_der_length32_impl min in
let l1 = der_length_payload_size_of_tag8 tg1 in
let tg2 = tag_of_der_length32_impl max in
let l2 = der_length_payload_size_of_tag8 tg2 in
if (len `U8.lt` l1) || ( l2 `U8.lt` len)
then validator_error_generic
else
[@inline_let] let _ = valid_facts (parse_der_length_payload32 x) h input (uint64_to_uint32 v) in
let v2 = validate_der_length_payload32 x input v in
if is_error v2
then v2
else
let y = read_der_length_payload32 x input (uint64_to_uint32 v) in
if y `U32.lt` min || max `U32.lt` y
then validator_error_generic
else v2
inline_for_extraction
let jump_bounded_der_length32
(vmin: der_length_t)
(vmax: der_length_t { vmin <= vmax /\ vmax < 4294967296 } )
: Tot (
jumper (parse_bounded_der_length32 (vmin) (vmax)))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let]
let _ =
valid_facts (parse_bounded_der_length32 (vmin) (vmax)) h input pos;
parse_bounded_der_length32_unfold (vmin) (vmax) (bytes_of_slice_from h input pos);
valid_facts parse_u8 h input pos
in
let v = jump_u8 input pos in
let x = read_u8 input pos in
let len = der_length_payload_size_of_tag8 x in
[@inline_let] let _ = valid_facts (parse_der_length_payload32 x) h input v in
jump_der_length_payload32 x input v
inline_for_extraction
let read_bounded_der_length32
(vmin: der_length_t)
(vmax: der_length_t { vmin <= vmax /\ vmax < 4294967296 } )
: Tot (
leaf_reader (parse_bounded_der_length32 (vmin) (vmax)))
= fun #rrel #rel input pos ->
let h = HST.get () in
[@inline_let]
let _ =
valid_facts (parse_bounded_der_length32 (vmin) (vmax)) h input pos;
parse_bounded_der_length32_unfold (vmin) (vmax) (bytes_of_slice_from h input pos);
valid_facts parse_u8 h input pos
in
let v = jump_u8 input pos in
let x = read_u8 input pos in
let len = der_length_payload_size_of_tag8 x in
[@inline_let] let _ = valid_facts (parse_der_length_payload32 x) h input v in
let y = read_der_length_payload32 x input v in
(y <: bounded_int32 (vmin) (vmax))
#pop-options
#push-options "--z3rlimit 64" | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.DER.fsti.checked",
"LowParse.Low.Int.fsti.checked",
"LowParse.Low.BoundedInt.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.DER.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low.BoundedInt",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.DER",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"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": [
"smt.arith.nl=false"
],
"z3refresh": false,
"z3rlimit": 64,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
min: LowParse.Spec.DER.der_length_t ->
max: LowParse.Spec.DER.der_length_t{min <= max /\ max < 4294967296} ->
y': LowParse.Spec.BoundedInt.bounded_int32 min max ->
b: LowStar.Monotonic.Buffer.mbuffer FStar.UInt8.t rrel rel ->
pos: FStar.UInt32.t
-> FStar.HyperStack.ST.Stack FStar.UInt32.t | FStar.HyperStack.ST.Stack | [] | [] | [
"LowParse.Spec.DER.der_length_t",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowStar.Monotonic.Buffer.srel",
"FStar.UInt8.t",
"LowStar.Monotonic.Buffer.mbuffer",
"FStar.UInt32.t",
"FStar.UInt8.lt",
"FStar.UInt8.__uint_to_t",
"FStar.UInt32.__uint_to_t",
"Prims.unit",
"LowParse.Low.Base.mbuffer_upd",
"Prims.bool",
"Prims.op_Equality",
"FStar.UInt32.add",
"FStar.Int.Cast.uint32_to_uint8",
"LowStar.Monotonic.Buffer.modifies_buffer_from_to_elim",
"LowStar.Monotonic.Buffer.loc_buffer_from_to",
"FStar.Seq.Properties.lemma_split",
"FStar.Seq.Base.slice",
"LowStar.Monotonic.Buffer.as_seq",
"FStar.UInt32.v",
"Prims.op_Addition",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"LowParse.Low.BoundedInt.serialize32_bounded_integer_2",
"LowParse.Low.Base.writable_weaken",
"FStar.Ghost.reveal",
"Prims.nat",
"LowParse.Low.BoundedInt.serialize32_bounded_integer_3",
"LowParse.Low.BoundedInt.serialize32_bounded_integer_4",
"LowParse.Spec.DER.der_length_max",
"Prims.eq2",
"LowParse.Spec.DER.tag_of_der_length",
"LowParse.Spec.DER.tag_of_der_length32_impl",
"LowParse.Spec.DER.serialize_bounded_der_length32_unfold",
"FStar.Ghost.erased",
"FStar.Ghost.hide",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"LowParse.Spec.Base.serialize",
"LowParse.Spec.DER.parse_bounded_der_length32_kind",
"LowParse.Spec.DER.parse_bounded_der_length32",
"LowParse.Spec.DER.serialize_bounded_der_length32",
"LowStar.Monotonic.Buffer.live",
"LowStar.Monotonic.Buffer.length",
"LowParse.Low.Base.writable",
"Prims.int",
"Prims.l_or",
"Prims.op_GreaterThanOrEqual",
"FStar.UInt.size",
"FStar.UInt32.n",
"LowStar.Monotonic.Buffer.modifies",
"FStar.Seq.Base.equal",
"LowParse.Bytes.bytes"
] | [] | false | true | false | false | false | let serialize32_bounded_der_length32'
(min: der_length_t)
(max: der_length_t{min <= max /\ max < 4294967296})
(y': bounded_int32 (min) (max))
(#rrel #rel: _)
(b: B.mbuffer U8.t rrel rel)
(pos: U32.t)
: HST.Stack U32.t
(requires
(fun h ->
let len = Seq.length (serialize (serialize_bounded_der_length32 (min) (max)) y') in
B.live h b /\ U32.v pos + len <= B.length b /\
writable b (U32.v pos) (U32.v pos + len) h))
(ensures
(fun h len h' ->
let sx = serialize (serialize_bounded_der_length32 (min) (max)) y' in
Seq.length sx == U32.v len /\
(B.modifies (B.loc_buffer_from_to b pos (pos `U32.add` len)) h h' /\ B.live h b /\
(Seq.slice (B.as_seq h' b) (U32.v pos) (U32.v pos + U32.v len)) `Seq.equal` sx))) =
| [@@ inline_let ]let gpos = Ghost.hide (U32.v pos) in
[@@ inline_let ]let gpos' =
Ghost.hide (U32.v pos + Seq.length (serialize (serialize_bounded_der_length32 min max) y'))
in
[@@ inline_let ]let _ = serialize_bounded_der_length32_unfold (min) (max) y' in
let x = tag_of_der_length32_impl y' in
if x `U8.lt` 128uy
then
(mbuffer_upd b gpos gpos' pos x;
1ul)
else
if x = 129uy
then
(mbuffer_upd b gpos gpos' pos x;
mbuffer_upd b gpos gpos' (pos `U32.add` 1ul) (Cast.uint32_to_uint8 y');
2ul)
else
if x = 130uy
then
(mbuffer_upd b gpos gpos' pos x;
let h = HST.get () in
writable_weaken b (Ghost.reveal gpos) (Ghost.reveal gpos') h (U32.v pos + 1) (U32.v pos + 3);
let z = serialize32_bounded_integer_2 () y' b (pos `U32.add` 1ul) in
let h' = HST.get () in
Seq.lemma_split (Seq.slice (B.as_seq h' b) (U32.v pos) (U32.v pos + 3)) 1;
B.modifies_buffer_from_to_elim b
pos
(pos `U32.add` 1ul)
(B.loc_buffer_from_to b (pos `U32.add` 1ul) (pos `U32.add` 3ul))
h
h';
3ul)
else
if x = 131uy
then
(mbuffer_upd b gpos gpos' pos x;
let h = HST.get () in
writable_weaken b
(Ghost.reveal gpos)
(Ghost.reveal gpos')
h
(U32.v pos + 1)
(U32.v pos + 4);
let z = serialize32_bounded_integer_3 () y' b (pos `U32.add` 1ul) in
let h' = HST.get () in
Seq.lemma_split (Seq.slice (B.as_seq h' b) (U32.v pos) (U32.v pos + 4)) 1;
B.modifies_buffer_from_to_elim b
pos
(pos `U32.add` 1ul)
(B.loc_buffer_from_to b (pos `U32.add` 1ul) (pos `U32.add` 4ul))
h
h';
4ul)
else
(mbuffer_upd b gpos gpos' pos x;
let h = HST.get () in
writable_weaken b
(Ghost.reveal gpos)
(Ghost.reveal gpos')
h
(U32.v pos + 1)
(U32.v pos + 5);
let z = serialize32_bounded_integer_4 () y' b (pos `U32.add` 1ul) in
let h' = HST.get () in
Seq.lemma_split (Seq.slice (B.as_seq h' b) (U32.v pos) (U32.v pos + 5)) 1;
B.modifies_buffer_from_to_elim b
pos
(pos `U32.add` 1ul)
(B.loc_buffer_from_to b (pos `U32.add` 1ul) (pos `U32.add` 5ul))
h
h';
5ul) | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.fsquare_times | val fsquare_times (a: S.felem) (b: nat) : S.felem | val fsquare_times (a: S.felem) (b: nat) : S.felem | let fsquare_times (a:S.felem) (b:nat) : S.felem =
SE.exp_pow2 mk_nat_mod_concrete_ops a b | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 41,
"end_line": 37,
"start_col": 0,
"start_line": 36
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime
let mk_to_nat_mod_comm_monoid : SE.to_comm_monoid S.felem = {
SE.a_spec = S.felem;
SE.comm_monoid = nat_mod_comm_monoid;
SE.refl = (fun (x:S.felem) -> x);
}
val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid
let one_mod _ = 1
val mul_mod : SE.mul_st S.felem mk_to_nat_mod_comm_monoid
let mul_mod x y = S.fmul x y
val sqr_mod : SE.sqr_st S.felem mk_to_nat_mod_comm_monoid
let sqr_mod x = S.fmul x x
let mk_nat_mod_concrete_ops : SE.concrete_ops S.felem = {
SE.to = mk_to_nat_mod_comm_monoid;
SE.one = one_mod;
SE.mul = mul_mod;
SE.sqr = sqr_mod;
} | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Spec.P256.PointOps.felem -> b: Prims.nat -> Spec.P256.PointOps.felem | Prims.Tot | [
"total"
] | [] | [
"Spec.P256.PointOps.felem",
"Prims.nat",
"Spec.Exponentiation.exp_pow2",
"Hacl.Spec.P256.Finv.mk_nat_mod_concrete_ops"
] | [] | false | false | false | true | false | let fsquare_times (a: S.felem) (b: nat) : S.felem =
| SE.exp_pow2 mk_nat_mod_concrete_ops a b | false |
Hacl.Spec.BignumQ.Lemmas.fst | Hacl.Spec.BignumQ.Lemmas.lemma_barrett_reduce'' | val lemma_barrett_reduce'' (u z x q: nat)
: Lemma (requires u < 2 * S.q /\ u = x - q * S.q /\ z == (if u < S.q then u else u - S.q))
(ensures z == x % S.q) | val lemma_barrett_reduce'' (u z x q: nat)
: Lemma (requires u < 2 * S.q /\ u = x - q * S.q /\ z == (if u < S.q then u else u - S.q))
(ensures z == x % S.q) | let lemma_barrett_reduce'' (u:nat) (z:nat) (x:nat) (q:nat) : Lemma
(requires u < 2 * S.q /\ u = x - q * S.q /\ z == (if u < S.q then u else u - S.q))
(ensures z == x % S.q)
=
if u >= S.q then (
calc (==) {
z;
(==) { Math.Lemmas.small_mod z S.q }
(u - S.q) % S.q;
(==) { }
(x - (q * S.q + S.q)) % S.q;
(==) { Math.Lemmas.distributivity_add_left q 1 S.q; assert_norm (1 * S.q == S.q) }
(x - (q + 1) * S.q) % S.q;
(==) { Math.Lemmas.lemma_mod_sub x S.q (q+1) }
x % S.q;
}
) else (
calc (==) {
z;
(==) { Math.Lemmas.small_mod z S.q }
u % S.q;
(==) { }
(x - (q * S.q)) % S.q;
(==) { Math.Lemmas.lemma_mod_sub x S.q q }
x % S.q;
}
) | {
"file_name": "code/ed25519/Hacl.Spec.BignumQ.Lemmas.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 901,
"start_col": 0,
"start_line": 875
} | module Hacl.Spec.BignumQ.Lemmas
open FStar.Tactics.CanonCommSemiring
open FStar.Mul
open Lib.IntTypes
module S = Spec.Ed25519
include Hacl.Spec.BignumQ.Definitions
let feq (#a #b:Type) (f:(a -> b)) (x y:a) :
Lemma (requires x == y) (ensures f x == f y) = ()
let eq_eq2 (#a:eqtype) (x y:a) :
Lemma (requires x = y) (ensures x == y) = ()
val lemma_mul_lt:a:nat -> b:nat -> c:nat -> d:nat ->
Lemma
(requires a < b /\ c < d)
(ensures a * c < b * d)
let lemma_mul_lt a b c d = ()
val lemma_as_nat5: f:qelem5 ->
Lemma
(requires qelem_fits5 f (1, 1, 1, 1, 1))
(ensures as_nat5 f < pow2 280)
let lemma_as_nat5 f =
//let (f0, f1, f2, f3, f4) = f in
//assert (as_nat5 f == v f0 + v f1 * pow56 + v f2 * pow112 + v f3 * pow168 + v f4 * pow224);
assert_norm (pow2 56 * pow2 56 = pow2 112);
assert_norm (pow2 56 * pow2 112 = pow2 168);
assert_norm (pow2 56 * pow2 168 = pow2 224);
assert_norm (pow2 56 * pow2 224 = pow2 280)
val lemma_choose_step:
bit:uint64{v bit <= 1}
-> x:uint64
-> y:uint64
-> Lemma
(let mask = bit -. u64 1 in
let z = x ^. (mask &. (x ^. y)) in
if v bit = 1 then z == x else z == y)
let lemma_choose_step bit p1 p2 =
let mask = bit -. u64 1 in
assert (v bit == 0 ==> v mask == pow2 64 - 1);
assert (v bit == 1 ==> v mask == 0);
let dummy = mask &. (p1 ^. p2) in
logand_lemma mask (p1 ^. p2);
assert (v bit == 1 ==> v dummy == 0);
assert (v bit == 0 ==> v dummy == v (p1 ^. p2));
let p1' = p1 ^. dummy in
assert (v dummy == v (if v bit = 1 then u64 0 else (p1 ^. p2)));
logxor_lemma p1 p2
val lemma_subm_conditional:
x0:nat -> x1:nat -> x2:nat -> x3:nat -> x4:nat
-> y0:nat -> y1:nat -> y2:nat -> y3:nat -> y4:nat
-> b0:nat -> b1:nat -> b2:nat -> b3:nat -> b4:nat ->
Lemma (
x0 - y0 + b0 * pow2 56 +
(x1 - y1 - b0 + b1 * pow2 56) * pow2 56 +
(x2 - y2 - b1 + b2 * pow2 56) * pow2 112 +
(x3 - y3 - b2 + b3 * pow2 56) * pow2 168 +
(x4 - y4 - b3 + b4 * pow2 56) * pow2 224 ==
(x0 + x1 * pow2 56 + x2 * pow2 112 + x3 * pow2 168 + x4 * pow2 224) -
(y0 + y1 * pow2 56 + y2 * pow2 112 + y3 * pow2 168 + y4 * pow2 224) + b4 * pow2 280)
let lemma_subm_conditional x0 x1 x2 x3 x4 y0 y1 y2 y3 y4 b0 b1 b2 b3 b4 =
assert_norm (pow2 56 * pow2 56 = pow2 112);
assert_norm (pow2 56 * pow2 112 = pow2 168);
assert_norm (pow2 56 * pow2 168 = pow2 224);
assert_norm (pow2 56 * pow2 224 = pow2 280);
assert (
x0 - y0 + b0 * pow2 56 +
(x1 - y1 - b0 + b1 * pow2 56) * pow2 56 +
(x2 - y2 - b1 + b2 * pow2 56) * pow2 112 +
(x3 - y3 - b2 + b3 * pow2 56) * pow2 168 +
(x4 - y4 - b3 + b4 * pow2 56) * pow2 224 ==
(x0 + x1 * pow2 56 + x2 * pow2 112 + x3 * pow2 168 + x4 * pow2 224) -
(y0 + y1 * pow2 56 + y2 * pow2 112 + y3 * pow2 168 + y4 * pow2 224) + b4 * pow2 280)
by (int_semiring ());
()
val lemma_div224: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 224 ==
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280))
#push-options "--z3rlimit 50"
let lemma_div224 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert
(wide_as_nat5 x ==
v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168 + v x4 * pow2 224 +
v x5 * pow2 280 + v x6 * pow2 336 + v x7 * pow2 392 + v x8 * pow2 448 + v x9 * pow2 504);
assert_norm (pow2 56 * pow2 224 == pow2 280);
assert_norm (pow2 112 * pow2 224 == pow2 336);
assert_norm (pow2 168 * pow2 224 == pow2 392);
assert_norm (pow2 224 * pow2 224 == pow2 448);
assert_norm (pow2 280 * pow2 224 == pow2 504);
calc (==) {
wide_as_nat5 x / pow2 224;
(==) { }
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168 +
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) * pow2 224) / pow2 224;
(==) {
FStar.Math.Lemmas.lemma_div_plus
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168)
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) (pow2 224) }
(v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168) / pow2 224 +
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280;
(==) { FStar.Math.Lemmas.small_division_lemma_1 (v x0 + v x1 * pow2 56 + v x2 * pow2 112 + v x3 * pow2 168) (pow2 224) }
v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280;
}
#pop-options
val lemma_div248_aux: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 512)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 248 ==
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256))
open FStar.Tactics.CanonCommSemiring
#push-options "--z3cliopt smt.arith.nl=false"
let lemma_div248_aux x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert_norm (pow2 248 == pow2 224 * pow2 24);
assert_norm (pow2 56 == pow2 32 * pow2 24);
assert_norm (pow2 112 == pow2 88 * pow2 24);
assert_norm (pow2 168 == pow2 144 * pow2 24);
assert_norm (pow2 224 == pow2 200 * pow2 24);
assert_norm (pow2 280 == pow2 256 * pow2 24);
assert_norm (0 < pow2 24);
calc (==) {
wide_as_nat5 x / pow2 248;
(==) { FStar.Math.Lemmas.division_multiplication_lemma (wide_as_nat5 x) (pow2 224) (pow2 24) }
(wide_as_nat5 x / pow2 224) / pow2 24;
(==) { lemma_div224 x }
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) / pow2 24;
(==) { _ by (Tactics.mapply (`feq #int #int (fun x -> x / pow2 24)); int_semiring ()) } (v x4 + (v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256) * pow2 24) / pow2 24;
(==) { FStar.Math.Lemmas.lemma_div_plus (v x4) (v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256) (pow2 24) }
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256;
}
#pop-options
val lemma_div248_x5: x5:uint64 ->
Lemma ( pow2 32 * (v x5 % pow2 24) + v x5 / pow2 24 * pow2 56 == v x5 * pow2 32)
let lemma_div248_x5 x5 =
assert_norm (pow2 32 * pow2 24 = pow2 56)
val lemma_div248_x6: x6:uint64 ->
Lemma (pow2 32 * (v x6 % pow2 24) * pow2 56 + v x6 / pow2 24 * pow2 112 == v x6 * pow2 88)
let lemma_div248_x6 x6 =
calc (==) {
pow2 32 * (v x6 % pow2 24) * pow2 56 + v x6 / pow2 24 * pow2 112;
(==) { _ by (Tactics.norm [delta_only [`%pow2]; primops]; int_semiring ()) }
((v x6 / pow2 24) * pow2 24 + v x6 % pow2 24) * pow2 88;
(==) { FStar.Math.Lemmas.euclidean_division_definition (v x6) (pow2 24) }
v x6 * pow2 88;
}
val lemma_div248_x7: x7:uint64 ->
Lemma (pow2 32 * (v x7 % pow2 24) * pow2 112 + v x7 / pow2 24 * pow2 168 == v x7 * pow2 144)
let lemma_div248_x7 x7 =
calc (==) {
pow2 32 * (v x7 % pow2 24) * pow2 112 + v x7 / pow2 24 * pow2 168;
(==) { _ by (Tactics.norm [delta_only [`%pow2]; primops]; int_semiring ()) }
((v x7 / pow2 24) * pow2 24 + v x7 % pow2 24) * pow2 144;
(==) { FStar.Math.Lemmas.euclidean_division_definition (v x7) (pow2 24) }
v x7 * pow2 144;
}
val lemma_div248_x8: x8:uint64 ->
Lemma (pow2 32 * (v x8 % pow2 24) * pow2 168 + v x8 / pow2 24 * pow2 224 == v x8 * pow2 200)
let lemma_div248_x8 x8 =
calc (==) {
pow2 32 * (v x8 % pow2 24) * pow2 168 + v x8 / pow2 24 * pow2 224;
(==) { _ by (Tactics.norm [delta_only [`%pow2]; primops]; int_semiring ()) }
((v x8 / pow2 24) * pow2 24 + v x8 % pow2 24) * pow2 200;
(==) { FStar.Math.Lemmas.euclidean_division_definition (v x8) (pow2 24) }
v x8 * pow2 200;
}
val lemma_div248_x9: x9:uint64{v x9 < pow2 24} ->
Lemma (pow2 32 * (v x9 % pow2 24) * pow2 224 == v x9 * pow2 256)
let lemma_div248_x9 x9 =
calc (==) {
pow2 32 * (v x9 % pow2 24) * pow2 224;
(==) { Math.Lemmas.small_mod (v x9) (pow2 24) }
pow2 32 * v x9 * pow2 224;
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
v x9 * pow2 256;
}
val lemma_wide_as_nat_pow512: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 512)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
v x9 < pow2 24))
let lemma_wide_as_nat_pow512 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert_norm (pow2 504 * pow2 8 = pow2 512);
FStar.Math.Lemmas.pow2_minus 512 504;
assert (v x9 < pow2 8);
assert_norm (pow2 8 < pow2 24)
val lemma_div248: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 512)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
let z0 = v x4 / pow2 24 + pow2 32 * (v x5 % pow2 24) in
let z1 = v x5 / pow2 24 + pow2 32 * (v x6 % pow2 24) in
let z2 = v x6 / pow2 24 + pow2 32 * (v x7 % pow2 24) in
let z3 = v x7 / pow2 24 + pow2 32 * (v x8 % pow2 24) in
let z4 = v x8 / pow2 24 + pow2 32 * (v x9 % pow2 24) in
wide_as_nat5 x / pow2 248 == z0 + z1 * pow2 56 + z2 * pow2 112 + z3 * pow2 168 + z4 * pow2 224))
#push-options "--z3rlimit 50"
let lemma_div248 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
lemma_wide_as_nat_pow512 x;
assert (v x9 < pow2 24);
calc (==) {
(let z0 = v x4 / pow2 24 + pow2 32 * (v x5 % pow2 24) in
let z1 = v x5 / pow2 24 + pow2 32 * (v x6 % pow2 24) in
let z2 = v x6 / pow2 24 + pow2 32 * (v x7 % pow2 24) in
let z3 = v x7 / pow2 24 + pow2 32 * (v x8 % pow2 24) in
let z4 = v x8 / pow2 24 + pow2 32 * (v x9 % pow2 24) in
z0 + z1 * pow2 56 + z2 * pow2 112 + z3 * pow2 168 + z4 * pow2 224);
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
v x4 / pow2 24 + pow2 32 * (v x5 % pow2 24) +
v x5 / pow2 24 * pow2 56 + pow2 32 * (v x6 % pow2 24) * pow2 56 +
v x6 / pow2 24 * pow2 112 + pow2 32 * (v x7 % pow2 24) * pow2 112 +
v x7 / pow2 24 * pow2 168 + pow2 32 * (v x8 % pow2 24) * pow2 168 +
v x8 / pow2 24 * pow2 224 + pow2 32 * (v x9 % pow2 24) * pow2 224;
(==) { lemma_div248_x5 x5; lemma_div248_x6 x6 }
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 +
pow2 32 * (v x7 % pow2 24) * pow2 112 +
v x7 / pow2 24 * pow2 168 + pow2 32 * (v x8 % pow2 24) * pow2 168 +
v x8 / pow2 24 * pow2 224 + pow2 32 * (v x9 % pow2 24) * pow2 224;
(==) { lemma_div248_x7 x7; lemma_div248_x8 x8 }
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 +
pow2 32 * (v x9 % pow2 24) * pow2 224;
(==) { lemma_div248_x9 x9 }
v x4 / pow2 24 + v x5 * pow2 32 + v x6 * pow2 88 + v x7 * pow2 144 + v x8 * pow2 200 + v x9 * pow2 256;
(==) { lemma_div248_aux x }
wide_as_nat5 x / pow2 248;
}
#pop-options
val lemma_add_modq5:
x:qelem5
-> y:qelem5
-> t:qelem5 ->
Lemma
(requires
qelem_fits5 x (1, 1, 1, 1, 1) /\
qelem_fits5 y (1, 1, 1, 1, 1) /\
qelem_fits5 t (1, 1, 1, 1, 1) /\
as_nat5 x < S.q /\ as_nat5 y < S.q /\
as_nat5 t == as_nat5 x + as_nat5 y)
(ensures
(let res = if as_nat5 t >= S.q then as_nat5 t - S.q else as_nat5 t in
res < S.q /\ res == (as_nat5 x + as_nat5 y) % S.q))
let lemma_add_modq5 x y t =
assert (as_nat5 t == as_nat5 x + as_nat5 y);
let res = if as_nat5 t >= S.q then as_nat5 t - S.q else as_nat5 t in
assert (res < S.q);
if as_nat5 t >= S.q then (
FStar.Math.Lemmas.sub_div_mod_1 (as_nat5 t) S.q;
assert (res % S.q == as_nat5 t % S.q))
else
assert (res % S.q == as_nat5 t % S.q);
FStar.Math.Lemmas.small_mod res S.q
val lemma_wide_as_nat_pow528: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 528)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
v x9 < pow2 40))
let lemma_wide_as_nat_pow528 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert_norm (pow2 504 * pow2 24 = pow2 528);
FStar.Math.Lemmas.pow2_minus 528 504;
assert (v x9 < pow2 24);
assert_norm (pow2 24 < pow2 40)
#push-options "--z3cliopt smt.arith.nl=false"
val lemma_div264_aux: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 528)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
wide_as_nat5 x / pow2 264 ==
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240))
let lemma_div264_aux x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
assert_norm (pow2 264 == pow2 224 * pow2 40);
assert_norm (pow2 56 == pow2 16 * pow2 40);
assert_norm (pow2 112 == pow2 72 * pow2 40);
assert_norm (pow2 168 == pow2 128 * pow2 40);
assert_norm (pow2 224 == pow2 184 * pow2 40);
assert_norm (pow2 280 == pow2 240 * pow2 40);
assert_norm (0 < pow2 40);
calc (==) {
wide_as_nat5 x / pow2 264;
(==) { FStar.Math.Lemmas.division_multiplication_lemma (wide_as_nat5 x) (pow2 224) (pow2 40) }
(wide_as_nat5 x / pow2 224) / pow2 40;
(==) { lemma_div224 x }
(v x4 + v x5 * pow2 56 + v x6 * pow2 112 + v x7 * pow2 168 + v x8 * pow2 224 + v x9 * pow2 280) / pow2 40;
(==) { _ by (Tactics.mapply (`feq #int #int (fun x -> x / pow2 40)); int_semiring ()) }
(v x4 + (v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240) * pow2 40) / pow2 40;
(==) { FStar.Math.Lemmas.lemma_div_plus (v x4) (v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240) (pow2 40) }
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240;
}
val lemma_div264_x5: x5:uint64 ->
Lemma (pow2 16 * (v x5 % pow2 40) + v x5 / pow2 40 * pow2 56 == v x5 * pow2 16)
let lemma_div264_x5 x5 =
assert_norm (0 < pow2 24);
calc (==) {
pow2 16 * (v x5 % pow2 40) + v x5 / pow2 40 * pow2 56;
(==) { _ by (Tactics.norm [delta_only [`%pow2]; primops]; int_semiring ()) }
((v x5 / pow2 40) * pow2 40 + v x5 % pow2 40) * pow2 16;
(==) { FStar.Math.Lemmas.euclidean_division_definition (v x5) (pow2 40) }
v x5 * pow2 16;
}
val lemma_div264_x6: x6:uint64 ->
Lemma (pow2 16 * (v x6 % pow2 40) * pow2 56 + v x6 / pow2 40 * pow2 112 == v x6 * pow2 72)
let lemma_div264_x6 x6 =
calc (==) {
pow2 16 * (v x6 % pow2 40) * pow2 56 + v x6 / pow2 40 * pow2 112;
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
((v x6 / pow2 40) * pow2 40 + v x6 % pow2 40) * pow2 72;
(==) { Math.Lemmas.euclidean_division_definition (v x6) (pow2 40) }
v x6 * pow2 72;
}
val lemma_div264_x7: x7:uint64 ->
Lemma (pow2 16 * (v x7 % pow2 40) * pow2 112 + v x7 / pow2 40 * pow2 168 == v x7 * pow2 128)
let lemma_div264_x7 x7 =
calc (==) {
pow2 16 * (v x7 % pow2 40) * pow2 112 + v x7 / pow2 40 * pow2 168;
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
((v x7 / pow2 40) * pow2 40 + v x7 % pow2 40) * pow2 128;
(==) { Math.Lemmas.euclidean_division_definition (v x7) (pow2 40) }
v x7 * pow2 128;
}
val lemma_div264_x8: x8:uint64 ->
Lemma (pow2 16 * (v x8 % pow2 40) * pow2 168 + v x8 / pow2 40 * pow2 224 == v x8 * pow2 184)
let lemma_div264_x8 x8 =
calc (==) {
pow2 16 * (v x8 % pow2 40) * pow2 168 + v x8 / pow2 40 * pow2 224;
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
((v x8 / pow2 40) * pow2 40 + v x8 % pow2 40) * pow2 184;
(==) { Math.Lemmas.euclidean_division_definition (v x8) (pow2 40) }
v x8 * pow2 184;
}
val lemma_div264_x9: x9:uint64{v x9 < pow2 40} ->
Lemma (pow2 16 * (v x9 % pow2 40) * pow2 224 == v x9 * pow2 240)
let lemma_div264_x9 x9 =
calc (==) {
pow2 16 * (v x9 % pow2 40) * pow2 224;
(==) { Math.Lemmas.small_mod (v x9) (pow2 40) }
pow2 16 * v x9 * pow2 224;
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
v x9 * pow2 240;
}
val lemma_div264: x:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 x (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) /\
wide_as_nat5 x < pow2 528)
(ensures
(let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
let z0 = v x4 / pow2 40 + pow2 16 * (v x5 % pow2 40) in
let z1 = v x5 / pow2 40 + pow2 16 * (v x6 % pow2 40) in
let z2 = v x6 / pow2 40 + pow2 16 * (v x7 % pow2 40) in
let z3 = v x7 / pow2 40 + pow2 16 * (v x8 % pow2 40) in
let z4 = v x8 / pow2 40 + pow2 16 * (v x9 % pow2 40) in
wide_as_nat5 x / pow2 264 == z0 + z1 * pow2 56 + z2 * pow2 112 + z3 * pow2 168 + z4 * pow2 224))
#push-options "--z3rlimit 50"
let lemma_div264 x =
let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = x in
lemma_wide_as_nat_pow528 x;
assert (v x9 < pow2 40);
calc (==) {
(let z0 = v x4 / pow2 40 + pow2 16 * (v x5 % pow2 40) in
let z1 = v x5 / pow2 40 + pow2 16 * (v x6 % pow2 40) in
let z2 = v x6 / pow2 40 + pow2 16 * (v x7 % pow2 40) in
let z3 = v x7 / pow2 40 + pow2 16 * (v x8 % pow2 40) in
let z4 = v x8 / pow2 40 + pow2 16 * (v x9 % pow2 40) in
z0 + z1 * pow2 56 + z2 * pow2 112 + z3 * pow2 168 + z4 * pow2 224);
(==) { _ by (Tactics.norm [delta; primops]; int_semiring ()) }
v x4 / pow2 40 + pow2 16 * (v x5 % pow2 40) +
v x5 / pow2 40 * pow2 56 + pow2 16 * (v x6 % pow2 40) * pow2 56 +
v x6 / pow2 40 * pow2 112 + pow2 16 * (v x7 % pow2 40) * pow2 112 +
v x7 / pow2 40 * pow2 168 + pow2 16 * (v x8 % pow2 40) * pow2 168 +
v x8 / pow2 40 * pow2 224 + pow2 16 * (v x9 % pow2 40) * pow2 224;
(==) { lemma_div264_x5 x5; lemma_div264_x6 x6 }
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 +
pow2 16 * (v x7 % pow2 40) * pow2 112 +
v x7 / pow2 40 * pow2 168 + pow2 16 * (v x8 % pow2 40) * pow2 168 +
v x8 / pow2 40 * pow2 224 + pow2 16 * (v x9 % pow2 40) * pow2 224;
(==) { lemma_div264_x7 x7; lemma_div264_x8 x8 }
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 +
pow2 16 * (v x9 % pow2 40) * pow2 224;
(==) { lemma_div264_x9 x9 }
v x4 / pow2 40 + v x5 * pow2 16 + v x6 * pow2 72 + v x7 * pow2 128 + v x8 * pow2 184 + v x9 * pow2 240;
(==) { lemma_div264_aux x }
wide_as_nat5 x / pow2 264;
}
#pop-options
#pop-options // "--z3cliopt smt.arith.nl=false"
val lemma_mod_264_aux: t:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 t (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) = t in
(wide_as_nat5 t) % pow2 264 ==
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + v t4 * pow2 224) % pow2 264))
#push-options "--z3rlimit 150"
let lemma_mod_264_aux t =
let (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) = t in
let res = (t0, t1, t2, t3, t4 &. u64 0xffffffffff) in
assert_norm (pow2 16 * pow2 264 == pow2 280);
assert_norm (pow2 72 * pow2 264 == pow2 336);
assert_norm (pow2 128 * pow2 264 == pow2 392);
assert_norm (pow2 184 * pow2 264 == pow2 448);
assert_norm (pow2 240 * pow2 264 == pow2 504);
calc (==) {
(wide_as_nat5 t) % pow2 264;
(==) { }
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + v t4 * pow2 224 +
(v t5 * pow2 16 + v t6 * pow2 72 + v t7 * pow2 128 + v t8 * pow2 184 + v t9 * pow2 240) * pow2 264) % pow2 264;
(==) { FStar.Math.Lemmas.lemma_mod_add_distr (v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + v t4 * pow2 224)
((v t5 * pow2 16 + v t6 * pow2 72 + v t7 * pow2 128 + v t8 * pow2 184 + v t9 * pow2 240) * pow2 264) (pow2 264)}
((v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + v t4 * pow2 224) +
((v t5 * pow2 16 + v t6 * pow2 72 + v t7 * pow2 128 + v t8 * pow2 184 + v t9 * pow2 240) * pow2 264) % pow2 264) % pow2 264;
(==) { FStar.Math.Lemmas.cancel_mul_mod (v t5 * pow2 16 + v t6 * pow2 72 + v t7 * pow2 128 + v t8 * pow2 184 + v t9 * pow2 240) (pow2 264) }
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + v t4 * pow2 224) % pow2 264;
}
#pop-options
val lemma_as_nat_pow264: x:qelem5 ->
Lemma
(requires
(let (x0, x1, x2, x3, x4) = x in
qelem_fits5 x (1, 1, 1, 1, 1) /\
v x4 < pow2 40))
(ensures as_nat5 x < pow2 264)
let lemma_as_nat_pow264 x =
let (x0, x1, x2, x3, x4) = x in
assert_norm (pow2 40 * pow2 224 = pow2 264)
val lemma_mod_264: t:qelem_wide5 ->
Lemma
(requires
qelem_wide_fits5 t (1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
(ensures
(let (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) = t in
let res = (t0, t1, t2, t3, t4 &. u64 0xffffffffff) in
qelem_fits5 res (1, 1, 1, 1, 1) /\
as_nat5 res == (wide_as_nat5 t) % pow2 264))
let lemma_mod_264 t =
let (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) = t in
let t4' = t4 &. u64 0xffffffffff in
let res = (t0, t1, t2, t3, t4') in
assert_norm (pow2 40 < pow2 64);
assert_norm (pow2 40 - 1 == 0xffffffffff);
mod_mask_lemma t4 40ul;
assert (v (mod_mask #U64 #SEC 40ul) == 0xffffffffff);
assert (v (t4 &. u64 0xffffffffff) == v t4 % pow2 40);
calc (==) {
(wide_as_nat5 t) % pow2 264;
(==) { lemma_mod_264_aux t }
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + v t4 * pow2 224) % pow2 264;
(==) { FStar.Math.Lemmas.lemma_mod_add_distr (v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168) (v t4 * pow2 224) (pow2 264) }
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + (v t4 * pow2 224) % pow2 264) % pow2 264;
(==) { FStar.Math.Lemmas.pow2_multiplication_modulo_lemma_2 (v t4) 264 224 }
(v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + (v t4 % pow2 40) * pow2 224) % pow2 264;
(==) { lemma_as_nat_pow264 res; FStar.Math.Lemmas.modulo_lemma (as_nat5 res) (pow2 264) }
v t0 + v t1 * pow2 56 + v t2 * pow2 112 + v t3 * pow2 168 + (v t4 % pow2 40) * pow2 224;
}
val lemma_as_nat_pow264_x4: x:qelem5 ->
Lemma
(requires
qelem_fits5 x (1, 1, 1, 1, 1) /\
as_nat5 x < pow2 264)
(ensures
(let (x0, x1, x2, x3, x4) = x in
v x4 < pow2 40))
let lemma_as_nat_pow264_x4 x =
let (x0, x1, x2, x3, x4) = x in
assert_norm (pow2 40 * pow2 224 = pow2 264)
val lemma_sub_mod_264_aux:
x0:nat -> x1:nat -> x2:nat -> x3:nat -> x4:nat
-> y0:nat -> y1:nat -> y2:nat -> y3:nat -> y4:nat
-> c1:nat -> c2:nat -> c3:nat -> c4:nat -> c5:nat ->
Lemma (
x0 - y0 + c1 * pow56 +
(x1 - y1 - c1 + c2 * pow56) * pow56 +
(x2 - y2 - c2 + c3 * pow56) * pow112 +
(x3 - y3 - c3 + c4 * pow56) * pow168 +
(x4 - y4 - c4 + pow2 40 * c5) * pow224 ==
(x0 + x1 * pow2 56 + x2 * pow2 112 + x3 * pow2 168 + x4 * pow2 224) -
(y0 + y1 * pow2 56 + y2 * pow2 112 + y3 * pow2 168 + y4 * pow2 224) + c5 * pow2 264)
#push-options "--z3rlimit 50"
let lemma_sub_mod_264_aux x0 x1 x2 x3 x4 y0 y1 y2 y3 y4 b0 b1 b2 b3 b4 =
assert_norm (pow2 56 * pow2 56 = pow2 112);
assert_norm (pow2 56 * pow2 112 = pow2 168);
assert_norm (pow2 56 * pow2 168 = pow2 224);
assert_norm (pow2 40 * pow2 224 = pow2 264)
#pop-options
val lemma_sub_mod_264:
x:qelem5
-> y:qelem5
-> t:qelem5
-> c5:uint64 ->
Lemma
(requires
qelem_fits5 x (1, 1, 1, 1, 1) /\
qelem_fits5 y (1, 1, 1, 1, 1) /\
qelem_fits5 t (1, 1, 1, 1, 1) /\
as_nat5 x < pow2 264 /\
as_nat5 y < pow2 264 /\
as_nat5 t == as_nat5 x - as_nat5 y + v c5 * pow2 264 /\ v c5 <= 1 /\
(if v c5 = 0 then as_nat5 x >= as_nat5 y else as_nat5 x < as_nat5 y))
(ensures
(if as_nat5 x >= as_nat5 y then
as_nat5 t == as_nat5 x - as_nat5 y
else as_nat5 t == as_nat5 x - as_nat5 y + pow2 264))
#push-options "--z3rlimit 50"
let lemma_sub_mod_264 x y t c5 =
assert (if v c5 = 0 then as_nat5 x >= as_nat5 y else as_nat5 x < as_nat5 y);
assert (as_nat5 t == as_nat5 x - as_nat5 y + v c5 * pow2 264);
if as_nat5 x >= as_nat5 y then
assert (v c5 == 0 /\ as_nat5 t == as_nat5 x - as_nat5 y)
else
assert (v c5 == 1 /\ as_nat5 t == as_nat5 x - as_nat5 y + pow2 264)
#pop-options
let lemma_mul_qelem5 (x0 x1 x2 x3 x4 y0 y1 y2 y3 y4:nat) : Lemma
((x0 + x1 * pow2 56 + x2 * pow2 112 + x3 * pow2 168 + x4 * pow2 224) *
(y0 + y1 * pow2 56 + y2 * pow2 112 + y3 * pow2 168 + y4 * pow2 224) ==
x0 * y0 +
(x0 * y1 + x1 * y0) * pow56 +
(x0 * y2 + x1 * y1 + x2 * y0) * pow112 +
(x0 * y3 + x1 * y2 + x2 * y1 + x3 * y0) * pow168 +
(x0 * y4 + x1 * y3 + x2 * y2 + x3 * y1 + x4 * y0) * pow224 +
(x1 * y4 + x2 * y3 + x3 * y2 + x4 * y1) * pow280 +
(x2 * y4 + x3 * y3 + x4 * y2) * pow336 +
(x3 * y4 + x4 * y3) * pow392 +
(x4 * y4) * pow448)
=
assert ((x0 + x1 * pow2 56 + x2 * pow2 112 + x3 * pow2 168 + x4 * pow2 224) *
(y0 + y1 * pow2 56 + y2 * pow2 112 + y3 * pow2 168 + y4 * pow2 224) ==
x0 * y0 +
(x0 * y1 + x1 * y0) * pow56 +
(x0 * y2 + x1 * y1 + x2 * y0) * pow112 +
(x0 * y3 + x1 * y2 + x2 * y1 + x3 * y0) * pow168 +
(x0 * y4 + x1 * y3 + x2 * y2 + x3 * y1 + x4 * y0) * pow224 +
(x1 * y4 + x2 * y3 + x3 * y2 + x4 * y1) * pow280 +
(x2 * y4 + x3 * y3 + x4 * y2) * pow336 +
(x3 * y4 + x4 * y3) * pow392 +
(x4 * y4) * pow448)
by (Tactics.norm [zeta; iota; delta; primops]; int_semiring ())
val lemma_mul_5_low_264:
x1:nat -> x2:nat -> x3:nat -> x4:nat -> x5:nat ->
y1:nat -> y2:nat -> y3:nat -> y4:nat -> y5:nat ->
Lemma (
(x1 * y1) >= 0
/\ (x2 * y1 + x1 * y2 + ((x1 * y1) / pow2 56)) >= 0
/\ (x3 * y1 + x2 * y2 + x1 * y3 + ((x2 * y1 + x1 * y2 + ((x1 * y1) / pow2 56)) / pow2 56)) >= 0
/\ (x4 * y1 + x3 * y2 + x2 * y3 + x1 * y4 + ((x3 * y1 + x2 * y2 + x1 * y3 + ((x2 * y1 + x1 * y2 + ((x1 * y1) / pow2 56)) / pow2 56)) / pow2 56)) >= 0
/\ (
let a0 = (x1 * y1) % pow2 56 in
let a1 = ((x2 * y1 + x1 * y2 + ((x1 * y1) / pow2 56)) % pow2 56) in
let a2 = ((x3 * y1 + x2 * y2 + x1 * y3 + ((x2 * y1 + x1 * y2 + ((x1 * y1) / pow2 56)) / pow2 56)) % pow2 56) in
let a3 = ((x4 * y1 + x3 * y2 + x2 * y3 + x1 * y4 + ((x3 * y1 + x2 * y2 + x1 * y3 + ((x2 * y1 + x1 * y2 + ((x1 * y1) / pow2 56)) / pow2 56)) / pow2 56)) % pow2 56) in
let a4 = (x5 * y1 + x4 * y2 + x3 * y3 + x2 * y4 + x1 * y5 + ((x4 * y1 + x3 * y2 + x2 * y3 + x1 * y4 + ((x3 * y1 + x2 * y2 + x1 * y3 + ((x2 * y1 + x1 * y2 + ((x1 * y1) / pow2 56)) / pow2 56)) / pow2 56)) / pow2 56)) in
((x1 + pow2 56 * x2 + pow2 112 * x3 + pow2 168 * x4 + pow2 224 * x5)
* (y1 + pow2 56 * y2 + pow2 112 * y3 + pow2 168 * y4 + pow2 224 * y5)) % pow2 264
== a0 + pow2 56 * a1 + pow2 112 * a2 + pow2 168 * a3 + pow2 224 * (a4 % pow2 40)))
private let lemma_mul_nat_is_nat (a:nat) (b:nat) : Lemma (a*b >= 0) = ()
private let lemma_div_nat_is_nat (a:nat) (b:pos) : Lemma (a/b >= 0) = ()
private
val lemma_mul_5''':
x1:nat -> x2:nat -> x3:nat -> x4:nat -> x5:nat ->
y1:nat -> y2:nat -> y3:nat -> y4:nat -> y5:nat ->
Lemma (((x1 + pow2 56 * x2 + pow2 112 * x3 + pow2 168 * x4 + pow2 224 * x5)
* (y1 + pow2 56 * y2 + pow2 112 * y3 + pow2 168 * y4 + pow2 224 * y5)) % pow2 264
==
(x1 * y1
+ pow2 56 * (x2 * y1 + x1 * y2)
+ pow2 112 * (x3 * y1 + x2 * y2 + x1 * y3)
+ pow2 168 * (x4 * y1 + x3 * y2 + x2 * y3 + x1 * y4)
+ pow2 224 * (x5 * y1 + x4 * y2 + x3 * y3 + x2 * y4 + x1 * y5)) % pow2 264)
let lemma_mul_5''' x1 x2 x3 x4 x5 y1 y2 y3 y4 y5 =
calc (==) {
((x1 + pow2 56 * x2 + pow2 112 * x3 + pow2 168 * x4 + pow2 224 * x5)
* (y1 + pow2 56 * y2 + pow2 112 * y3 + pow2 168 * y4 + pow2 224 * y5)) % pow2 264;
(==) { _ by (Tactics.mapply (`feq #int #int (fun x -> x % pow2 264));
Tactics.norm [zeta; iota; delta; primops];
int_semiring ()) }
(x1 * y1
+ pow2 56 * (x2 * y1 + x1 * y2)
+ pow2 112 * (x3 * y1 + x2 * y2 + x1 * y3)
+ pow2 168 * (x4 * y1 + x3 * y2 + x2 * y3 + x1 * y4)
+ pow2 224 * (x5 * y1 + x4 * y2 + x3 * y3 + x2 * y4 + x1 * y5)
+ (pow2 16 * x2 * y5 +
pow2 16 * x3 * y4 + pow2 72 * x3 * y5 +
pow2 16 * x4 * y3 + pow2 72 * x4 * y4 + pow2 128 * x4 * y5 +
pow2 16 * x5 * y2 + pow2 72 * x5 * y3 + pow2 128 * x5 * y4 + pow2 184 * x5 * y5) * pow2 264) % pow2 264;
(==) { _ by (Tactics.mapply (`eq_eq2); Tactics.mapply (`Math.Lemmas.lemma_mod_plus)) }
(x1 * y1
+ pow2 56 * (x2 * y1 + x1 * y2)
+ pow2 112 * (x3 * y1 + x2 * y2 + x1 * y3)
+ pow2 168 * (x4 * y1 + x3 * y2 + x2 * y3 + x1 * y4)
+ pow2 224 * (x5 * y1 + x4 * y2 + x3 * y3 + x2 * y4 + x1 * y5)) % pow2 264;
}
private val lemma_mod_264'':
a0:nat -> a1:nat-> a2:nat -> a3:nat -> a4:nat ->
Lemma
(requires a0 < pow56 /\ a1 < pow56 /\ a2 < pow56 /\ a3 < pow56)
(ensures a0 + pow2 56 * a1 + pow2 112 * a2 + pow2 168 * a3 + pow2 224 * (a4 % pow2 40) < pow2 264)
let lemma_mod_264'' a0 a1 a2 a3 a4 =
assert_norm(pow2 40 = 0x10000000000);
assert_norm(pow2 56 = 0x100000000000000);
assert_norm(pow2 112 = 0x10000000000000000000000000000);
assert_norm(pow2 168 = 0x1000000000000000000000000000000000000000000);
assert_norm(pow2 224 = 0x100000000000000000000000000000000000000000000000000000000);
assert_norm(pow2 264 = 0x1000000000000000000000000000000000000000000000000000000000000000000)
private val lemma_mod_264':
a0:nat -> a1:nat-> a2:nat -> a3:nat -> a4:nat ->
Lemma
(requires a0 < pow56 /\ a1 < pow56 /\ a2 < pow56 /\ a3 < pow56)
(ensures (a0
+ pow2 56 * a1
+ pow2 112 * a2
+ pow2 168 * a3
+ pow2 224 * a4) % pow2 264 =
a0
+ pow2 56 * a1
+ pow2 112 * a2
+ pow2 168 * a3
+ pow2 224 * (a4 % pow2 40) )
let lemma_mod_264' a0 a1 a2 a3 a4 =
assert_norm(pow2 56 = 0x100000000000000);
assert_norm(pow2 112 = 0x10000000000000000000000000000);
assert_norm(pow2 168 = 0x1000000000000000000000000000000000000000000);
assert_norm(pow2 224 = 0x100000000000000000000000000000000000000000000000000000000);
Math.Lemmas.lemma_mod_plus_distr_l (pow2 224 * a4) (a0 + pow2 56 * a1 + pow2 112 * a2 + pow2 168 * a3) (pow2 264);
Math.Lemmas.pow2_multiplication_modulo_lemma_2 a4 264 224;
lemma_mod_264'' a0 a1 a2 a3 a4;
Math.Lemmas.modulo_lemma (a0 + pow2 56 * a1 + pow2 112 * a2 + pow2 168 * a3 + pow2 224 * (a4 % pow2 40)) (pow2 264)
private let lemma_aux_0 (a:nat) (b:nat) (n:nat) : Lemma
(pow2 n * a + pow2 (n+56) * b = pow2 n * (a % pow2 56) + pow2 (n+56) * (b + a / pow2 56))
= Math.Lemmas.lemma_div_mod a (pow2 56);
Math.Lemmas.pow2_plus n 56;
assert(a = pow2 56 * (a / pow2 56) + (a % pow2 56));
Math.Lemmas.distributivity_add_right (pow2 n) (pow2 56 * (a / pow2 56)) (a % pow2 56);
Math.Lemmas.paren_mul_right (pow2 n) (pow2 56) (a / pow2 56);
Math.Lemmas.distributivity_add_right (pow2 (n+56)) b (a / pow2 56)
private
val lemma_mod_264_small:
a0:nat -> a1:nat -> a2:nat -> a3:nat -> a4:nat ->
Lemma ( (a0 + pow2 56 * a1 + pow2 112 * a2 + pow2 168 * a3 + pow2 224 * a4)
= (a0 % pow2 56)
+ pow2 56 * ((a1 + (a0 / pow2 56)) % pow2 56)
+ pow2 112 * ((a2 + ((a1 + (a0 / pow2 56)) / pow2 56)) % pow2 56)
+ pow2 168 * ((a3 + ((a2 + ((a1 + (a0 / pow2 56)) / pow2 56)) / pow2 56)) % pow2 56)
+ pow2 224 * (a4 + ((a3 + ((a2 + ((a1 + (a0 / pow2 56)) / pow2 56)) / pow2 56)) / pow2 56)))
(* These silly lemmas needed to guide the proof below... *)
private let aux_nat_over_pos (p : nat) (q : pos) : Lemma (p / q >= 0) = ()
private let aux_nat_plus_nat (p : nat) (q : nat) : Lemma (p + q >= 0) = ()
let lemma_mod_264_small a0 a1 a2 a3 a4 =
Math.Lemmas.lemma_div_mod a0 (pow2 56);
Math.Lemmas.distributivity_add_right (pow2 56) a1 (a0 / pow2 56);
(**) aux_nat_over_pos a0 (pow2 56);
(**) aux_nat_plus_nat a1 (a0 / pow2 56);
let a1':nat = (a1 + (a0 / pow2 56)) in
(**) aux_nat_over_pos a1' (pow2 56);
(**) aux_nat_plus_nat a2 (a1' / pow2 56);
let a2':nat = (a2 + (a1' / pow2 56)) in
(**) aux_nat_over_pos a2' (pow2 56);
(**) aux_nat_plus_nat a3 (a2' / pow2 56);
let a3':nat = (a3 + (a2' / pow2 56)) in
lemma_aux_0 a1' a2 56;
lemma_aux_0 a2' a3 112;
lemma_aux_0 a3' a4 168
private
val lemma_mod_264_:
a0:nat -> a1:nat -> a2:nat -> a3:nat -> a4:nat ->
Lemma ((a0 + pow2 56 * a1 + pow2 112 * a2 + pow2 168 * a3 + pow2 224 * a4) % pow2 264 =
(a0 % pow2 56)
+ pow2 56 * ((a1 + (a0 / pow2 56)) % pow2 56)
+ pow2 112 * ((a2 + ((a1 + (a0 / pow2 56)) / pow2 56)) % pow2 56)
+ pow2 168 * ((a3 + ((a2 + ((a1 + (a0 / pow2 56)) / pow2 56)) / pow2 56)) % pow2 56)
+ pow2 224 * ((a4 + ((a3 + ((a2 + ((a1 + (a0 / pow2 56)) / pow2 56)) / pow2 56)) / pow2 56)) % pow2 40))
let lemma_mod_264_ a0 a1 a2 a3 a4 =
lemma_mod_264_small a0 a1 a2 a3 a4;
let x0 = a0 % pow2 56 in
assert (x0 < pow56);
let x1 = ((a1 + (a0 / pow2 56)) % pow2 56) in
assert (x1 < pow56);
let x2 = ((a2 + ((a1 + (a0 / pow2 56)) / pow2 56)) % pow2 56) in
assert (x2 < pow56);
let x3 = ((a3 + ((a2 + ((a1 + (a0 / pow2 56)) / pow2 56)) / pow2 56)) % pow2 56) in
assert (x3 < pow56);
lemma_mod_264' x0 x1 x2 x3 (a4 + ((a3 + ((a2 + ((a1 + (a0 / pow2 56)) / pow2 56)) / pow2 56)) / pow2 56))
#push-options "--z3rlimit 50"
let lemma_mul_5_low_264 x1 x2 x3 x4 x5 y1 y2 y3 y4 y5 =
lemma_div_nat_is_nat (x1 * y1) (pow2 56);
lemma_div_nat_is_nat (x2 * y1 + x1 * y2 + ((x1 * y1) / pow2 56)) (pow2 56);
lemma_div_nat_is_nat (x3 * y1 + x2 * y2 + x1 * y3 + ((x2 * y1 + x1 * y2 + ((x1 * y1) / pow2 56)) / pow2 56)) (pow2 56);
lemma_div_nat_is_nat (x4 * y1 + x3 * y2 + x2 * y3 + x1 * y4 + ((x3 * y1 + x2 * y2 + x1 * y3 + ((x2 * y1 + x1 * y2 + ((x1 * y1) / pow2 56)) / pow2 56)) / pow2 56)) (pow2 56);
lemma_mul_5''' x1 x2 x3 x4 x5 y1 y2 y3 y4 y5;
lemma_mod_264_ (x1 * y1) (x2 * y1 + x1 * y2) (x3 * y1 + x2 * y2 + x1 * y3) (x4 * y1 + x3 * y2 + x2 * y3 + x1 * y4) (x5 * y1 + x4 * y2 + x3 * y3 + x2 * y4 + x1 * y5)
#pop-options
private
val lemma_optimized_barrett_reduce:
a:nat{a < pow2 512} ->
Lemma (a - (((a / pow2 248) * (pow2 512 / S.q)) / pow2 264) * S.q < 2 * S.q
/\ a - (((a / pow2 248) * (pow2 512 / S.q)) / pow2 264) * S.q >= 0)
#push-options "--z3rlimit 50"
let lemma_optimized_barrett_reduce a =
assert_norm (pow2 248 = 0x100000000000000000000000000000000000000000000000000000000000000);
assert_norm (pow2 264 = 0x1000000000000000000000000000000000000000000000000000000000000000000);
assert_norm (S.q == 0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed);
assert_norm (0x100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 == pow2 512)
#pop-options
private
val lemma_optimized_barrett_reduce2:
a:nat{a < pow2 512} ->
Lemma (a - ((a * (pow2 512 / S.q)) / pow2 512) * S.q < pow2 264 /\
a - ((a * (pow2 512 / S.q)) / pow2 512) * S.q >= 0)
#push-options "--z3rlimit 50"
let lemma_optimized_barrett_reduce2 a =
assert_norm (pow2 248 = 0x100000000000000000000000000000000000000000000000000000000000000);
assert_norm (pow2 264 = 0x1000000000000000000000000000000000000000000000000000000000000000000);
assert_norm (S.q == 0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed);
assert_norm (0x100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 == pow2 512)
#pop-options
#push-options "--fuel 0 --z3cliopt smt.arith.nl=true --smtencoding.elim_box true --smtencoding.l_arith_repr native --smtencoding.nl_arith_repr native --z3rlimit 30"
private
let lemma_0 (x:nat) (y:nat) (c:pos) : Lemma
(requires (x >= y /\ x - y < c))
(ensures (x / c - y / c <= 1))
= if x / c - y / c > 1 then (
Math.Lemmas.lemma_div_mod x c;
Math.Lemmas.lemma_div_mod y c;
Math.Lemmas.distributivity_sub_right c (x / c) (y / c);
Math.Lemmas.lemma_div_mod (x-y) c;
Math.Lemmas.small_div (x-y) c;
Math.Lemmas.swap_mul c (x/c - y/c);
Math.Lemmas.cancel_mul_div (x/c - y/c) c
)
#pop-options
#push-options "--z3rlimit 30"
private
let lemma_1 (x:nat) (y:nat) (c:pos) : Lemma
(requires (x - y < c /\ x >= y))
(ensures (x - y = (if (x % c) - (y % c) < 0 then c + (x % c) - (y % c)
else (x % c) - (y % c))))
= Math.Lemmas.lemma_div_mod x c;
Math.Lemmas.lemma_div_mod y c;
Math.Lemmas.distributivity_sub_right c (y/c) (x/c);
assert( (x%c) - (y%c) = x - y - c*((x/c) - (y/c)));
lemma_0 x y c
#pop-options
val lemma_barrett_reduce':
x:nat{x < pow2 512} ->
Lemma (let r = x % pow2 264 in
let qml = (((((x / pow2 248) * (pow2 512 / S.q)) / pow2 264) * S.q) % pow2 264) in
let u = if r < qml then pow2 264 + r - qml else r - qml in
let z = if u < S.q then u else u - S.q in
z = x % S.q) | {
"checked_file": "/",
"dependencies": [
"Spec.Ed25519.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.BignumQ.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.CanonCommSemiring.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.BignumQ.Lemmas.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommSemiring",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.Ed25519",
"short_module": "S"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.CanonCommSemiring",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.BignumQ",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | u550: Prims.nat -> z: Prims.nat -> x: Prims.nat -> q: Prims.nat
-> FStar.Pervasives.Lemma
(requires
u550 < 2 * Spec.Ed25519.q /\ u550 = x - q * Spec.Ed25519.q /\
z ==
(match u550 < Spec.Ed25519.q with
| true -> u550
| _ -> u550 - Spec.Ed25519.q)) (ensures z == x % Spec.Ed25519.q) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.nat",
"Prims.op_GreaterThanOrEqual",
"Spec.Ed25519.q",
"FStar.Calc.calc_finish",
"Prims.eq2",
"Prims.op_Modulus",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"Prims.op_Subtraction",
"FStar.Mul.op_Star",
"Prims.op_Addition",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"FStar.Math.Lemmas.small_mod",
"Prims.squash",
"FStar.Pervasives.assert_norm",
"Prims.int",
"FStar.Math.Lemmas.distributivity_add_left",
"FStar.Math.Lemmas.lemma_mod_sub",
"Prims.bool",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.op_Equality",
"FStar.Pervasives.pattern"
] | [] | false | false | true | false | false | let lemma_barrett_reduce'' (u z x q: nat)
: Lemma (requires u < 2 * S.q /\ u = x - q * S.q /\ z == (if u < S.q then u else u - S.q))
(ensures z == x % S.q) =
| if u >= S.q
then
(calc ( == ) {
z;
( == ) { Math.Lemmas.small_mod z S.q }
(u - S.q) % S.q;
( == ) { () }
(x - (q * S.q + S.q)) % S.q;
( == ) { (Math.Lemmas.distributivity_add_left q 1 S.q;
assert_norm (1 * S.q == S.q)) }
(x - (q + 1) * S.q) % S.q;
( == ) { Math.Lemmas.lemma_mod_sub x S.q (q + 1) }
x % S.q;
})
else
(calc ( == ) {
z;
( == ) { Math.Lemmas.small_mod z S.q }
u % S.q;
( == ) { () }
(x - (q * S.q)) % S.q;
( == ) { Math.Lemmas.lemma_mod_sub x S.q q }
x % S.q;
}) | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.finv | val finv: f:S.felem -> S.felem | val finv: f:S.felem -> S.felem | let finv f =
let x2 = S.fmul (fsquare_times f 1) f in
let x3 = S.fmul (fsquare_times x2 1) f in
let x6 = S.fmul (fsquare_times x3 3) x3 in
let x12 = S.fmul (fsquare_times x6 6) x6 in
let x15 = S.fmul (fsquare_times x12 3) x3 in
let x30 = S.fmul (fsquare_times x15 15) x15 in
let x32 = S.fmul (fsquare_times x30 2) x2 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x192 = S.fmul (fsquare_times x64 128) x32 in
let x224 = S.fmul (fsquare_times x192 32) x32 in
let x254 = S.fmul (fsquare_times x224 30) x30 in
let x256 = S.fmul (fsquare_times x254 2) f in
x256 | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 6,
"end_line": 66,
"start_col": 0,
"start_line": 53
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime
let mk_to_nat_mod_comm_monoid : SE.to_comm_monoid S.felem = {
SE.a_spec = S.felem;
SE.comm_monoid = nat_mod_comm_monoid;
SE.refl = (fun (x:S.felem) -> x);
}
val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid
let one_mod _ = 1
val mul_mod : SE.mul_st S.felem mk_to_nat_mod_comm_monoid
let mul_mod x y = S.fmul x y
val sqr_mod : SE.sqr_st S.felem mk_to_nat_mod_comm_monoid
let sqr_mod x = S.fmul x x
let mk_nat_mod_concrete_ops : SE.concrete_ops S.felem = {
SE.to = mk_to_nat_mod_comm_monoid;
SE.one = one_mod;
SE.mul = mul_mod;
SE.sqr = sqr_mod;
}
let fsquare_times (a:S.felem) (b:nat) : S.felem =
SE.exp_pow2 mk_nat_mod_concrete_ops a b
val fsquare_times_lemma: a:S.felem -> b:nat ->
Lemma (fsquare_times a b == M.pow a (pow2 b) % S.prime)
let fsquare_times_lemma a b =
SE.exp_pow2_lemma mk_nat_mod_concrete_ops a b;
LE.exp_pow2_lemma nat_mod_comm_monoid a b;
assert (fsquare_times a b == LE.pow nat_mod_comm_monoid a (pow2 b));
M.lemma_pow_nat_mod_is_pow #S.prime a (pow2 b)
(**
The algorithm is taken from
https://briansmith.org/ecc-inversion-addition-chains-01
*) | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: Spec.P256.PointOps.felem -> Spec.P256.PointOps.felem | Prims.Tot | [
"total"
] | [] | [
"Spec.P256.PointOps.felem",
"Spec.P256.PointOps.fmul",
"Hacl.Spec.P256.Finv.fsquare_times"
] | [] | false | false | false | true | false | let finv f =
| let x2 = S.fmul (fsquare_times f 1) f in
let x3 = S.fmul (fsquare_times x2 1) f in
let x6 = S.fmul (fsquare_times x3 3) x3 in
let x12 = S.fmul (fsquare_times x6 6) x6 in
let x15 = S.fmul (fsquare_times x12 3) x3 in
let x30 = S.fmul (fsquare_times x15 15) x15 in
let x32 = S.fmul (fsquare_times x30 2) x2 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x192 = S.fmul (fsquare_times x64 128) x32 in
let x224 = S.fmul (fsquare_times x192 32) x32 in
let x254 = S.fmul (fsquare_times x224 30) x30 in
let x256 = S.fmul (fsquare_times x254 2) f in
x256 | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.fsqrt | val fsqrt: f:S.felem -> S.felem | val fsqrt: f:S.felem -> S.felem | let fsqrt f =
let x2 = S.fmul (fsquare_times f 1) f in
let x4 = S.fmul (fsquare_times x2 2) x2 in
let x8 = S.fmul (fsquare_times x4 4) x4 in
let x16 = S.fmul (fsquare_times x8 8) x8 in
let x32 = S.fmul (fsquare_times x16 16) x16 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x160 = S.fmul (fsquare_times x64 96) f in
let x254 = fsquare_times x160 94 in
x254 | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 6,
"end_line": 79,
"start_col": 0,
"start_line": 70
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime
let mk_to_nat_mod_comm_monoid : SE.to_comm_monoid S.felem = {
SE.a_spec = S.felem;
SE.comm_monoid = nat_mod_comm_monoid;
SE.refl = (fun (x:S.felem) -> x);
}
val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid
let one_mod _ = 1
val mul_mod : SE.mul_st S.felem mk_to_nat_mod_comm_monoid
let mul_mod x y = S.fmul x y
val sqr_mod : SE.sqr_st S.felem mk_to_nat_mod_comm_monoid
let sqr_mod x = S.fmul x x
let mk_nat_mod_concrete_ops : SE.concrete_ops S.felem = {
SE.to = mk_to_nat_mod_comm_monoid;
SE.one = one_mod;
SE.mul = mul_mod;
SE.sqr = sqr_mod;
}
let fsquare_times (a:S.felem) (b:nat) : S.felem =
SE.exp_pow2 mk_nat_mod_concrete_ops a b
val fsquare_times_lemma: a:S.felem -> b:nat ->
Lemma (fsquare_times a b == M.pow a (pow2 b) % S.prime)
let fsquare_times_lemma a b =
SE.exp_pow2_lemma mk_nat_mod_concrete_ops a b;
LE.exp_pow2_lemma nat_mod_comm_monoid a b;
assert (fsquare_times a b == LE.pow nat_mod_comm_monoid a (pow2 b));
M.lemma_pow_nat_mod_is_pow #S.prime a (pow2 b)
(**
The algorithm is taken from
https://briansmith.org/ecc-inversion-addition-chains-01
*)
val finv: f:S.felem -> S.felem
let finv f =
let x2 = S.fmul (fsquare_times f 1) f in
let x3 = S.fmul (fsquare_times x2 1) f in
let x6 = S.fmul (fsquare_times x3 3) x3 in
let x12 = S.fmul (fsquare_times x6 6) x6 in
let x15 = S.fmul (fsquare_times x12 3) x3 in
let x30 = S.fmul (fsquare_times x15 15) x15 in
let x32 = S.fmul (fsquare_times x30 2) x2 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x192 = S.fmul (fsquare_times x64 128) x32 in
let x224 = S.fmul (fsquare_times x192 32) x32 in
let x254 = S.fmul (fsquare_times x224 30) x30 in
let x256 = S.fmul (fsquare_times x254 2) f in
x256 | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: Spec.P256.PointOps.felem -> Spec.P256.PointOps.felem | Prims.Tot | [
"total"
] | [] | [
"Spec.P256.PointOps.felem",
"Hacl.Spec.P256.Finv.fsquare_times",
"Spec.P256.PointOps.fmul"
] | [] | false | false | false | true | false | let fsqrt f =
| let x2 = S.fmul (fsquare_times f 1) f in
let x4 = S.fmul (fsquare_times x2 2) x2 in
let x8 = S.fmul (fsquare_times x4 4) x4 in
let x16 = S.fmul (fsquare_times x8 8) x8 in
let x32 = S.fmul (fsquare_times x16 16) x16 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x160 = S.fmul (fsquare_times x64 96) f in
let x254 = fsquare_times x160 94 in
x254 | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.mul_mod | val mul_mod : SE.mul_st S.felem mk_to_nat_mod_comm_monoid | val mul_mod : SE.mul_st S.felem mk_to_nat_mod_comm_monoid | let mul_mod x y = S.fmul x y | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 28,
"end_line": 24,
"start_col": 0,
"start_line": 24
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime
let mk_to_nat_mod_comm_monoid : SE.to_comm_monoid S.felem = {
SE.a_spec = S.felem;
SE.comm_monoid = nat_mod_comm_monoid;
SE.refl = (fun (x:S.felem) -> x);
}
val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid
let one_mod _ = 1 | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Spec.Exponentiation.mul_st Spec.P256.PointOps.felem Hacl.Spec.P256.Finv.mk_to_nat_mod_comm_monoid | Prims.Tot | [
"total"
] | [] | [
"Spec.P256.PointOps.felem",
"Spec.P256.PointOps.fmul"
] | [] | false | false | false | true | false | let mul_mod x y =
| S.fmul x y | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.one_mod | val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid | val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid | let one_mod _ = 1 | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 17,
"end_line": 21,
"start_col": 0,
"start_line": 21
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime
let mk_to_nat_mod_comm_monoid : SE.to_comm_monoid S.felem = {
SE.a_spec = S.felem;
SE.comm_monoid = nat_mod_comm_monoid;
SE.refl = (fun (x:S.felem) -> x);
} | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Spec.Exponentiation.one_st Spec.P256.PointOps.felem Hacl.Spec.P256.Finv.mk_to_nat_mod_comm_monoid | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Spec.P256.PointOps.felem"
] | [] | false | false | false | true | false | let one_mod _ =
| 1 | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.sqr_mod | val sqr_mod : SE.sqr_st S.felem mk_to_nat_mod_comm_monoid | val sqr_mod : SE.sqr_st S.felem mk_to_nat_mod_comm_monoid | let sqr_mod x = S.fmul x x | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 26,
"end_line": 27,
"start_col": 0,
"start_line": 27
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime
let mk_to_nat_mod_comm_monoid : SE.to_comm_monoid S.felem = {
SE.a_spec = S.felem;
SE.comm_monoid = nat_mod_comm_monoid;
SE.refl = (fun (x:S.felem) -> x);
}
val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid
let one_mod _ = 1
val mul_mod : SE.mul_st S.felem mk_to_nat_mod_comm_monoid
let mul_mod x y = S.fmul x y | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Spec.Exponentiation.sqr_st Spec.P256.PointOps.felem Hacl.Spec.P256.Finv.mk_to_nat_mod_comm_monoid | Prims.Tot | [
"total"
] | [] | [
"Spec.P256.PointOps.felem",
"Spec.P256.PointOps.fmul"
] | [] | false | false | false | true | false | let sqr_mod x =
| S.fmul x x | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.fsquare_times_lemma | val fsquare_times_lemma: a:S.felem -> b:nat ->
Lemma (fsquare_times a b == M.pow a (pow2 b) % S.prime) | val fsquare_times_lemma: a:S.felem -> b:nat ->
Lemma (fsquare_times a b == M.pow a (pow2 b) % S.prime) | let fsquare_times_lemma a b =
SE.exp_pow2_lemma mk_nat_mod_concrete_ops a b;
LE.exp_pow2_lemma nat_mod_comm_monoid a b;
assert (fsquare_times a b == LE.pow nat_mod_comm_monoid a (pow2 b));
M.lemma_pow_nat_mod_is_pow #S.prime a (pow2 b) | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 48,
"end_line": 45,
"start_col": 0,
"start_line": 41
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime
let mk_to_nat_mod_comm_monoid : SE.to_comm_monoid S.felem = {
SE.a_spec = S.felem;
SE.comm_monoid = nat_mod_comm_monoid;
SE.refl = (fun (x:S.felem) -> x);
}
val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid
let one_mod _ = 1
val mul_mod : SE.mul_st S.felem mk_to_nat_mod_comm_monoid
let mul_mod x y = S.fmul x y
val sqr_mod : SE.sqr_st S.felem mk_to_nat_mod_comm_monoid
let sqr_mod x = S.fmul x x
let mk_nat_mod_concrete_ops : SE.concrete_ops S.felem = {
SE.to = mk_to_nat_mod_comm_monoid;
SE.one = one_mod;
SE.mul = mul_mod;
SE.sqr = sqr_mod;
}
let fsquare_times (a:S.felem) (b:nat) : S.felem =
SE.exp_pow2 mk_nat_mod_concrete_ops a b
val fsquare_times_lemma: a:S.felem -> b:nat -> | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Spec.P256.PointOps.felem -> b: Prims.nat
-> FStar.Pervasives.Lemma
(ensures
Hacl.Spec.P256.Finv.fsquare_times a b ==
Lib.NatMod.pow a (Prims.pow2 b) % Spec.P256.PointOps.prime) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.felem",
"Prims.nat",
"Lib.NatMod.lemma_pow_nat_mod_is_pow",
"Spec.P256.PointOps.prime",
"Prims.pow2",
"Prims.unit",
"Prims._assert",
"Prims.eq2",
"Prims.l_or",
"Prims.b2t",
"Prims.op_LessThan",
"Hacl.Spec.P256.Finv.fsquare_times",
"Lib.Exponentiation.Definition.pow",
"Lib.NatMod.nat_mod",
"Hacl.Spec.P256.Finv.nat_mod_comm_monoid",
"Lib.Exponentiation.exp_pow2_lemma",
"Spec.Exponentiation.exp_pow2_lemma",
"Hacl.Spec.P256.Finv.mk_nat_mod_concrete_ops"
] | [] | true | false | true | false | false | let fsquare_times_lemma a b =
| SE.exp_pow2_lemma mk_nat_mod_concrete_ops a b;
LE.exp_pow2_lemma nat_mod_comm_monoid a b;
assert (fsquare_times a b == LE.pow nat_mod_comm_monoid a (pow2 b));
M.lemma_pow_nat_mod_is_pow #S.prime a (pow2 b) | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.lemma_pow_mod_1 | val lemma_pow_mod_1: f:S.felem -> Lemma (f == M.pow f 1 % S.prime) | val lemma_pow_mod_1: f:S.felem -> Lemma (f == M.pow f 1 % S.prime) | let lemma_pow_mod_1 f =
M.lemma_pow1 f;
Math.Lemmas.small_mod f S.prime;
assert_norm (pow2 0 = 1);
assert (f == M.pow f 1 % S.prime) | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 35,
"end_line": 88,
"start_col": 0,
"start_line": 84
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime
let mk_to_nat_mod_comm_monoid : SE.to_comm_monoid S.felem = {
SE.a_spec = S.felem;
SE.comm_monoid = nat_mod_comm_monoid;
SE.refl = (fun (x:S.felem) -> x);
}
val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid
let one_mod _ = 1
val mul_mod : SE.mul_st S.felem mk_to_nat_mod_comm_monoid
let mul_mod x y = S.fmul x y
val sqr_mod : SE.sqr_st S.felem mk_to_nat_mod_comm_monoid
let sqr_mod x = S.fmul x x
let mk_nat_mod_concrete_ops : SE.concrete_ops S.felem = {
SE.to = mk_to_nat_mod_comm_monoid;
SE.one = one_mod;
SE.mul = mul_mod;
SE.sqr = sqr_mod;
}
let fsquare_times (a:S.felem) (b:nat) : S.felem =
SE.exp_pow2 mk_nat_mod_concrete_ops a b
val fsquare_times_lemma: a:S.felem -> b:nat ->
Lemma (fsquare_times a b == M.pow a (pow2 b) % S.prime)
let fsquare_times_lemma a b =
SE.exp_pow2_lemma mk_nat_mod_concrete_ops a b;
LE.exp_pow2_lemma nat_mod_comm_monoid a b;
assert (fsquare_times a b == LE.pow nat_mod_comm_monoid a (pow2 b));
M.lemma_pow_nat_mod_is_pow #S.prime a (pow2 b)
(**
The algorithm is taken from
https://briansmith.org/ecc-inversion-addition-chains-01
*)
val finv: f:S.felem -> S.felem
let finv f =
let x2 = S.fmul (fsquare_times f 1) f in
let x3 = S.fmul (fsquare_times x2 1) f in
let x6 = S.fmul (fsquare_times x3 3) x3 in
let x12 = S.fmul (fsquare_times x6 6) x6 in
let x15 = S.fmul (fsquare_times x12 3) x3 in
let x30 = S.fmul (fsquare_times x15 15) x15 in
let x32 = S.fmul (fsquare_times x30 2) x2 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x192 = S.fmul (fsquare_times x64 128) x32 in
let x224 = S.fmul (fsquare_times x192 32) x32 in
let x254 = S.fmul (fsquare_times x224 30) x30 in
let x256 = S.fmul (fsquare_times x254 2) f in
x256
val fsqrt: f:S.felem -> S.felem
let fsqrt f =
let x2 = S.fmul (fsquare_times f 1) f in
let x4 = S.fmul (fsquare_times x2 2) x2 in
let x8 = S.fmul (fsquare_times x4 4) x4 in
let x16 = S.fmul (fsquare_times x8 8) x8 in
let x32 = S.fmul (fsquare_times x16 16) x16 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x160 = S.fmul (fsquare_times x64 96) f in
let x254 = fsquare_times x160 94 in
x254
// TODO: mv to lib/ | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: Spec.P256.PointOps.felem
-> FStar.Pervasives.Lemma (ensures f == Lib.NatMod.pow f 1 % Spec.P256.PointOps.prime) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.felem",
"Prims._assert",
"Prims.eq2",
"Prims.int",
"Prims.op_Modulus",
"Lib.NatMod.pow",
"Spec.P256.PointOps.prime",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.b2t",
"Prims.op_Equality",
"Prims.pow2",
"FStar.Math.Lemmas.small_mod",
"Lib.NatMod.lemma_pow1"
] | [] | true | false | true | false | false | let lemma_pow_mod_1 f =
| M.lemma_pow1 f;
Math.Lemmas.small_mod f S.prime;
assert_norm (pow2 0 = 1);
assert (f == M.pow f 1 % S.prime) | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.fsqrt_is_fsqrt_lemma | val fsqrt_is_fsqrt_lemma: f:S.felem -> Lemma (fsqrt f == S.fsqrt f) | val fsqrt_is_fsqrt_lemma: f:S.felem -> Lemma (fsqrt f == S.fsqrt f) | let fsqrt_is_fsqrt_lemma f =
fsqrt_lemma f;
assert (fsqrt f == M.pow f ((S.prime + 1) / 4) % S.prime);
M.lemma_pow_mod #S.prime f ((S.prime + 1) / 4) | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 48,
"end_line": 272,
"start_col": 0,
"start_line": 269
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime
let mk_to_nat_mod_comm_monoid : SE.to_comm_monoid S.felem = {
SE.a_spec = S.felem;
SE.comm_monoid = nat_mod_comm_monoid;
SE.refl = (fun (x:S.felem) -> x);
}
val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid
let one_mod _ = 1
val mul_mod : SE.mul_st S.felem mk_to_nat_mod_comm_monoid
let mul_mod x y = S.fmul x y
val sqr_mod : SE.sqr_st S.felem mk_to_nat_mod_comm_monoid
let sqr_mod x = S.fmul x x
let mk_nat_mod_concrete_ops : SE.concrete_ops S.felem = {
SE.to = mk_to_nat_mod_comm_monoid;
SE.one = one_mod;
SE.mul = mul_mod;
SE.sqr = sqr_mod;
}
let fsquare_times (a:S.felem) (b:nat) : S.felem =
SE.exp_pow2 mk_nat_mod_concrete_ops a b
val fsquare_times_lemma: a:S.felem -> b:nat ->
Lemma (fsquare_times a b == M.pow a (pow2 b) % S.prime)
let fsquare_times_lemma a b =
SE.exp_pow2_lemma mk_nat_mod_concrete_ops a b;
LE.exp_pow2_lemma nat_mod_comm_monoid a b;
assert (fsquare_times a b == LE.pow nat_mod_comm_monoid a (pow2 b));
M.lemma_pow_nat_mod_is_pow #S.prime a (pow2 b)
(**
The algorithm is taken from
https://briansmith.org/ecc-inversion-addition-chains-01
*)
val finv: f:S.felem -> S.felem
let finv f =
let x2 = S.fmul (fsquare_times f 1) f in
let x3 = S.fmul (fsquare_times x2 1) f in
let x6 = S.fmul (fsquare_times x3 3) x3 in
let x12 = S.fmul (fsquare_times x6 6) x6 in
let x15 = S.fmul (fsquare_times x12 3) x3 in
let x30 = S.fmul (fsquare_times x15 15) x15 in
let x32 = S.fmul (fsquare_times x30 2) x2 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x192 = S.fmul (fsquare_times x64 128) x32 in
let x224 = S.fmul (fsquare_times x192 32) x32 in
let x254 = S.fmul (fsquare_times x224 30) x30 in
let x256 = S.fmul (fsquare_times x254 2) f in
x256
val fsqrt: f:S.felem -> S.felem
let fsqrt f =
let x2 = S.fmul (fsquare_times f 1) f in
let x4 = S.fmul (fsquare_times x2 2) x2 in
let x8 = S.fmul (fsquare_times x4 4) x4 in
let x16 = S.fmul (fsquare_times x8 8) x8 in
let x32 = S.fmul (fsquare_times x16 16) x16 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x160 = S.fmul (fsquare_times x64 96) f in
let x254 = fsquare_times x160 94 in
x254
// TODO: mv to lib/
val lemma_pow_mod_1: f:S.felem -> Lemma (f == M.pow f 1 % S.prime)
let lemma_pow_mod_1 f =
M.lemma_pow1 f;
Math.Lemmas.small_mod f S.prime;
assert_norm (pow2 0 = 1);
assert (f == M.pow f 1 % S.prime)
val lemma_pow_mod_mul: f:S.felem -> a:nat -> b:nat ->
Lemma (S.fmul (M.pow f a % S.prime) (M.pow f b % S.prime) == M.pow f (a + b) % S.prime)
let lemma_pow_mod_mul f a b =
calc (==) {
S.fmul (M.pow f a % S.prime) (M.pow f b % S.prime);
(==) {
Math.Lemmas.lemma_mod_mul_distr_l (M.pow f a) (M.pow f b % S.prime) S.prime;
Math.Lemmas.lemma_mod_mul_distr_r (M.pow f a) (M.pow f b) S.prime }
M.pow f a * M.pow f b % S.prime;
(==) { M.lemma_pow_add f a b }
M.pow f (a + b) % S.prime;
}
val lemma_pow_pow_mod: f:S.felem -> a:nat -> b:nat ->
Lemma (M.pow (M.pow f a % S.prime) b % S.prime == M.pow f (a * b) % S.prime)
let lemma_pow_pow_mod f a b =
calc (==) {
M.pow (M.pow f a % S.prime) b % S.prime;
(==) { M.lemma_pow_mod_base (M.pow f a) b S.prime }
M.pow (M.pow f a) b % S.prime;
(==) { M.lemma_pow_mul f a b }
M.pow f (a * b) % S.prime;
}
val lemma_pow_pow_mod_mul: f:S.felem -> a:nat -> b:nat -> c:nat ->
Lemma (S.fmul (M.pow (M.pow f a % S.prime) b % S.prime) (M.pow f c % S.prime) == M.pow f (a * b + c) % S.prime)
let lemma_pow_pow_mod_mul f a b c =
calc (==) {
S.fmul (M.pow (M.pow f a % S.prime) b % S.prime) (M.pow f c % S.prime);
(==) { lemma_pow_pow_mod f a b }
S.fmul (M.pow f (a * b) % S.prime) (M.pow f c % S.prime);
(==) { lemma_pow_mod_mul f (a * b) c }
M.pow f (a * b + c) % S.prime;
}
//////////////////////////////
// prime - 2 = 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffd
val finv_lemma: f:S.felem -> Lemma (finv f == M.pow f (S.prime - 2) % S.prime)
let finv_lemma f =
let x2 = S.fmul (fsquare_times f 1) f in
fsquare_times_lemma f 1;
assert_norm (pow2 1 = 0x2);
lemma_pow_mod_1 f;
lemma_pow_mod_mul f 0x2 0x1;
assert (x2 == M.pow f 0x3 % S.prime);
let x3 = S.fmul (fsquare_times x2 1) f in
fsquare_times_lemma x2 1;
lemma_pow_mod_1 f;
lemma_pow_pow_mod_mul f 0x3 0x2 0x1;
assert (x3 == M.pow f 0x7 % S.prime);
let x6 = S.fmul (fsquare_times x3 3) x3 in
fsquare_times_lemma x3 3;
assert_norm (pow2 3 = 8);
lemma_pow_pow_mod_mul f 0x7 0x8 0x7;
assert (x6 == M.pow f 0x3f % S.prime);
let x12 = S.fmul (fsquare_times x6 6) x6 in
fsquare_times_lemma x6 6;
assert_norm (pow2 6 = 64);
lemma_pow_pow_mod_mul f 0x3f 0x40 0x3f;
assert (x12 == M.pow f 0xfff % S.prime);
let x15 = S.fmul (fsquare_times x12 3) x3 in
fsquare_times_lemma x12 3;
lemma_pow_pow_mod_mul f 0xfff 0x8 0x7;
assert (x15 == M.pow f 0x7fff % S.prime);
let x30 = S.fmul (fsquare_times x15 15) x15 in
fsquare_times_lemma x15 15;
assert_norm (pow2 15 = 0x8000);
lemma_pow_pow_mod_mul f 0x7fff 0x8000 0x7fff;
assert (x30 == M.pow f 0x3fffffff % S.prime);
let x32 = S.fmul (fsquare_times x30 2) x2 in
fsquare_times_lemma x30 2;
assert_norm (pow2 2 = 4);
lemma_pow_pow_mod_mul f 0x3fffffff 0x4 0x3;
assert (x32 == M.pow f 0xffffffff % S.prime);
let x64 = S.fmul (fsquare_times x32 32) f in
fsquare_times_lemma x32 32;
assert_norm (pow2 32 = 0x100000000);
lemma_pow_pow_mod_mul f 0xffffffff 0x100000000 0x1;
assert (x64 == M.pow f 0xffffffff00000001 % S.prime);
let x192 = S.fmul (fsquare_times x64 128) x32 in
fsquare_times_lemma x64 128;
assert_norm (pow2 128 = 0x100000000000000000000000000000000);
lemma_pow_pow_mod_mul f 0xffffffff00000001 0x100000000000000000000000000000000 0xffffffff;
assert (x192 == M.pow f 0xffffffff00000001000000000000000000000000ffffffff % S.prime);
let x224 = S.fmul (fsquare_times x192 32) x32 in
fsquare_times_lemma x192 32;
lemma_pow_pow_mod_mul f 0xffffffff00000001000000000000000000000000ffffffff 0x100000000 0xffffffff;
assert (x224 == M.pow f 0xffffffff00000001000000000000000000000000ffffffffffffffff % S.prime);
let x254 = S.fmul (fsquare_times x224 30) x30 in
fsquare_times_lemma x224 30;
assert_norm (pow2 30 = 0x40000000);
lemma_pow_pow_mod_mul f 0xffffffff00000001000000000000000000000000ffffffffffffffff 0x40000000 0x3fffffff;
assert (x254 == M.pow f 0x3fffffffc00000004000000000000000000000003fffffffffffffffffffffff % S.prime);
let x256 = S.fmul (fsquare_times x254 2) f in
fsquare_times_lemma x254 2;
lemma_pow_pow_mod_mul f 0x3fffffffc00000004000000000000000000000003fffffffffffffffffffffff 0x4 0x1;
assert (x256 == M.pow f 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffd % S.prime);
assert_norm (S.prime - 2 = 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffd)
val finv_is_finv_lemma: f:S.felem -> Lemma (finv f == S.finv f)
let finv_is_finv_lemma f =
finv_lemma f;
assert (finv f == M.pow f (S.prime - 2) % S.prime);
M.lemma_pow_mod #S.prime f (S.prime - 2)
// (prime + 1) / 4 = 0x3fffffffc0000000400000000000000000000000400000000000000000000000
val fsqrt_lemma: f:S.felem -> Lemma (fsqrt f == M.pow f ((S.prime + 1) / 4) % S.prime)
let fsqrt_lemma f =
let x2 = S.fmul (fsquare_times f 1) f in
fsquare_times_lemma f 1;
assert_norm (pow2 1 = 0x2);
lemma_pow_mod_1 f;
lemma_pow_mod_mul f 0x2 0x1;
assert (x2 == M.pow f 0x3 % S.prime);
let x4 = S.fmul (fsquare_times x2 2) x2 in
fsquare_times_lemma x2 2;
assert_norm (pow2 2 = 0x4);
lemma_pow_pow_mod_mul f 0x3 0x4 0x3;
assert (x4 == M.pow f 0xf % S.prime);
let x8 = S.fmul (fsquare_times x4 4) x4 in
fsquare_times_lemma x4 4;
assert_norm (pow2 4 = 0x10);
lemma_pow_pow_mod_mul f 0xf 0x10 0xf;
assert (x8 == M.pow f 0xff % S.prime);
let x16 = S.fmul (fsquare_times x8 8) x8 in
fsquare_times_lemma x8 8;
assert_norm (pow2 8 = 0x100);
lemma_pow_pow_mod_mul f 0xff 0x100 0xff;
assert (x16 == M.pow f 0xffff % S.prime);
let x32 = S.fmul (fsquare_times x16 16) x16 in
fsquare_times_lemma x16 16;
assert_norm (pow2 16 = 0x10000);
lemma_pow_pow_mod_mul f 0xffff 0x10000 0xffff;
assert (x32 == M.pow f 0xffffffff % S.prime);
let x64 = S.fmul (fsquare_times x32 32) f in
fsquare_times_lemma x32 32;
assert_norm (pow2 32 = 0x100000000);
lemma_pow_pow_mod_mul f 0xffffffff 0x100000000 0x1;
assert (x64 == M.pow f 0xffffffff00000001 % S.prime);
let x160 = S.fmul (fsquare_times x64 96) f in
fsquare_times_lemma x64 96;
assert_norm (pow2 96 = 0x1000000000000000000000000);
lemma_pow_pow_mod_mul f 0xffffffff00000001 0x1000000000000000000000000 0x1;
assert (x160 == M.pow f 0xffffffff00000001000000000000000000000001 % S.prime);
let x254 = fsquare_times x160 94 in
fsquare_times_lemma x160 94;
assert_norm (pow2 94 = 0x400000000000000000000000);
lemma_pow_pow_mod f 0xffffffff00000001000000000000000000000001 0x400000000000000000000000;
assert (x254 == M.pow f 0x3fffffffc0000000400000000000000000000000400000000000000000000000 % S.prime);
assert_norm ((S.prime + 1) / 4 = 0x3fffffffc0000000400000000000000000000000400000000000000000000000) | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: Spec.P256.PointOps.felem
-> FStar.Pervasives.Lemma (ensures Hacl.Spec.P256.Finv.fsqrt f == Spec.P256.PointOps.fsqrt f) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.felem",
"Lib.NatMod.lemma_pow_mod",
"Spec.P256.PointOps.prime",
"Prims.op_Division",
"Prims.op_Addition",
"Prims.unit",
"Prims._assert",
"Prims.eq2",
"Prims.int",
"Hacl.Spec.P256.Finv.fsqrt",
"Prims.op_Modulus",
"Lib.NatMod.pow",
"Hacl.Spec.P256.Finv.fsqrt_lemma"
] | [] | true | false | true | false | false | let fsqrt_is_fsqrt_lemma f =
| fsqrt_lemma f;
assert (fsqrt f == M.pow f ((S.prime + 1) / 4) % S.prime);
M.lemma_pow_mod #S.prime f ((S.prime + 1) / 4) | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.finv_is_finv_lemma | val finv_is_finv_lemma: f:S.felem -> Lemma (finv f == S.finv f) | val finv_is_finv_lemma: f:S.felem -> Lemma (finv f == S.finv f) | let finv_is_finv_lemma f =
finv_lemma f;
assert (finv f == M.pow f (S.prime - 2) % S.prime);
M.lemma_pow_mod #S.prime f (S.prime - 2) | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 42,
"end_line": 210,
"start_col": 0,
"start_line": 207
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime
let mk_to_nat_mod_comm_monoid : SE.to_comm_monoid S.felem = {
SE.a_spec = S.felem;
SE.comm_monoid = nat_mod_comm_monoid;
SE.refl = (fun (x:S.felem) -> x);
}
val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid
let one_mod _ = 1
val mul_mod : SE.mul_st S.felem mk_to_nat_mod_comm_monoid
let mul_mod x y = S.fmul x y
val sqr_mod : SE.sqr_st S.felem mk_to_nat_mod_comm_monoid
let sqr_mod x = S.fmul x x
let mk_nat_mod_concrete_ops : SE.concrete_ops S.felem = {
SE.to = mk_to_nat_mod_comm_monoid;
SE.one = one_mod;
SE.mul = mul_mod;
SE.sqr = sqr_mod;
}
let fsquare_times (a:S.felem) (b:nat) : S.felem =
SE.exp_pow2 mk_nat_mod_concrete_ops a b
val fsquare_times_lemma: a:S.felem -> b:nat ->
Lemma (fsquare_times a b == M.pow a (pow2 b) % S.prime)
let fsquare_times_lemma a b =
SE.exp_pow2_lemma mk_nat_mod_concrete_ops a b;
LE.exp_pow2_lemma nat_mod_comm_monoid a b;
assert (fsquare_times a b == LE.pow nat_mod_comm_monoid a (pow2 b));
M.lemma_pow_nat_mod_is_pow #S.prime a (pow2 b)
(**
The algorithm is taken from
https://briansmith.org/ecc-inversion-addition-chains-01
*)
val finv: f:S.felem -> S.felem
let finv f =
let x2 = S.fmul (fsquare_times f 1) f in
let x3 = S.fmul (fsquare_times x2 1) f in
let x6 = S.fmul (fsquare_times x3 3) x3 in
let x12 = S.fmul (fsquare_times x6 6) x6 in
let x15 = S.fmul (fsquare_times x12 3) x3 in
let x30 = S.fmul (fsquare_times x15 15) x15 in
let x32 = S.fmul (fsquare_times x30 2) x2 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x192 = S.fmul (fsquare_times x64 128) x32 in
let x224 = S.fmul (fsquare_times x192 32) x32 in
let x254 = S.fmul (fsquare_times x224 30) x30 in
let x256 = S.fmul (fsquare_times x254 2) f in
x256
val fsqrt: f:S.felem -> S.felem
let fsqrt f =
let x2 = S.fmul (fsquare_times f 1) f in
let x4 = S.fmul (fsquare_times x2 2) x2 in
let x8 = S.fmul (fsquare_times x4 4) x4 in
let x16 = S.fmul (fsquare_times x8 8) x8 in
let x32 = S.fmul (fsquare_times x16 16) x16 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x160 = S.fmul (fsquare_times x64 96) f in
let x254 = fsquare_times x160 94 in
x254
// TODO: mv to lib/
val lemma_pow_mod_1: f:S.felem -> Lemma (f == M.pow f 1 % S.prime)
let lemma_pow_mod_1 f =
M.lemma_pow1 f;
Math.Lemmas.small_mod f S.prime;
assert_norm (pow2 0 = 1);
assert (f == M.pow f 1 % S.prime)
val lemma_pow_mod_mul: f:S.felem -> a:nat -> b:nat ->
Lemma (S.fmul (M.pow f a % S.prime) (M.pow f b % S.prime) == M.pow f (a + b) % S.prime)
let lemma_pow_mod_mul f a b =
calc (==) {
S.fmul (M.pow f a % S.prime) (M.pow f b % S.prime);
(==) {
Math.Lemmas.lemma_mod_mul_distr_l (M.pow f a) (M.pow f b % S.prime) S.prime;
Math.Lemmas.lemma_mod_mul_distr_r (M.pow f a) (M.pow f b) S.prime }
M.pow f a * M.pow f b % S.prime;
(==) { M.lemma_pow_add f a b }
M.pow f (a + b) % S.prime;
}
val lemma_pow_pow_mod: f:S.felem -> a:nat -> b:nat ->
Lemma (M.pow (M.pow f a % S.prime) b % S.prime == M.pow f (a * b) % S.prime)
let lemma_pow_pow_mod f a b =
calc (==) {
M.pow (M.pow f a % S.prime) b % S.prime;
(==) { M.lemma_pow_mod_base (M.pow f a) b S.prime }
M.pow (M.pow f a) b % S.prime;
(==) { M.lemma_pow_mul f a b }
M.pow f (a * b) % S.prime;
}
val lemma_pow_pow_mod_mul: f:S.felem -> a:nat -> b:nat -> c:nat ->
Lemma (S.fmul (M.pow (M.pow f a % S.prime) b % S.prime) (M.pow f c % S.prime) == M.pow f (a * b + c) % S.prime)
let lemma_pow_pow_mod_mul f a b c =
calc (==) {
S.fmul (M.pow (M.pow f a % S.prime) b % S.prime) (M.pow f c % S.prime);
(==) { lemma_pow_pow_mod f a b }
S.fmul (M.pow f (a * b) % S.prime) (M.pow f c % S.prime);
(==) { lemma_pow_mod_mul f (a * b) c }
M.pow f (a * b + c) % S.prime;
}
//////////////////////////////
// prime - 2 = 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffd
val finv_lemma: f:S.felem -> Lemma (finv f == M.pow f (S.prime - 2) % S.prime)
let finv_lemma f =
let x2 = S.fmul (fsquare_times f 1) f in
fsquare_times_lemma f 1;
assert_norm (pow2 1 = 0x2);
lemma_pow_mod_1 f;
lemma_pow_mod_mul f 0x2 0x1;
assert (x2 == M.pow f 0x3 % S.prime);
let x3 = S.fmul (fsquare_times x2 1) f in
fsquare_times_lemma x2 1;
lemma_pow_mod_1 f;
lemma_pow_pow_mod_mul f 0x3 0x2 0x1;
assert (x3 == M.pow f 0x7 % S.prime);
let x6 = S.fmul (fsquare_times x3 3) x3 in
fsquare_times_lemma x3 3;
assert_norm (pow2 3 = 8);
lemma_pow_pow_mod_mul f 0x7 0x8 0x7;
assert (x6 == M.pow f 0x3f % S.prime);
let x12 = S.fmul (fsquare_times x6 6) x6 in
fsquare_times_lemma x6 6;
assert_norm (pow2 6 = 64);
lemma_pow_pow_mod_mul f 0x3f 0x40 0x3f;
assert (x12 == M.pow f 0xfff % S.prime);
let x15 = S.fmul (fsquare_times x12 3) x3 in
fsquare_times_lemma x12 3;
lemma_pow_pow_mod_mul f 0xfff 0x8 0x7;
assert (x15 == M.pow f 0x7fff % S.prime);
let x30 = S.fmul (fsquare_times x15 15) x15 in
fsquare_times_lemma x15 15;
assert_norm (pow2 15 = 0x8000);
lemma_pow_pow_mod_mul f 0x7fff 0x8000 0x7fff;
assert (x30 == M.pow f 0x3fffffff % S.prime);
let x32 = S.fmul (fsquare_times x30 2) x2 in
fsquare_times_lemma x30 2;
assert_norm (pow2 2 = 4);
lemma_pow_pow_mod_mul f 0x3fffffff 0x4 0x3;
assert (x32 == M.pow f 0xffffffff % S.prime);
let x64 = S.fmul (fsquare_times x32 32) f in
fsquare_times_lemma x32 32;
assert_norm (pow2 32 = 0x100000000);
lemma_pow_pow_mod_mul f 0xffffffff 0x100000000 0x1;
assert (x64 == M.pow f 0xffffffff00000001 % S.prime);
let x192 = S.fmul (fsquare_times x64 128) x32 in
fsquare_times_lemma x64 128;
assert_norm (pow2 128 = 0x100000000000000000000000000000000);
lemma_pow_pow_mod_mul f 0xffffffff00000001 0x100000000000000000000000000000000 0xffffffff;
assert (x192 == M.pow f 0xffffffff00000001000000000000000000000000ffffffff % S.prime);
let x224 = S.fmul (fsquare_times x192 32) x32 in
fsquare_times_lemma x192 32;
lemma_pow_pow_mod_mul f 0xffffffff00000001000000000000000000000000ffffffff 0x100000000 0xffffffff;
assert (x224 == M.pow f 0xffffffff00000001000000000000000000000000ffffffffffffffff % S.prime);
let x254 = S.fmul (fsquare_times x224 30) x30 in
fsquare_times_lemma x224 30;
assert_norm (pow2 30 = 0x40000000);
lemma_pow_pow_mod_mul f 0xffffffff00000001000000000000000000000000ffffffffffffffff 0x40000000 0x3fffffff;
assert (x254 == M.pow f 0x3fffffffc00000004000000000000000000000003fffffffffffffffffffffff % S.prime);
let x256 = S.fmul (fsquare_times x254 2) f in
fsquare_times_lemma x254 2;
lemma_pow_pow_mod_mul f 0x3fffffffc00000004000000000000000000000003fffffffffffffffffffffff 0x4 0x1;
assert (x256 == M.pow f 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffd % S.prime);
assert_norm (S.prime - 2 = 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffd) | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: Spec.P256.PointOps.felem
-> FStar.Pervasives.Lemma (ensures Hacl.Spec.P256.Finv.finv f == Spec.P256.PointOps.finv f) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.felem",
"Lib.NatMod.lemma_pow_mod",
"Spec.P256.PointOps.prime",
"Prims.op_Subtraction",
"Prims.unit",
"Prims._assert",
"Prims.eq2",
"Prims.int",
"Hacl.Spec.P256.Finv.finv",
"Prims.op_Modulus",
"Lib.NatMod.pow",
"Hacl.Spec.P256.Finv.finv_lemma"
] | [] | true | false | true | false | false | let finv_is_finv_lemma f =
| finv_lemma f;
assert (finv f == M.pow f (S.prime - 2) % S.prime);
M.lemma_pow_mod #S.prime f (S.prime - 2) | false |
Steel.SpinLock.fst | Steel.SpinLock.available | val available : Prims.bool | let available = false | {
"file_name": "lib/steel/Steel.SpinLock.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 21,
"end_line": 27,
"start_col": 0,
"start_line": 27
} | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.SpinLock
open FStar.Ghost
open Steel.Effect.Atomic
open Steel.Effect
open Steel.Reference
open Steel.FractionalPermission
#set-options "--ide_id_info_off --fuel 0 --ifuel 0" | {
"checked_file": "/",
"dependencies": [
"Steel.Reference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.SpinLock.fst"
} | [
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Reference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Prims.bool | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let available =
| false | false |
|
Steel.SpinLock.fst | Steel.SpinLock.locked | val locked : Prims.bool | let locked = true | {
"file_name": "lib/steel/Steel.SpinLock.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 17,
"end_line": 28,
"start_col": 0,
"start_line": 28
} | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.SpinLock
open FStar.Ghost
open Steel.Effect.Atomic
open Steel.Effect
open Steel.Reference
open Steel.FractionalPermission
#set-options "--ide_id_info_off --fuel 0 --ifuel 0" | {
"checked_file": "/",
"dependencies": [
"Steel.Reference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.SpinLock.fst"
} | [
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Reference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Prims.bool | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let locked =
| true | false |
|
Steel.SpinLock.fst | Steel.SpinLock.lockinv | val lockinv (p: vprop) (r: ref bool) : vprop | val lockinv (p: vprop) (r: ref bool) : vprop | let lockinv (p:vprop) (r:ref bool) : vprop =
h_exists (fun b -> pts_to r full_perm b `star` (if b then emp else p)) | {
"file_name": "lib/steel/Steel.SpinLock.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 72,
"end_line": 31,
"start_col": 0,
"start_line": 30
} | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.SpinLock
open FStar.Ghost
open Steel.Effect.Atomic
open Steel.Effect
open Steel.Reference
open Steel.FractionalPermission
#set-options "--ide_id_info_off --fuel 0 --ifuel 0"
let available = false
let locked = true | {
"checked_file": "/",
"dependencies": [
"Steel.Reference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.SpinLock.fst"
} | [
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Reference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | p: Steel.Effect.Common.vprop -> r: Steel.Reference.ref Prims.bool -> Steel.Effect.Common.vprop | Prims.Tot | [
"total"
] | [] | [
"Steel.Effect.Common.vprop",
"Steel.Reference.ref",
"Prims.bool",
"Steel.Effect.Atomic.h_exists",
"Steel.Effect.Common.star",
"Steel.Reference.pts_to",
"Steel.FractionalPermission.full_perm",
"Steel.Effect.Common.emp"
] | [] | false | false | false | true | false | let lockinv (p: vprop) (r: ref bool) : vprop =
| h_exists (fun b -> (pts_to r full_perm b) `star` (if b then emp else p)) | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.finv_lemma | val finv_lemma: f:S.felem -> Lemma (finv f == M.pow f (S.prime - 2) % S.prime) | val finv_lemma: f:S.felem -> Lemma (finv f == M.pow f (S.prime - 2) % S.prime) | let finv_lemma f =
let x2 = S.fmul (fsquare_times f 1) f in
fsquare_times_lemma f 1;
assert_norm (pow2 1 = 0x2);
lemma_pow_mod_1 f;
lemma_pow_mod_mul f 0x2 0x1;
assert (x2 == M.pow f 0x3 % S.prime);
let x3 = S.fmul (fsquare_times x2 1) f in
fsquare_times_lemma x2 1;
lemma_pow_mod_1 f;
lemma_pow_pow_mod_mul f 0x3 0x2 0x1;
assert (x3 == M.pow f 0x7 % S.prime);
let x6 = S.fmul (fsquare_times x3 3) x3 in
fsquare_times_lemma x3 3;
assert_norm (pow2 3 = 8);
lemma_pow_pow_mod_mul f 0x7 0x8 0x7;
assert (x6 == M.pow f 0x3f % S.prime);
let x12 = S.fmul (fsquare_times x6 6) x6 in
fsquare_times_lemma x6 6;
assert_norm (pow2 6 = 64);
lemma_pow_pow_mod_mul f 0x3f 0x40 0x3f;
assert (x12 == M.pow f 0xfff % S.prime);
let x15 = S.fmul (fsquare_times x12 3) x3 in
fsquare_times_lemma x12 3;
lemma_pow_pow_mod_mul f 0xfff 0x8 0x7;
assert (x15 == M.pow f 0x7fff % S.prime);
let x30 = S.fmul (fsquare_times x15 15) x15 in
fsquare_times_lemma x15 15;
assert_norm (pow2 15 = 0x8000);
lemma_pow_pow_mod_mul f 0x7fff 0x8000 0x7fff;
assert (x30 == M.pow f 0x3fffffff % S.prime);
let x32 = S.fmul (fsquare_times x30 2) x2 in
fsquare_times_lemma x30 2;
assert_norm (pow2 2 = 4);
lemma_pow_pow_mod_mul f 0x3fffffff 0x4 0x3;
assert (x32 == M.pow f 0xffffffff % S.prime);
let x64 = S.fmul (fsquare_times x32 32) f in
fsquare_times_lemma x32 32;
assert_norm (pow2 32 = 0x100000000);
lemma_pow_pow_mod_mul f 0xffffffff 0x100000000 0x1;
assert (x64 == M.pow f 0xffffffff00000001 % S.prime);
let x192 = S.fmul (fsquare_times x64 128) x32 in
fsquare_times_lemma x64 128;
assert_norm (pow2 128 = 0x100000000000000000000000000000000);
lemma_pow_pow_mod_mul f 0xffffffff00000001 0x100000000000000000000000000000000 0xffffffff;
assert (x192 == M.pow f 0xffffffff00000001000000000000000000000000ffffffff % S.prime);
let x224 = S.fmul (fsquare_times x192 32) x32 in
fsquare_times_lemma x192 32;
lemma_pow_pow_mod_mul f 0xffffffff00000001000000000000000000000000ffffffff 0x100000000 0xffffffff;
assert (x224 == M.pow f 0xffffffff00000001000000000000000000000000ffffffffffffffff % S.prime);
let x254 = S.fmul (fsquare_times x224 30) x30 in
fsquare_times_lemma x224 30;
assert_norm (pow2 30 = 0x40000000);
lemma_pow_pow_mod_mul f 0xffffffff00000001000000000000000000000000ffffffffffffffff 0x40000000 0x3fffffff;
assert (x254 == M.pow f 0x3fffffffc00000004000000000000000000000003fffffffffffffffffffffff % S.prime);
let x256 = S.fmul (fsquare_times x254 2) f in
fsquare_times_lemma x254 2;
lemma_pow_pow_mod_mul f 0x3fffffffc00000004000000000000000000000003fffffffffffffffffffffff 0x4 0x1;
assert (x256 == M.pow f 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffd % S.prime);
assert_norm (S.prime - 2 = 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffd) | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 96,
"end_line": 203,
"start_col": 0,
"start_line": 132
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime
let mk_to_nat_mod_comm_monoid : SE.to_comm_monoid S.felem = {
SE.a_spec = S.felem;
SE.comm_monoid = nat_mod_comm_monoid;
SE.refl = (fun (x:S.felem) -> x);
}
val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid
let one_mod _ = 1
val mul_mod : SE.mul_st S.felem mk_to_nat_mod_comm_monoid
let mul_mod x y = S.fmul x y
val sqr_mod : SE.sqr_st S.felem mk_to_nat_mod_comm_monoid
let sqr_mod x = S.fmul x x
let mk_nat_mod_concrete_ops : SE.concrete_ops S.felem = {
SE.to = mk_to_nat_mod_comm_monoid;
SE.one = one_mod;
SE.mul = mul_mod;
SE.sqr = sqr_mod;
}
let fsquare_times (a:S.felem) (b:nat) : S.felem =
SE.exp_pow2 mk_nat_mod_concrete_ops a b
val fsquare_times_lemma: a:S.felem -> b:nat ->
Lemma (fsquare_times a b == M.pow a (pow2 b) % S.prime)
let fsquare_times_lemma a b =
SE.exp_pow2_lemma mk_nat_mod_concrete_ops a b;
LE.exp_pow2_lemma nat_mod_comm_monoid a b;
assert (fsquare_times a b == LE.pow nat_mod_comm_monoid a (pow2 b));
M.lemma_pow_nat_mod_is_pow #S.prime a (pow2 b)
(**
The algorithm is taken from
https://briansmith.org/ecc-inversion-addition-chains-01
*)
val finv: f:S.felem -> S.felem
let finv f =
let x2 = S.fmul (fsquare_times f 1) f in
let x3 = S.fmul (fsquare_times x2 1) f in
let x6 = S.fmul (fsquare_times x3 3) x3 in
let x12 = S.fmul (fsquare_times x6 6) x6 in
let x15 = S.fmul (fsquare_times x12 3) x3 in
let x30 = S.fmul (fsquare_times x15 15) x15 in
let x32 = S.fmul (fsquare_times x30 2) x2 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x192 = S.fmul (fsquare_times x64 128) x32 in
let x224 = S.fmul (fsquare_times x192 32) x32 in
let x254 = S.fmul (fsquare_times x224 30) x30 in
let x256 = S.fmul (fsquare_times x254 2) f in
x256
val fsqrt: f:S.felem -> S.felem
let fsqrt f =
let x2 = S.fmul (fsquare_times f 1) f in
let x4 = S.fmul (fsquare_times x2 2) x2 in
let x8 = S.fmul (fsquare_times x4 4) x4 in
let x16 = S.fmul (fsquare_times x8 8) x8 in
let x32 = S.fmul (fsquare_times x16 16) x16 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x160 = S.fmul (fsquare_times x64 96) f in
let x254 = fsquare_times x160 94 in
x254
// TODO: mv to lib/
val lemma_pow_mod_1: f:S.felem -> Lemma (f == M.pow f 1 % S.prime)
let lemma_pow_mod_1 f =
M.lemma_pow1 f;
Math.Lemmas.small_mod f S.prime;
assert_norm (pow2 0 = 1);
assert (f == M.pow f 1 % S.prime)
val lemma_pow_mod_mul: f:S.felem -> a:nat -> b:nat ->
Lemma (S.fmul (M.pow f a % S.prime) (M.pow f b % S.prime) == M.pow f (a + b) % S.prime)
let lemma_pow_mod_mul f a b =
calc (==) {
S.fmul (M.pow f a % S.prime) (M.pow f b % S.prime);
(==) {
Math.Lemmas.lemma_mod_mul_distr_l (M.pow f a) (M.pow f b % S.prime) S.prime;
Math.Lemmas.lemma_mod_mul_distr_r (M.pow f a) (M.pow f b) S.prime }
M.pow f a * M.pow f b % S.prime;
(==) { M.lemma_pow_add f a b }
M.pow f (a + b) % S.prime;
}
val lemma_pow_pow_mod: f:S.felem -> a:nat -> b:nat ->
Lemma (M.pow (M.pow f a % S.prime) b % S.prime == M.pow f (a * b) % S.prime)
let lemma_pow_pow_mod f a b =
calc (==) {
M.pow (M.pow f a % S.prime) b % S.prime;
(==) { M.lemma_pow_mod_base (M.pow f a) b S.prime }
M.pow (M.pow f a) b % S.prime;
(==) { M.lemma_pow_mul f a b }
M.pow f (a * b) % S.prime;
}
val lemma_pow_pow_mod_mul: f:S.felem -> a:nat -> b:nat -> c:nat ->
Lemma (S.fmul (M.pow (M.pow f a % S.prime) b % S.prime) (M.pow f c % S.prime) == M.pow f (a * b + c) % S.prime)
let lemma_pow_pow_mod_mul f a b c =
calc (==) {
S.fmul (M.pow (M.pow f a % S.prime) b % S.prime) (M.pow f c % S.prime);
(==) { lemma_pow_pow_mod f a b }
S.fmul (M.pow f (a * b) % S.prime) (M.pow f c % S.prime);
(==) { lemma_pow_mod_mul f (a * b) c }
M.pow f (a * b + c) % S.prime;
}
//////////////////////////////
// prime - 2 = 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffd | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: Spec.P256.PointOps.felem
-> FStar.Pervasives.Lemma
(ensures
Hacl.Spec.P256.Finv.finv f ==
Lib.NatMod.pow f (Spec.P256.PointOps.prime - 2) % Spec.P256.PointOps.prime) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.felem",
"FStar.Pervasives.assert_norm",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.op_Subtraction",
"Spec.P256.PointOps.prime",
"Prims.unit",
"Prims._assert",
"Prims.eq2",
"Prims.op_Modulus",
"Lib.NatMod.pow",
"Hacl.Spec.P256.Finv.lemma_pow_pow_mod_mul",
"Hacl.Spec.P256.Finv.fsquare_times_lemma",
"Spec.P256.PointOps.fmul",
"Hacl.Spec.P256.Finv.fsquare_times",
"Prims.pow2",
"Hacl.Spec.P256.Finv.lemma_pow_mod_1",
"Hacl.Spec.P256.Finv.lemma_pow_mod_mul"
] | [] | true | false | true | false | false | let finv_lemma f =
| let x2 = S.fmul (fsquare_times f 1) f in
fsquare_times_lemma f 1;
assert_norm (pow2 1 = 0x2);
lemma_pow_mod_1 f;
lemma_pow_mod_mul f 0x2 0x1;
assert (x2 == M.pow f 0x3 % S.prime);
let x3 = S.fmul (fsquare_times x2 1) f in
fsquare_times_lemma x2 1;
lemma_pow_mod_1 f;
lemma_pow_pow_mod_mul f 0x3 0x2 0x1;
assert (x3 == M.pow f 0x7 % S.prime);
let x6 = S.fmul (fsquare_times x3 3) x3 in
fsquare_times_lemma x3 3;
assert_norm (pow2 3 = 8);
lemma_pow_pow_mod_mul f 0x7 0x8 0x7;
assert (x6 == M.pow f 0x3f % S.prime);
let x12 = S.fmul (fsquare_times x6 6) x6 in
fsquare_times_lemma x6 6;
assert_norm (pow2 6 = 64);
lemma_pow_pow_mod_mul f 0x3f 0x40 0x3f;
assert (x12 == M.pow f 0xfff % S.prime);
let x15 = S.fmul (fsquare_times x12 3) x3 in
fsquare_times_lemma x12 3;
lemma_pow_pow_mod_mul f 0xfff 0x8 0x7;
assert (x15 == M.pow f 0x7fff % S.prime);
let x30 = S.fmul (fsquare_times x15 15) x15 in
fsquare_times_lemma x15 15;
assert_norm (pow2 15 = 0x8000);
lemma_pow_pow_mod_mul f 0x7fff 0x8000 0x7fff;
assert (x30 == M.pow f 0x3fffffff % S.prime);
let x32 = S.fmul (fsquare_times x30 2) x2 in
fsquare_times_lemma x30 2;
assert_norm (pow2 2 = 4);
lemma_pow_pow_mod_mul f 0x3fffffff 0x4 0x3;
assert (x32 == M.pow f 0xffffffff % S.prime);
let x64 = S.fmul (fsquare_times x32 32) f in
fsquare_times_lemma x32 32;
assert_norm (pow2 32 = 0x100000000);
lemma_pow_pow_mod_mul f 0xffffffff 0x100000000 0x1;
assert (x64 == M.pow f 0xffffffff00000001 % S.prime);
let x192 = S.fmul (fsquare_times x64 128) x32 in
fsquare_times_lemma x64 128;
assert_norm (pow2 128 = 0x100000000000000000000000000000000);
lemma_pow_pow_mod_mul f 0xffffffff00000001 0x100000000000000000000000000000000 0xffffffff;
assert (x192 == M.pow f 0xffffffff00000001000000000000000000000000ffffffff % S.prime);
let x224 = S.fmul (fsquare_times x192 32) x32 in
fsquare_times_lemma x192 32;
lemma_pow_pow_mod_mul f 0xffffffff00000001000000000000000000000000ffffffff 0x100000000 0xffffffff;
assert (x224 == M.pow f 0xffffffff00000001000000000000000000000000ffffffffffffffff % S.prime);
let x254 = S.fmul (fsquare_times x224 30) x30 in
fsquare_times_lemma x224 30;
assert_norm (pow2 30 = 0x40000000);
lemma_pow_pow_mod_mul f
0xffffffff00000001000000000000000000000000ffffffffffffffff
0x40000000
0x3fffffff;
assert (x254 == M.pow f 0x3fffffffc00000004000000000000000000000003fffffffffffffffffffffff % S.prime
);
let x256 = S.fmul (fsquare_times x254 2) f in
fsquare_times_lemma x254 2;
lemma_pow_pow_mod_mul f 0x3fffffffc00000004000000000000000000000003fffffffffffffffffffffff 0x4 0x1;
assert (x256 == M.pow f 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffd % S.prime
);
assert_norm (S.prime - 2 = 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffd) | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.fsqrt_lemma | val fsqrt_lemma: f:S.felem -> Lemma (fsqrt f == M.pow f ((S.prime + 1) / 4) % S.prime) | val fsqrt_lemma: f:S.felem -> Lemma (fsqrt f == M.pow f ((S.prime + 1) / 4) % S.prime) | let fsqrt_lemma f =
let x2 = S.fmul (fsquare_times f 1) f in
fsquare_times_lemma f 1;
assert_norm (pow2 1 = 0x2);
lemma_pow_mod_1 f;
lemma_pow_mod_mul f 0x2 0x1;
assert (x2 == M.pow f 0x3 % S.prime);
let x4 = S.fmul (fsquare_times x2 2) x2 in
fsquare_times_lemma x2 2;
assert_norm (pow2 2 = 0x4);
lemma_pow_pow_mod_mul f 0x3 0x4 0x3;
assert (x4 == M.pow f 0xf % S.prime);
let x8 = S.fmul (fsquare_times x4 4) x4 in
fsquare_times_lemma x4 4;
assert_norm (pow2 4 = 0x10);
lemma_pow_pow_mod_mul f 0xf 0x10 0xf;
assert (x8 == M.pow f 0xff % S.prime);
let x16 = S.fmul (fsquare_times x8 8) x8 in
fsquare_times_lemma x8 8;
assert_norm (pow2 8 = 0x100);
lemma_pow_pow_mod_mul f 0xff 0x100 0xff;
assert (x16 == M.pow f 0xffff % S.prime);
let x32 = S.fmul (fsquare_times x16 16) x16 in
fsquare_times_lemma x16 16;
assert_norm (pow2 16 = 0x10000);
lemma_pow_pow_mod_mul f 0xffff 0x10000 0xffff;
assert (x32 == M.pow f 0xffffffff % S.prime);
let x64 = S.fmul (fsquare_times x32 32) f in
fsquare_times_lemma x32 32;
assert_norm (pow2 32 = 0x100000000);
lemma_pow_pow_mod_mul f 0xffffffff 0x100000000 0x1;
assert (x64 == M.pow f 0xffffffff00000001 % S.prime);
let x160 = S.fmul (fsquare_times x64 96) f in
fsquare_times_lemma x64 96;
assert_norm (pow2 96 = 0x1000000000000000000000000);
lemma_pow_pow_mod_mul f 0xffffffff00000001 0x1000000000000000000000000 0x1;
assert (x160 == M.pow f 0xffffffff00000001000000000000000000000001 % S.prime);
let x254 = fsquare_times x160 94 in
fsquare_times_lemma x160 94;
assert_norm (pow2 94 = 0x400000000000000000000000);
lemma_pow_pow_mod f 0xffffffff00000001000000000000000000000001 0x400000000000000000000000;
assert (x254 == M.pow f 0x3fffffffc0000000400000000000000000000000400000000000000000000000 % S.prime);
assert_norm ((S.prime + 1) / 4 = 0x3fffffffc0000000400000000000000000000000400000000000000000000000) | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 102,
"end_line": 265,
"start_col": 0,
"start_line": 215
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime
let mk_to_nat_mod_comm_monoid : SE.to_comm_monoid S.felem = {
SE.a_spec = S.felem;
SE.comm_monoid = nat_mod_comm_monoid;
SE.refl = (fun (x:S.felem) -> x);
}
val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid
let one_mod _ = 1
val mul_mod : SE.mul_st S.felem mk_to_nat_mod_comm_monoid
let mul_mod x y = S.fmul x y
val sqr_mod : SE.sqr_st S.felem mk_to_nat_mod_comm_monoid
let sqr_mod x = S.fmul x x
let mk_nat_mod_concrete_ops : SE.concrete_ops S.felem = {
SE.to = mk_to_nat_mod_comm_monoid;
SE.one = one_mod;
SE.mul = mul_mod;
SE.sqr = sqr_mod;
}
let fsquare_times (a:S.felem) (b:nat) : S.felem =
SE.exp_pow2 mk_nat_mod_concrete_ops a b
val fsquare_times_lemma: a:S.felem -> b:nat ->
Lemma (fsquare_times a b == M.pow a (pow2 b) % S.prime)
let fsquare_times_lemma a b =
SE.exp_pow2_lemma mk_nat_mod_concrete_ops a b;
LE.exp_pow2_lemma nat_mod_comm_monoid a b;
assert (fsquare_times a b == LE.pow nat_mod_comm_monoid a (pow2 b));
M.lemma_pow_nat_mod_is_pow #S.prime a (pow2 b)
(**
The algorithm is taken from
https://briansmith.org/ecc-inversion-addition-chains-01
*)
val finv: f:S.felem -> S.felem
let finv f =
let x2 = S.fmul (fsquare_times f 1) f in
let x3 = S.fmul (fsquare_times x2 1) f in
let x6 = S.fmul (fsquare_times x3 3) x3 in
let x12 = S.fmul (fsquare_times x6 6) x6 in
let x15 = S.fmul (fsquare_times x12 3) x3 in
let x30 = S.fmul (fsquare_times x15 15) x15 in
let x32 = S.fmul (fsquare_times x30 2) x2 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x192 = S.fmul (fsquare_times x64 128) x32 in
let x224 = S.fmul (fsquare_times x192 32) x32 in
let x254 = S.fmul (fsquare_times x224 30) x30 in
let x256 = S.fmul (fsquare_times x254 2) f in
x256
val fsqrt: f:S.felem -> S.felem
let fsqrt f =
let x2 = S.fmul (fsquare_times f 1) f in
let x4 = S.fmul (fsquare_times x2 2) x2 in
let x8 = S.fmul (fsquare_times x4 4) x4 in
let x16 = S.fmul (fsquare_times x8 8) x8 in
let x32 = S.fmul (fsquare_times x16 16) x16 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x160 = S.fmul (fsquare_times x64 96) f in
let x254 = fsquare_times x160 94 in
x254
// TODO: mv to lib/
val lemma_pow_mod_1: f:S.felem -> Lemma (f == M.pow f 1 % S.prime)
let lemma_pow_mod_1 f =
M.lemma_pow1 f;
Math.Lemmas.small_mod f S.prime;
assert_norm (pow2 0 = 1);
assert (f == M.pow f 1 % S.prime)
val lemma_pow_mod_mul: f:S.felem -> a:nat -> b:nat ->
Lemma (S.fmul (M.pow f a % S.prime) (M.pow f b % S.prime) == M.pow f (a + b) % S.prime)
let lemma_pow_mod_mul f a b =
calc (==) {
S.fmul (M.pow f a % S.prime) (M.pow f b % S.prime);
(==) {
Math.Lemmas.lemma_mod_mul_distr_l (M.pow f a) (M.pow f b % S.prime) S.prime;
Math.Lemmas.lemma_mod_mul_distr_r (M.pow f a) (M.pow f b) S.prime }
M.pow f a * M.pow f b % S.prime;
(==) { M.lemma_pow_add f a b }
M.pow f (a + b) % S.prime;
}
val lemma_pow_pow_mod: f:S.felem -> a:nat -> b:nat ->
Lemma (M.pow (M.pow f a % S.prime) b % S.prime == M.pow f (a * b) % S.prime)
let lemma_pow_pow_mod f a b =
calc (==) {
M.pow (M.pow f a % S.prime) b % S.prime;
(==) { M.lemma_pow_mod_base (M.pow f a) b S.prime }
M.pow (M.pow f a) b % S.prime;
(==) { M.lemma_pow_mul f a b }
M.pow f (a * b) % S.prime;
}
val lemma_pow_pow_mod_mul: f:S.felem -> a:nat -> b:nat -> c:nat ->
Lemma (S.fmul (M.pow (M.pow f a % S.prime) b % S.prime) (M.pow f c % S.prime) == M.pow f (a * b + c) % S.prime)
let lemma_pow_pow_mod_mul f a b c =
calc (==) {
S.fmul (M.pow (M.pow f a % S.prime) b % S.prime) (M.pow f c % S.prime);
(==) { lemma_pow_pow_mod f a b }
S.fmul (M.pow f (a * b) % S.prime) (M.pow f c % S.prime);
(==) { lemma_pow_mod_mul f (a * b) c }
M.pow f (a * b + c) % S.prime;
}
//////////////////////////////
// prime - 2 = 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffd
val finv_lemma: f:S.felem -> Lemma (finv f == M.pow f (S.prime - 2) % S.prime)
let finv_lemma f =
let x2 = S.fmul (fsquare_times f 1) f in
fsquare_times_lemma f 1;
assert_norm (pow2 1 = 0x2);
lemma_pow_mod_1 f;
lemma_pow_mod_mul f 0x2 0x1;
assert (x2 == M.pow f 0x3 % S.prime);
let x3 = S.fmul (fsquare_times x2 1) f in
fsquare_times_lemma x2 1;
lemma_pow_mod_1 f;
lemma_pow_pow_mod_mul f 0x3 0x2 0x1;
assert (x3 == M.pow f 0x7 % S.prime);
let x6 = S.fmul (fsquare_times x3 3) x3 in
fsquare_times_lemma x3 3;
assert_norm (pow2 3 = 8);
lemma_pow_pow_mod_mul f 0x7 0x8 0x7;
assert (x6 == M.pow f 0x3f % S.prime);
let x12 = S.fmul (fsquare_times x6 6) x6 in
fsquare_times_lemma x6 6;
assert_norm (pow2 6 = 64);
lemma_pow_pow_mod_mul f 0x3f 0x40 0x3f;
assert (x12 == M.pow f 0xfff % S.prime);
let x15 = S.fmul (fsquare_times x12 3) x3 in
fsquare_times_lemma x12 3;
lemma_pow_pow_mod_mul f 0xfff 0x8 0x7;
assert (x15 == M.pow f 0x7fff % S.prime);
let x30 = S.fmul (fsquare_times x15 15) x15 in
fsquare_times_lemma x15 15;
assert_norm (pow2 15 = 0x8000);
lemma_pow_pow_mod_mul f 0x7fff 0x8000 0x7fff;
assert (x30 == M.pow f 0x3fffffff % S.prime);
let x32 = S.fmul (fsquare_times x30 2) x2 in
fsquare_times_lemma x30 2;
assert_norm (pow2 2 = 4);
lemma_pow_pow_mod_mul f 0x3fffffff 0x4 0x3;
assert (x32 == M.pow f 0xffffffff % S.prime);
let x64 = S.fmul (fsquare_times x32 32) f in
fsquare_times_lemma x32 32;
assert_norm (pow2 32 = 0x100000000);
lemma_pow_pow_mod_mul f 0xffffffff 0x100000000 0x1;
assert (x64 == M.pow f 0xffffffff00000001 % S.prime);
let x192 = S.fmul (fsquare_times x64 128) x32 in
fsquare_times_lemma x64 128;
assert_norm (pow2 128 = 0x100000000000000000000000000000000);
lemma_pow_pow_mod_mul f 0xffffffff00000001 0x100000000000000000000000000000000 0xffffffff;
assert (x192 == M.pow f 0xffffffff00000001000000000000000000000000ffffffff % S.prime);
let x224 = S.fmul (fsquare_times x192 32) x32 in
fsquare_times_lemma x192 32;
lemma_pow_pow_mod_mul f 0xffffffff00000001000000000000000000000000ffffffff 0x100000000 0xffffffff;
assert (x224 == M.pow f 0xffffffff00000001000000000000000000000000ffffffffffffffff % S.prime);
let x254 = S.fmul (fsquare_times x224 30) x30 in
fsquare_times_lemma x224 30;
assert_norm (pow2 30 = 0x40000000);
lemma_pow_pow_mod_mul f 0xffffffff00000001000000000000000000000000ffffffffffffffff 0x40000000 0x3fffffff;
assert (x254 == M.pow f 0x3fffffffc00000004000000000000000000000003fffffffffffffffffffffff % S.prime);
let x256 = S.fmul (fsquare_times x254 2) f in
fsquare_times_lemma x254 2;
lemma_pow_pow_mod_mul f 0x3fffffffc00000004000000000000000000000003fffffffffffffffffffffff 0x4 0x1;
assert (x256 == M.pow f 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffd % S.prime);
assert_norm (S.prime - 2 = 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffd)
val finv_is_finv_lemma: f:S.felem -> Lemma (finv f == S.finv f)
let finv_is_finv_lemma f =
finv_lemma f;
assert (finv f == M.pow f (S.prime - 2) % S.prime);
M.lemma_pow_mod #S.prime f (S.prime - 2)
// (prime + 1) / 4 = 0x3fffffffc0000000400000000000000000000000400000000000000000000000 | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: Spec.P256.PointOps.felem
-> FStar.Pervasives.Lemma
(ensures
Hacl.Spec.P256.Finv.fsqrt f ==
Lib.NatMod.pow f ((Spec.P256.PointOps.prime + 1) / 4) % Spec.P256.PointOps.prime) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.felem",
"FStar.Pervasives.assert_norm",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.op_Division",
"Prims.op_Addition",
"Spec.P256.PointOps.prime",
"Prims.unit",
"Prims._assert",
"Prims.eq2",
"Prims.op_Modulus",
"Lib.NatMod.pow",
"Hacl.Spec.P256.Finv.lemma_pow_pow_mod",
"Prims.pow2",
"Hacl.Spec.P256.Finv.fsquare_times_lemma",
"Hacl.Spec.P256.Finv.fsquare_times",
"Hacl.Spec.P256.Finv.lemma_pow_pow_mod_mul",
"Spec.P256.PointOps.fmul",
"Hacl.Spec.P256.Finv.lemma_pow_mod_mul",
"Hacl.Spec.P256.Finv.lemma_pow_mod_1"
] | [] | true | false | true | false | false | let fsqrt_lemma f =
| let x2 = S.fmul (fsquare_times f 1) f in
fsquare_times_lemma f 1;
assert_norm (pow2 1 = 0x2);
lemma_pow_mod_1 f;
lemma_pow_mod_mul f 0x2 0x1;
assert (x2 == M.pow f 0x3 % S.prime);
let x4 = S.fmul (fsquare_times x2 2) x2 in
fsquare_times_lemma x2 2;
assert_norm (pow2 2 = 0x4);
lemma_pow_pow_mod_mul f 0x3 0x4 0x3;
assert (x4 == M.pow f 0xf % S.prime);
let x8 = S.fmul (fsquare_times x4 4) x4 in
fsquare_times_lemma x4 4;
assert_norm (pow2 4 = 0x10);
lemma_pow_pow_mod_mul f 0xf 0x10 0xf;
assert (x8 == M.pow f 0xff % S.prime);
let x16 = S.fmul (fsquare_times x8 8) x8 in
fsquare_times_lemma x8 8;
assert_norm (pow2 8 = 0x100);
lemma_pow_pow_mod_mul f 0xff 0x100 0xff;
assert (x16 == M.pow f 0xffff % S.prime);
let x32 = S.fmul (fsquare_times x16 16) x16 in
fsquare_times_lemma x16 16;
assert_norm (pow2 16 = 0x10000);
lemma_pow_pow_mod_mul f 0xffff 0x10000 0xffff;
assert (x32 == M.pow f 0xffffffff % S.prime);
let x64 = S.fmul (fsquare_times x32 32) f in
fsquare_times_lemma x32 32;
assert_norm (pow2 32 = 0x100000000);
lemma_pow_pow_mod_mul f 0xffffffff 0x100000000 0x1;
assert (x64 == M.pow f 0xffffffff00000001 % S.prime);
let x160 = S.fmul (fsquare_times x64 96) f in
fsquare_times_lemma x64 96;
assert_norm (pow2 96 = 0x1000000000000000000000000);
lemma_pow_pow_mod_mul f 0xffffffff00000001 0x1000000000000000000000000 0x1;
assert (x160 == M.pow f 0xffffffff00000001000000000000000000000001 % S.prime);
let x254 = fsquare_times x160 94 in
fsquare_times_lemma x160 94;
assert_norm (pow2 94 = 0x400000000000000000000000);
lemma_pow_pow_mod f 0xffffffff00000001000000000000000000000001 0x400000000000000000000000;
assert (x254 == M.pow f 0x3fffffffc0000000400000000000000000000000400000000000000000000000 % S.prime
);
assert_norm ((S.prime + 1) / 4 = 0x3fffffffc0000000400000000000000000000000400000000000000000000000) | false |
SimpleTactic.fst | SimpleTactic.test | val test : _: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit | let test () =
dump "Test";
print "hello";
admit_all() | {
"file_name": "examples/native_tactics/SimpleTactic.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 13,
"end_line": 23,
"start_col": 0,
"start_line": 20
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module SimpleTactic
open FStar.Tactics.V2 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "SimpleTactic.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.unit",
"FStar.Tactics.V2.Derived.admit_all",
"FStar.Stubs.Tactics.V2.Builtins.print",
"FStar.Stubs.Tactics.V2.Builtins.dump"
] | [] | false | true | false | false | false | let test () =
| dump "Test";
print "hello";
admit_all () | false |
|
PointStructDirectDef.fst | PointStructDirectDef.copy_struct | val copy_struct
(p: ref point)
(v: Ghost.erased (typeof point))
(q: ref point)
(w: Ghost.erased (typeof point))
: ST unit
((p `pts_to` v) `star` (q `pts_to` w))
(fun v' -> (p `pts_to` w) `star` (q `pts_to` w))
(requires
(exists (vx: U32.t) (vy: U32.t).
struct_get_field v "x" == mk_scalar vx /\ struct_get_field v "y" == mk_scalar vy) /\
(exists (vx: U32.t) (vy: U32.t).
struct_get_field w "x" == mk_scalar vx /\ struct_get_field w "y" == mk_scalar vy))
(ensures fun _ -> True) | val copy_struct
(p: ref point)
(v: Ghost.erased (typeof point))
(q: ref point)
(w: Ghost.erased (typeof point))
: ST unit
((p `pts_to` v) `star` (q `pts_to` w))
(fun v' -> (p `pts_to` w) `star` (q `pts_to` w))
(requires
(exists (vx: U32.t) (vy: U32.t).
struct_get_field v "x" == mk_scalar vx /\ struct_get_field v "y" == mk_scalar vy) /\
(exists (vx: U32.t) (vy: U32.t).
struct_get_field w "x" == mk_scalar vx /\ struct_get_field w "y" == mk_scalar vy))
(ensures fun _ -> True) | let copy_struct (p: ref point) (v: Ghost.erased (typeof point))
(q: ref point) (w: Ghost.erased (typeof point))
: ST unit
((p `pts_to` v) `star` (q `pts_to` w))
(fun v' -> (p `pts_to` w) `star` (q `pts_to` w))
(requires
(exists (vx vy: U32.t) . struct_get_field v "x" == mk_scalar vx /\ struct_get_field v "y" == mk_scalar vy) /\
(exists (vx vy: U32.t) . struct_get_field w "x" == mk_scalar vx /\ struct_get_field w "y" == mk_scalar vy)
)
(ensures fun _ -> True)
= vpattern_rewrite (pts_to q) (Ghost.hide (mk_fraction point w full_perm));
copy q p;
vpattern_rewrite (pts_to q) w | {
"file_name": "share/steel/examples/steelc/PointStructDirectDef.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 31,
"end_line": 69,
"start_col": 0,
"start_line": 57
} | module PointStructDirectDef
open Steel.ST.Util
open Steel.ST.C.Types
module U32 = FStar.UInt32
// module C = C // for _zero_for_deref
let swap (#v1 #v2: Ghost.erased U32.t) (r1 r2: ref (scalar U32.t)) : STT unit
((r1 `pts_to` mk_scalar (Ghost.reveal v1)) `star` (r2 `pts_to` mk_scalar (Ghost.reveal v2)))
(fun _ -> (r1 `pts_to` mk_scalar (Ghost.reveal v2)) `star` (r2 `pts_to` mk_scalar (Ghost.reveal v1)))
= let x1 = read r1 in
let x2 = read r2 in
write r1 x2;
write r2 x1;
return () // necessary to enable smt_fallback
noextract
inline_for_extraction
[@@ norm_field_attr]
let point_fields =
field_description_cons "x" (scalar U32.t) (
field_description_cons "y" (scalar U32.t) (
field_description_nil))
let point_t = struct_t "PointStructDirectDef.point_t" point_fields
noextract
let point : typedef point_t = struct0 _ _ _
#push-options "--query_stats --fuel 0 --print_implicits"
let swap_struct (p: ref point) (v: Ghost.erased (typeof point))
: ST (Ghost.erased (typeof point))
(p `pts_to` v)
(fun v' -> p `pts_to` v')
(requires
exists (vx vy: U32.t) . struct_get_field v "x" == mk_scalar vx /\ struct_get_field v "y" == mk_scalar vy
)
(ensures fun v' ->
struct_get_field v' "x" == struct_get_field v "y" /\
struct_get_field v' "y" == struct_get_field v "x"
)
= let px = struct_field p "x" () in
let py = struct_field p "y" () in
let x = read px in
let y = read py in
write px y;
write py x;
let _ = unstruct_field p "x" px in
let _ = unstruct_field p "y" py in
drop (has_struct_field _ _ px);
drop (has_struct_field _ _ _);
return _
#pop-options | {
"checked_file": "/",
"dependencies": [
"Steel.ST.Util.fsti.checked",
"Steel.ST.C.Types.fst.checked",
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "PointStructDirectDef.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
p: Steel.ST.C.Types.Base.ref PointStructDirectDef.point ->
v: FStar.Ghost.erased (Steel.ST.C.Types.Base.typeof PointStructDirectDef.point) ->
q: Steel.ST.C.Types.Base.ref PointStructDirectDef.point ->
w: FStar.Ghost.erased (Steel.ST.C.Types.Base.typeof PointStructDirectDef.point)
-> Steel.ST.Effect.ST Prims.unit | Steel.ST.Effect.ST | [] | [] | [
"Steel.ST.C.Types.Base.ref",
"PointStructDirectDef.point_t",
"PointStructDirectDef.point",
"FStar.Ghost.erased",
"Steel.ST.C.Types.Base.typeof",
"Steel.ST.Util.vpattern_rewrite",
"FStar.Ghost.hide",
"FStar.Set.set",
"Steel.Memory.iname",
"FStar.Set.empty",
"Steel.ST.C.Types.Base.mk_fraction",
"FStar.Ghost.reveal",
"Steel.FractionalPermission.full_perm",
"Steel.ST.C.Types.Base.pts_to",
"Prims.unit",
"Steel.ST.C.Types.Base.copy",
"Steel.Effect.Common.star",
"Steel.Effect.Common.vprop",
"Prims.l_and",
"Prims.l_Exists",
"FStar.UInt32.t",
"Prims.eq2",
"Steel.ST.C.Types.Scalar.scalar_t",
"Steel.ST.C.Types.Struct.struct_get_field",
"Steel.C.Typestring.string_cons",
"Steel.C.Typestring.cP",
"Steel.C.Typestring.co",
"Steel.C.Typestring.ci",
"Steel.C.Typestring.cn",
"Steel.C.Typestring.ct",
"Steel.C.Typestring.cS",
"Steel.C.Typestring.cr",
"Steel.C.Typestring.cu",
"Steel.C.Typestring.cc",
"Steel.C.Typestring.cD",
"Steel.C.Typestring.ce",
"Steel.C.Typestring.cf",
"Steel.C.Typestring.cdot",
"Steel.C.Typestring.cp",
"Steel.C.Typestring.c_",
"Steel.C.Typestring.string_nil",
"Steel.ST.C.Types.Fields.field_t_cons",
"Steel.C.Typestring.cx",
"Steel.C.Typestring.cy",
"Steel.ST.C.Types.Fields.field_t_nil",
"PointStructDirectDef.point_fields",
"Steel.ST.C.Types.Scalar.mk_scalar",
"Prims.l_True"
] | [] | false | true | false | false | false | let copy_struct
(p: ref point)
(v: Ghost.erased (typeof point))
(q: ref point)
(w: Ghost.erased (typeof point))
: ST unit
((p `pts_to` v) `star` (q `pts_to` w))
(fun v' -> (p `pts_to` w) `star` (q `pts_to` w))
(requires
(exists (vx: U32.t) (vy: U32.t).
struct_get_field v "x" == mk_scalar vx /\ struct_get_field v "y" == mk_scalar vy) /\
(exists (vx: U32.t) (vy: U32.t).
struct_get_field w "x" == mk_scalar vx /\ struct_get_field w "y" == mk_scalar vy))
(ensures fun _ -> True) =
| vpattern_rewrite (pts_to q) (Ghost.hide (mk_fraction point w full_perm));
copy q p;
vpattern_rewrite (pts_to q) w | false |
Steel.SpinLock.fst | Steel.SpinLock.s_lock | val s_lock (p:vprop) (pred:normal (t_of p) -> prop) : Type u#0 | val s_lock (p:vprop) (pred:normal (t_of p) -> prop) : Type u#0 | let s_lock p pred = lock (p `vrefine` pred) | {
"file_name": "lib/steel/Steel.SpinLock.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 43,
"end_line": 115,
"start_col": 0,
"start_line": 115
} | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.SpinLock
open FStar.Ghost
open Steel.Effect.Atomic
open Steel.Effect
open Steel.Reference
open Steel.FractionalPermission
#set-options "--ide_id_info_off --fuel 0 --ifuel 0"
let available = false
let locked = true
let lockinv (p:vprop) (r:ref bool) : vprop =
h_exists (fun b -> pts_to r full_perm b `star` (if b then emp else p))
noeq
type lock (p:vprop) = | Lock: r: ref bool -> i: inv (lockinv p r) -> lock p
val intro_lockinv_available (#uses:inames) (p:vprop) (r:ref bool)
: SteelGhostT unit uses (pts_to r full_perm available `star` p) (fun _ -> lockinv p r)
val intro_lockinv_locked (#uses:inames) (p:vprop) (r:ref bool)
: SteelGhostT unit uses (pts_to r full_perm locked) (fun _ -> lockinv p r)
let intro_lockinv_available #uses p r =
intro_exists false
(fun (b: bool) ->
pts_to r full_perm b `star`
(if b then emp else p)
)
let intro_lockinv_locked #uses p r =
intro_exists true
(fun b -> pts_to r full_perm b `star`
(if b then emp else p))
let new_lock (p:vprop)
: SteelT (lock p) p (fun _ -> emp) =
let r = alloc_pt available in
intro_lockinv_available p r;
let i:inv (lockinv p r) = new_invariant (lockinv p r) in
return (Lock r i)
val acquire_core (#p:vprop) (#u:inames) (r:ref bool) (i:inv (lockinv p r))
: SteelAtomicT bool u
(lockinv p r `star` emp)
(fun b -> lockinv p r `star` (if b then p else emp))
let acquire_core #p #u r i =
let ghost = witness_exists () in
let res = cas_pt_bool r ghost available locked in
(* Not sure we can avoid calling an SMT here. Better force the manual call? *)
rewrite_slprop (if (Ghost.reveal ghost) then emp else p) (if res then p else emp)
(fun _ -> ());
rewrite_slprop (if res then pts_to r full_perm (Ghost.hide locked) else pts_to r full_perm ghost) (pts_to r full_perm locked) (fun _ -> ());
intro_lockinv_locked p r;
return res
let rec acquire #p l =
let r:ref bool = l.r in
let i: inv (lockinv p r) = l.i in
let b = with_invariant i (fun _ -> acquire_core r i) in
if b then (
rewrite_slprop (if b then p else emp) p (fun _ -> ());
noop ()
) else (
rewrite_slprop (if b then p else emp) emp (fun _ -> ());
acquire l
)
val release_core (#p:vprop) (#u:inames) (r:ref bool) (i:inv (lockinv p r))
: SteelAtomicT bool u
(lockinv p r `star` p)
(fun b -> lockinv p r `star` (if b then emp else p))
let release_core #p #u r i =
let v = witness_exists () in
let res = cas_pt_bool r v locked available in
(* Not sure we can avoid calling an SMT here. Better force the manual call? *)
rewrite_slprop (if (Ghost.reveal v) then emp else p) (if res then emp else p)
(fun _ -> ());
rewrite_slprop (if res then pts_to r full_perm (Ghost.hide available) else pts_to r full_perm v) (pts_to r full_perm available) (fun _ -> ());
intro_lockinv_available p r;
return res
let release (#p:vprop) (l:lock p) =
let r:ref bool = l.r in
let i: inv (lockinv p r) = l.i in
let b = with_invariant i (fun _ -> release_core r i) in
drop (if b then emp else p) | {
"checked_file": "/",
"dependencies": [
"Steel.Reference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.SpinLock.fst"
} | [
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Reference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
p: Steel.Effect.Common.vprop ->
pred: (_: Steel.Effect.Common.normal (Steel.Effect.Common.t_of p) -> Prims.prop)
-> Type0 | Prims.Tot | [
"total"
] | [] | [
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.normal",
"Steel.Effect.Common.t_of",
"Prims.prop",
"Steel.SpinLock.lock",
"Steel.Effect.Common.vrefine"
] | [] | false | false | false | false | true | let s_lock p pred =
| lock (p `vrefine` pred) | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.lemma_pow_pow_mod | val lemma_pow_pow_mod: f:S.felem -> a:nat -> b:nat ->
Lemma (M.pow (M.pow f a % S.prime) b % S.prime == M.pow f (a * b) % S.prime) | val lemma_pow_pow_mod: f:S.felem -> a:nat -> b:nat ->
Lemma (M.pow (M.pow f a % S.prime) b % S.prime == M.pow f (a * b) % S.prime) | let lemma_pow_pow_mod f a b =
calc (==) {
M.pow (M.pow f a % S.prime) b % S.prime;
(==) { M.lemma_pow_mod_base (M.pow f a) b S.prime }
M.pow (M.pow f a) b % S.prime;
(==) { M.lemma_pow_mul f a b }
M.pow f (a * b) % S.prime;
} | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 5,
"end_line": 114,
"start_col": 0,
"start_line": 107
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime
let mk_to_nat_mod_comm_monoid : SE.to_comm_monoid S.felem = {
SE.a_spec = S.felem;
SE.comm_monoid = nat_mod_comm_monoid;
SE.refl = (fun (x:S.felem) -> x);
}
val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid
let one_mod _ = 1
val mul_mod : SE.mul_st S.felem mk_to_nat_mod_comm_monoid
let mul_mod x y = S.fmul x y
val sqr_mod : SE.sqr_st S.felem mk_to_nat_mod_comm_monoid
let sqr_mod x = S.fmul x x
let mk_nat_mod_concrete_ops : SE.concrete_ops S.felem = {
SE.to = mk_to_nat_mod_comm_monoid;
SE.one = one_mod;
SE.mul = mul_mod;
SE.sqr = sqr_mod;
}
let fsquare_times (a:S.felem) (b:nat) : S.felem =
SE.exp_pow2 mk_nat_mod_concrete_ops a b
val fsquare_times_lemma: a:S.felem -> b:nat ->
Lemma (fsquare_times a b == M.pow a (pow2 b) % S.prime)
let fsquare_times_lemma a b =
SE.exp_pow2_lemma mk_nat_mod_concrete_ops a b;
LE.exp_pow2_lemma nat_mod_comm_monoid a b;
assert (fsquare_times a b == LE.pow nat_mod_comm_monoid a (pow2 b));
M.lemma_pow_nat_mod_is_pow #S.prime a (pow2 b)
(**
The algorithm is taken from
https://briansmith.org/ecc-inversion-addition-chains-01
*)
val finv: f:S.felem -> S.felem
let finv f =
let x2 = S.fmul (fsquare_times f 1) f in
let x3 = S.fmul (fsquare_times x2 1) f in
let x6 = S.fmul (fsquare_times x3 3) x3 in
let x12 = S.fmul (fsquare_times x6 6) x6 in
let x15 = S.fmul (fsquare_times x12 3) x3 in
let x30 = S.fmul (fsquare_times x15 15) x15 in
let x32 = S.fmul (fsquare_times x30 2) x2 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x192 = S.fmul (fsquare_times x64 128) x32 in
let x224 = S.fmul (fsquare_times x192 32) x32 in
let x254 = S.fmul (fsquare_times x224 30) x30 in
let x256 = S.fmul (fsquare_times x254 2) f in
x256
val fsqrt: f:S.felem -> S.felem
let fsqrt f =
let x2 = S.fmul (fsquare_times f 1) f in
let x4 = S.fmul (fsquare_times x2 2) x2 in
let x8 = S.fmul (fsquare_times x4 4) x4 in
let x16 = S.fmul (fsquare_times x8 8) x8 in
let x32 = S.fmul (fsquare_times x16 16) x16 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x160 = S.fmul (fsquare_times x64 96) f in
let x254 = fsquare_times x160 94 in
x254
// TODO: mv to lib/
val lemma_pow_mod_1: f:S.felem -> Lemma (f == M.pow f 1 % S.prime)
let lemma_pow_mod_1 f =
M.lemma_pow1 f;
Math.Lemmas.small_mod f S.prime;
assert_norm (pow2 0 = 1);
assert (f == M.pow f 1 % S.prime)
val lemma_pow_mod_mul: f:S.felem -> a:nat -> b:nat ->
Lemma (S.fmul (M.pow f a % S.prime) (M.pow f b % S.prime) == M.pow f (a + b) % S.prime)
let lemma_pow_mod_mul f a b =
calc (==) {
S.fmul (M.pow f a % S.prime) (M.pow f b % S.prime);
(==) {
Math.Lemmas.lemma_mod_mul_distr_l (M.pow f a) (M.pow f b % S.prime) S.prime;
Math.Lemmas.lemma_mod_mul_distr_r (M.pow f a) (M.pow f b) S.prime }
M.pow f a * M.pow f b % S.prime;
(==) { M.lemma_pow_add f a b }
M.pow f (a + b) % S.prime;
}
val lemma_pow_pow_mod: f:S.felem -> a:nat -> b:nat -> | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: Spec.P256.PointOps.felem -> a: Prims.nat -> b: Prims.nat
-> FStar.Pervasives.Lemma
(ensures
Lib.NatMod.pow (Lib.NatMod.pow f a % Spec.P256.PointOps.prime) b % Spec.P256.PointOps.prime ==
Lib.NatMod.pow f (a * b) % Spec.P256.PointOps.prime) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.felem",
"Prims.nat",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Prims.op_Modulus",
"Lib.NatMod.pow",
"Spec.P256.PointOps.prime",
"FStar.Mul.op_Star",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"Lib.NatMod.lemma_pow_mod_base",
"Prims.squash",
"Lib.NatMod.lemma_pow_mul"
] | [] | false | false | true | false | false | let lemma_pow_pow_mod f a b =
| calc ( == ) {
M.pow (M.pow f a % S.prime) b % S.prime;
( == ) { M.lemma_pow_mod_base (M.pow f a) b S.prime }
M.pow (M.pow f a) b % S.prime;
( == ) { M.lemma_pow_mul f a b }
M.pow f (a * b) % S.prime;
} | false |
Spec.FFDHE.fst | Spec.FFDHE.ffdhe_p6144 | val ffdhe_p6144:lseq pub_uint8 768 | val ffdhe_p6144:lseq pub_uint8 768 | let ffdhe_p6144: lseq pub_uint8 768 = of_list list_ffdhe_p6144 | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 62,
"end_line": 330,
"start_col": 0,
"start_line": 330
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58u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y; 0x6Auy; 0xDAuy; 0xB7uy; 0x60uy; 0xD7uy; 0xF4uy; 0x68uy;
0x1Duy; 0x4Fuy; 0x42uy; 0xA3uy; 0xDEuy; 0x39uy; 0x4Duy; 0xF4uy;
0xAEuy; 0x56uy; 0xEDuy; 0xE7uy; 0x63uy; 0x72uy; 0xBBuy; 0x19uy;
0x0Buy; 0x07uy; 0xA7uy; 0xC8uy; 0xEEuy; 0x0Auy; 0x6Duy; 0x70uy;
0x9Euy; 0x02uy; 0xFCuy; 0xE1uy; 0xCDuy; 0xF7uy; 0xE2uy; 0xECuy;
0xC0uy; 0x34uy; 0x04uy; 0xCDuy; 0x28uy; 0x34uy; 0x2Fuy; 0x61uy;
0x91uy; 0x72uy; 0xFEuy; 0x9Cuy; 0xE9uy; 0x85uy; 0x83uy; 0xFFuy;
0x8Euy; 0x4Fuy; 0x12uy; 0x32uy; 0xEEuy; 0xF2uy; 0x81uy; 0x83uy;
0xC3uy; 0xFEuy; 0x3Buy; 0x1Buy; 0x4Cuy; 0x6Fuy; 0xADuy; 0x73uy;
0x3Buy; 0xB5uy; 0xFCuy; 0xBCuy; 0x2Euy; 0xC2uy; 0x20uy; 0x05uy;
0xC5uy; 0x8Euy; 0xF1uy; 0x83uy; 0x7Duy; 0x16uy; 0x83uy; 0xB2uy;
0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"]
inline_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dhe_p3072
// The estimated symmetric-equivalent strength of this group is 125 bits.
let ffdhe_params_3072 : ffdhe_params_t =
Mk_ffdhe_params 384 ffdhe_p3072 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p4096: List.Tot.llist pub_uint8 512 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy; 0x57uy; 0xC9uy; 0x35uy;
0x98uy; 0x4Fuy; 0x0Cuy; 0x70uy; 0xE0uy; 0xE6uy; 0x8Buy; 0x77uy;
0xE2uy; 0xA6uy; 0x89uy; 0xDAuy; 0xF3uy; 0xEFuy; 0xE8uy; 0x72uy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xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 512);
l
let ffdhe_p4096: lseq pub_uint8 512 = of_list list_ffdhe_p4096
// The estimated symmetric-equivalent strength of this group is 150 bits.
let ffdhe_params_4096 : ffdhe_params_t =
Mk_ffdhe_params 512 ffdhe_p4096 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p6144: List.Tot.llist pub_uint8 768 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy; 0x57uy; 0xC9uy; 0x35uy;
0x98uy; 0x4Fuy; 0x0Cuy; 0x70uy; 0xE0uy; 0xE6uy; 0x8Buy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Fuy
] in
assert_norm (List.Tot.length l == 768);
l | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.PUB) 768 | Prims.Tot | [
"total"
] | [] | [
"Lib.Sequence.of_list",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.PUB",
"Spec.FFDHE.list_ffdhe_p6144"
] | [] | false | false | false | false | false | let ffdhe_p6144:lseq pub_uint8 768 =
| of_list list_ffdhe_p6144 | false |
FStar.List.fst | FStar.List.hd | val hd: list 'a -> ML 'a | val hd: list 'a -> ML 'a | let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list" | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 38,
"end_line": 34,
"start_col": 0,
"start_line": 32
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.list 'a -> FStar.All.ML 'a | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"FStar.All.failwith"
] | [] | false | true | false | false | false | let hd =
| function
| hd :: tl -> hd
| _ -> failwith "head of empty list" | false |
FStar.List.fst | FStar.List.tail | val tail: list 'a -> ML (list 'a) | val tail: list 'a -> ML (list 'a) | let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list" | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 38,
"end_line": 43,
"start_col": 0,
"start_line": 41
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.list 'a -> FStar.All.ML (Prims.list 'a) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"FStar.All.failwith"
] | [] | false | true | false | false | false | let tail =
| function
| hd :: tl -> tl
| _ -> failwith "tail of empty list" | false |
FStar.List.fst | FStar.List.tl | val tl : list 'a -> ML (list 'a) | val tl : list 'a -> ML (list 'a) | let tl l = tail l | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 17,
"end_line": 50,
"start_col": 0,
"start_line": 50
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | l: Prims.list 'a -> FStar.All.ML (Prims.list 'a) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"FStar.List.tail"
] | [] | false | true | false | false | false | let tl l =
| tail l | false |
FStar.List.fst | FStar.List.init | val init: list 'a -> ML (list 'a) | val init: list 'a -> ML (list 'a) | let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list" | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 38,
"end_line": 68,
"start_col": 0,
"start_line": 65
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.list 'a -> FStar.All.ML (Prims.list 'a) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"Prims.Nil",
"Prims.Cons",
"FStar.List.init",
"FStar.All.failwith"
] | [
"recursion"
] | false | true | false | false | false | let rec init =
| function
| [_] -> []
| hd :: tl -> hd :: (init tl)
| _ -> failwith "init of empty list" | false |
FStar.List.fst | FStar.List.last | val last: list 'a -> ML 'a | val last: list 'a -> ML 'a | let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list" | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 38,
"end_line": 59,
"start_col": 0,
"start_line": 56
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.list 'a -> FStar.All.ML 'a | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"FStar.List.last",
"FStar.All.failwith"
] | [
"recursion"
] | false | true | false | false | false | let rec last =
| function
| [hd] -> hd
| _ :: tl -> last tl
| _ -> failwith "last of empty list" | false |
FStar.List.fst | FStar.List.iteri | val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit | val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit | let iteri f x = iteri_aux 0 f x | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 31,
"end_line": 109,
"start_col": 0,
"start_line": 109
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: Prims.int -> _: 'a -> FStar.All.ML Prims.unit) -> x: Prims.list 'a -> FStar.All.ML Prims.unit | FStar.All.ML | [
"ml"
] | [] | [
"Prims.int",
"Prims.unit",
"Prims.list",
"FStar.List.iteri_aux"
] | [] | false | true | false | false | false | let iteri f x =
| iteri_aux 0 f x | false |
Spec.FFDHE.fst | Spec.FFDHE.list_ffdhe_p6144 | val list_ffdhe_p6144:List.Tot.llist pub_uint8 768 | val list_ffdhe_p6144:List.Tot.llist pub_uint8 768 | let list_ffdhe_p6144: List.Tot.llist pub_uint8 768 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0Cuy; 0x75uy; 0xD8uy;
0xF6uy; 0x81uy; 0xB2uy; 0x02uy; 0xAEuy; 0xC4uy; 0x61uy; 0x7Auy;
0xD3uy; 0xDFuy; 0x1Euy; 0xD5uy; 0xD5uy; 0xFDuy; 0x65uy; 0x61uy;
0x24uy; 0x33uy; 0xF5uy; 0x1Fuy; 0x5Fuy; 0x06uy; 0x6Euy; 0xD0uy;
0x85uy; 0x63uy; 0x65uy; 0x55uy; 0x3Duy; 0xEDuy; 0x1Auy; 0xF3uy;
0xB5uy; 0x57uy; 0x13uy; 0x5Euy; 0x7Fuy; 0x57uy; 0xC9uy; 0x35uy;
0x98uy; 0x4Fuy; 0x0Cuy; 0x70uy; 0xE0uy; 0xE6uy; 0x8Buy; 0x77uy;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ert_norm (List.Tot.length l == 768);
l | {
"file_name": "specs/Spec.FFDHE.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 328,
"start_col": 0,
"start_line": 227
} | module Spec.FFDHE
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
(** https://tools.ietf.org/html/rfc7919#appendix-A *)
noeq type ffdhe_params_t =
| Mk_ffdhe_params:
ffdhe_p_len:size_nat
-> ffdhe_p:lseq pub_uint8 ffdhe_p_len
-> ffdhe_g_len:size_nat
-> ffdhe_g:lseq pub_uint8 ffdhe_g_len
-> ffdhe_params_t
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_g2: List.Tot.llist pub_uint8 1 =
[@inline_let]
let l = [ 0x02uy ] in
assert_norm (List.Tot.length l == 1);
l
let ffdhe_g2: lseq pub_uint8 1 = of_list list_ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p2048: List.Tot.llist pub_uint8 256 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy; 0x41uy; 0x14uy; 0x64uy; 0x33uy; 0xFBuy;
0xCCuy; 0x93uy; 0x9Duy; 0xCEuy; 0x24uy; 0x9Buy; 0x3Euy; 0xF9uy;
0x7Duy; 0x2Fuy; 0xE3uy; 0x63uy; 0x63uy; 0x0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04uy; 0xCDuy; 0x28uy; 0x34uy; 0x2Fuy; 0x61uy;
0x91uy; 0x72uy; 0xFEuy; 0x9Cuy; 0xE9uy; 0x85uy; 0x83uy; 0xFFuy;
0x8Euy; 0x4Fuy; 0x12uy; 0x32uy; 0xEEuy; 0xF2uy; 0x81uy; 0x83uy;
0xC3uy; 0xFEuy; 0x3Buy; 0x1Buy; 0x4Cuy; 0x6Fuy; 0xADuy; 0x73uy;
0x3Buy; 0xB5uy; 0xFCuy; 0xBCuy; 0x2Euy; 0xC2uy; 0x20uy; 0x05uy;
0xC5uy; 0x8Euy; 0xF1uy; 0x83uy; 0x7Duy; 0x16uy; 0x83uy; 0xB2uy;
0xC6uy; 0xF3uy; 0x4Auy; 0x26uy; 0xC1uy; 0xB2uy; 0xEFuy; 0xFAuy;
0x88uy; 0x6Buy; 0x42uy; 0x38uy; 0x61uy; 0x28uy; 0x5Cuy; 0x97uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 256);
l
let ffdhe_p2048: lseq pub_uint8 256 = of_list list_ffdhe_p2048
// The estimated symmetric-equivalent strength of this group is 103 bits.
let ffdhe_params_2048 : ffdhe_params_t =
Mk_ffdhe_params 256 ffdhe_p2048 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p3072: List.Tot.llist pub_uint8 384 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27uy; 0x3Duy; 0x3Cuy; 0xF1uy;
0xD8uy; 0xB9uy; 0xC5uy; 0x83uy; 0xCEuy; 0x2Duy; 0x36uy; 0x95uy;
0xA9uy; 0xE1uy; 0x36uy;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 0x43uy; 0x79uy; 0x44uy;
0xF4uy; 0xFDuy; 0x44uy; 0x52uy; 0xE2uy; 0xD7uy; 0x4Duy; 0xD3uy;
0x64uy; 0xF2uy; 0xE2uy; 0x1Euy; 0x71uy; 0xF5uy; 0x4Buy; 0xFFuy;
0x5Cuy; 0xAEuy; 0x82uy; 0xABuy; 0x9Cuy; 0x9Duy; 0xF6uy; 0x9Euy;
0xE8uy; 0x6Duy; 0x2Buy; 0xC5uy; 0x22uy; 0x36uy; 0x3Auy; 0x0Duy;
0xABuy; 0xC5uy; 0x21uy; 0x97uy; 0x9Buy; 0x0Duy; 0xEAuy; 0xDAuy;
0x1Duy; 0xBFuy; 0x9Auy; 0x42uy; 0xD5uy; 0xC4uy; 0x48uy; 0x4Euy;
0x0Auy; 0xBCuy; 0xD0uy; 0x6Buy; 0xFAuy; 0x53uy; 0xDDuy; 0xEFuy;
0x3Cuy; 0x1Buy; 0x20uy; 0xEEuy; 0x3Fuy; 0xD5uy; 0x9Duy; 0x7Cuy;
0x25uy; 0xE4uy; 0x1Duy; 0x2Buy; 0x66uy; 0xC6uy; 0x2Euy; 0x37uy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 384);
l
let ffdhe_p3072: lseq pub_uint8 384 = of_list list_ffdhe_p3072
// The estimated symmetric-equivalent strength of this group is 125 bits.
let ffdhe_params_3072 : ffdhe_params_t =
Mk_ffdhe_params 384 ffdhe_p3072 1 ffdhe_g2
[@"opaque_to_smt"]
inline_for_extraction
let list_ffdhe_p4096: List.Tot.llist pub_uint8 512 =
[@inline_let]
let l = [
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy;
0xADuy; 0xF8uy; 0x54uy; 0x58uy; 0xA2uy; 0xBBuy; 0x4Auy; 0x9Auy;
0xAFuy; 0xDCuy; 0x56uy; 0x20uy; 0x27u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 0x86uy; 0xEFuy; 0xB4uy; 0x31uy; 0x8Auy;
0xEDuy; 0x6Auy; 0x1Euy; 0x01uy; 0x2Duy; 0x9Euy; 0x68uy; 0x32uy;
0xA9uy; 0x07uy; 0x60uy; 0x0Auy; 0x91uy; 0x81uy; 0x30uy; 0xC4uy;
0x6Duy; 0xC7uy; 0x78uy; 0xF9uy; 0x71uy; 0xADuy; 0x00uy; 0x38uy;
0x09uy; 0x29uy; 0x99uy; 0xA3uy; 0x33uy; 0xCBuy; 0x8Buy; 0x7Auy;
0x1Auy; 0x1Duy; 0xB9uy; 0x3Duy; 0x71uy; 0x40uy; 0x00uy; 0x3Cuy;
0x2Auy; 0x4Euy; 0xCEuy; 0xA9uy; 0xF9uy; 0x8Duy; 0x0Auy; 0xCCuy;
0x0Auy; 0x82uy; 0x91uy; 0xCDuy; 0xCEuy; 0xC9uy; 0x7Duy; 0xCFuy;
0x8Euy; 0xC9uy; 0xB5uy; 0x5Auy; 0x7Fuy; 0x88uy; 0xA4uy; 0x6Buy;
0x4Duy; 0xB5uy; 0xA8uy; 0x51uy; 0xF4uy; 0x41uy; 0x82uy; 0xE1uy;
0xC6uy; 0x8Auy; 0x00uy; 0x7Euy; 0x5Euy; 0x65uy; 0x5Fuy; 0x6Auy;
0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
] in
assert_norm (List.Tot.length l == 512);
l
let ffdhe_p4096: lseq pub_uint8 512 = of_list list_ffdhe_p4096
// The estimated symmetric-equivalent strength of this group is 150 bits.
let ffdhe_params_4096 : ffdhe_params_t =
Mk_ffdhe_params 512 ffdhe_p4096 1 ffdhe_g2
[@"opaque_to_smt"] | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Spec.FFDHE.fst"
} | [
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "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
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.List.Tot.Properties.llist (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.PUB) 768 | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.int",
"FStar.List.Tot.Base.length",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.PUB",
"Prims.list",
"Prims.Cons",
"FStar.UInt8.__uint_to_t",
"Prims.Nil"
] | [] | false | false | false | false | false | let list_ffdhe_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uy;
0x47uy; 0xA6uy; 0x7Cuy; 0xBEuy; 0xF9uy; 0xC9uy; 0x09uy; 0x1Buy; 0x46uy; 0x2Duy; 0x53uy; 0x8Cuy;
0xD7uy; 0x2Buy; 0x03uy; 0x74uy; 0x6Auy; 0xE7uy; 0x7Fuy; 0x5Euy; 0x62uy; 0x29uy; 0x2Cuy; 0x31uy;
0x15uy; 0x62uy; 0xA8uy; 0x46uy; 0x50uy; 0x5Duy; 0xC8uy; 0x2Duy; 0xB8uy; 0x54uy; 0x33uy; 0x8Auy;
0xE4uy; 0x9Fuy; 0x52uy; 0x35uy; 0xC9uy; 0x5Buy; 0x91uy; 0x17uy; 0x8Cuy; 0xCFuy; 0x2Duy; 0xD5uy;
0xCAuy; 0xCEuy; 0xF4uy; 0x03uy; 0xECuy; 0x9Duy; 0x18uy; 0x10uy; 0xC6uy; 0x27uy; 0x2Buy; 0x04uy;
0x5Buy; 0x3Buy; 0x71uy; 0xF9uy; 0xDCuy; 0x6Buy; 0x80uy; 0xD6uy; 0x3Fuy; 0xDDuy; 0x4Auy; 0x8Euy;
0x9Auy; 0xDBuy; 0x1Euy; 0x69uy; 0x62uy; 0xA6uy; 0x95uy; 0x26uy; 0xD4uy; 0x31uy; 0x61uy; 0xC1uy;
0xA4uy; 0x1Duy; 0x57uy; 0x0Duy; 0x79uy; 0x38uy; 0xDAuy; 0xD4uy; 0xA4uy; 0x0Euy; 0x32uy; 0x9Cuy;
0xD0uy; 0xE4uy; 0x0Euy; 0x65uy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy; 0xFFuy
]
in
assert_norm (List.Tot.length l == 768);
l | false |
FStar.List.fst | FStar.List.mapT | val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b) | val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b) | let mapT = FStar.List.Tot.map | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 29,
"end_line": 124,
"start_col": 0,
"start_line": 124
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: (_: 'a -> 'b) -> _: Prims.list 'a -> Prims.list 'b | Prims.Tot | [
"total"
] | [] | [
"FStar.List.Tot.Base.map"
] | [] | false | false | false | true | false | let mapT =
| FStar.List.Tot.map | false |
FStar.List.fst | FStar.List.iter | val iter: ('a -> ML unit) -> list 'a -> ML unit | val iter: ('a -> ML unit) -> list 'a -> ML unit | let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 37,
"end_line": 96,
"start_col": 0,
"start_line": 94
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> FStar.All.ML Prims.unit) -> x: Prims.list 'a -> FStar.All.ML Prims.unit | FStar.All.ML | [
"ml"
] | [] | [
"Prims.unit",
"Prims.list",
"FStar.List.iter"
] | [
"recursion"
] | false | true | false | false | false | let rec iter f x =
| match x with
| [] -> ()
| a :: tl ->
let _ = f a in
iter f tl | false |
FStar.List.fst | FStar.List.mapi | val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b) | val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b) | let mapi f l = mapi_init f l 0 | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 30,
"end_line": 141,
"start_col": 0,
"start_line": 141
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: Prims.int -> _: 'a -> FStar.All.ML 'b) -> l: Prims.list 'a -> FStar.All.ML (Prims.list 'b) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.int",
"Prims.list",
"FStar.List.mapi_init"
] | [] | false | true | false | false | false | let mapi f l =
| mapi_init f l 0 | false |
Duplex.PingPong.fst | Duplex.PingPong.client | val client (c: ch) : SteelT unit (ep A c pingpong) (fun _ -> ep A c done) | val client (c: ch) : SteelT unit (ep A c pingpong) (fun _ -> ep A c done) | let client (c:ch)
: SteelT unit
(ep A c pingpong)
(fun _ -> ep A c done)
= // In this implementation, the client first sends the (arbitrarily chosen) integer 17
channel_send #A c 17;
let y = channel_recv #A c in
// The protocol specifies that the integer received is greater than the one sent.
// This fact is available in the context and can be asserted.
assert (y > 17) | {
"file_name": "share/steel/examples/steel/Duplex.PingPong.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 19,
"end_line": 27,
"start_col": 0,
"start_line": 18
} | module Duplex.PingPong
open FStar.PCM
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.Channel.Protocol
open Duplex.PCM
////////////////////////////////////////////////////////////////////////////////
// An example
////////////////////////////////////////////////////////////////////////////////
let pingpong : dprot =
x <-- send int;
y <-- recv (y:int{y > x});
done | {
"checked_file": "/",
"dependencies": [
"Steel.Memory.fsti.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"Steel.Channel.Protocol.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"Duplex.PCM.fsti.checked"
],
"interface_file": false,
"source_file": "Duplex.PingPong.fst"
} | [
{
"abbrev": false,
"full_module": "Duplex.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Channel.Protocol",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Duplex",
"short_module": null
},
{
"abbrev": false,
"full_module": "Duplex",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | c: Duplex.PCM.ch -> Steel.Effect.SteelT Prims.unit | Steel.Effect.SteelT | [] | [] | [
"Duplex.PCM.ch",
"Prims._assert",
"Prims.b2t",
"Prims.op_GreaterThan",
"Prims.unit",
"Steel.Channel.Protocol.msg_t",
"Steel.Channel.Protocol.step",
"Duplex.PingPong.pingpong",
"Duplex.PCM.channel_recv",
"Duplex.PCM.A",
"Duplex.PCM.channel_send",
"Duplex.PCM.ep",
"Duplex.PCM.done",
"Steel.Effect.Common.vprop"
] | [] | false | true | false | false | false | let client (c: ch) : SteelT unit (ep A c pingpong) (fun _ -> ep A c done) =
| channel_send #A c 17;
let y = channel_recv #A c in
assert (y > 17) | false |
FStar.List.fst | FStar.List.map2 | val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c) | val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c) | let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length" | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 62,
"end_line": 166,
"start_col": 0,
"start_line": 163
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> _: 'b -> FStar.All.ML 'c) -> l1: Prims.list 'a -> l2: Prims.list 'b
-> FStar.All.ML (Prims.list 'c) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"FStar.Pervasives.Native.Mktuple2",
"Prims.Nil",
"Prims.Cons",
"FStar.List.map2",
"FStar.All.failwith"
] | [
"recursion"
] | false | true | false | false | false | let rec map2 f l1 l2 =
| match l1, l2 with
| [], [] -> []
| hd1 :: tl1, hd2 :: tl2 -> (f hd1 hd2) :: (map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length" | false |
FStar.List.fst | FStar.List.map3 | val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd) | val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd) | let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length" | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 65,
"end_line": 177,
"start_col": 0,
"start_line": 174
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
f: (_: 'a -> _: 'b -> _: 'c -> FStar.All.ML 'd) ->
l1: Prims.list 'a ->
l2: Prims.list 'b ->
l3: Prims.list 'c
-> FStar.All.ML (Prims.list 'd) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"FStar.Pervasives.Native.Mktuple3",
"Prims.Nil",
"Prims.Cons",
"FStar.List.map3",
"FStar.All.failwith"
] | [
"recursion"
] | false | true | false | false | false | let rec map3 f l1 l2 l3 =
| match l1, l2, l3 with
| [], [], [] -> []
| hd1 :: tl1, hd2 :: tl2, hd3 :: tl3 -> (f hd1 hd2 hd3) :: (map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length" | false |
FStar.List.fst | FStar.List.fold_left2 | val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's | val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's | let rec fold_left2 f a l1 l2 = match l1, l2 with
| [], [] -> a
| hd1::tl1, hd2::tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length" | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 62,
"end_line": 196,
"start_col": 0,
"start_line": 193
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *)
val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a
let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl
(** [fold_left2 f x [y1; y2; ...; yn] [z1; z2; ...; zn]] computes (f
(... (f x y1 z1) y2 z2 ... yn zn). Raises an exception if [y1; y2;
...] and [z1; z2; ...] have different lengths. (Thus, hides
[List.Tot.fold_left2] which requires such a condition at type-checking
time.) Named as in: OCaml *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 's -> _: 'a -> _: 'b -> FStar.All.ML 's) -> a: 's -> l1: Prims.list 'a -> l2: Prims.list 'b
-> FStar.All.ML 's | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"FStar.Pervasives.Native.Mktuple2",
"FStar.List.fold_left2",
"FStar.All.failwith"
] | [
"recursion"
] | false | true | false | false | false | let rec fold_left2 f a l1 l2 =
| match l1, l2 with
| [], [] -> a
| hd1 :: tl1, hd2 :: tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length" | false |
FStar.List.fst | FStar.List.forall2 | val forall2: ('a -> 'b -> ML bool) -> list 'a -> list 'b -> ML bool | val forall2: ('a -> 'b -> ML bool) -> list 'a -> list 'b -> ML bool | let rec forall2 f l1 l2 = match l1,l2 with
| [], [] -> true
| hd1::tl1, hd2::tl2 -> if f hd1 hd2 then forall2 f tl1 tl2 else false
| _, _ -> failwith "The lists do not have the same length" | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 62,
"end_line": 236,
"start_col": 0,
"start_line": 233
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *)
val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a
let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl
(** [fold_left2 f x [y1; y2; ...; yn] [z1; z2; ...; zn]] computes (f
(... (f x y1 z1) y2 z2 ... yn zn). Raises an exception if [y1; y2;
...] and [z1; z2; ...] have different lengths. (Thus, hides
[List.Tot.fold_left2] which requires such a condition at type-checking
time.) Named as in: OCaml *)
val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's
let rec fold_left2 f a l1 l2 = match l1, l2 with
| [], [] -> a
| hd1::tl1, hd2::tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length"
(** [fold_right f [x1; x2; ...; xn] y] computes (f x1 (f x2 (... (f xn
y)) ... )). (Hides [List.Tot.fold_right], which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val fold_right: ('a -> 'b -> ML 'b) -> list 'a -> 'b -> ML 'b
let rec fold_right f l x = match l with
| [] -> x
| hd::tl -> f hd (fold_right f tl x)
(** List searching **)
(** [filter f l] returns [l] with all elements [x] such that [f x]
does not hold removed. (Hides [List.Tot.filter] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val filter: ('a -> ML bool) -> list 'a -> ML (list 'a)
let rec filter f = function
| [] -> []
| hd::tl -> if f hd then hd::(filter f tl) else filter f tl
(** [for_all f l] returns [true] if, and only if, for all elements [x]
appearing in [l], [f x] holds. (Hides [List.Tot.for_all], which
requires, at type-checking time, [f] to be a pure total function.)
Named as in: OCaml. Similar to: List.forallb in Coq *)
val for_all: ('a -> ML bool) -> list 'a -> ML bool
let rec for_all f l = match l with
| [] -> true
| hd::tl -> if f hd then for_all f tl else false
(** [for_all f l1 l2] returns [true] if, and only if, for all elements
[x1] appearing in [l1] and the element [x2] appearing in [l2] at the
same position, [f x1 x2] holds. Raises an exception if [l1] and [l2]
have different lengths. Similar to: List.for_all2 in OCaml. Similar
to: List.Forall2 in Coq (which is propositional) *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> _: 'b -> FStar.All.ML Prims.bool) -> l1: Prims.list 'a -> l2: Prims.list 'b
-> FStar.All.ML Prims.bool | FStar.All.ML | [
"ml"
] | [] | [
"Prims.bool",
"Prims.list",
"FStar.Pervasives.Native.Mktuple2",
"FStar.List.forall2",
"FStar.All.failwith"
] | [
"recursion"
] | false | true | false | false | false | let rec forall2 f l1 l2 =
| match l1, l2 with
| [], [] -> true
| hd1 :: tl1, hd2 :: tl2 -> if f hd1 hd2 then forall2 f tl1 tl2 else false
| _, _ -> failwith "The lists do not have the same length" | false |
FStar.List.fst | FStar.List.map | val map: ('a -> ML 'b) -> list 'a -> ML (list 'b) | val map: ('a -> ML 'b) -> list 'a -> ML (list 'b) | let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 26,
"end_line": 118,
"start_col": 0,
"start_line": 116
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> FStar.All.ML 'b) -> x: Prims.list 'a -> FStar.All.ML (Prims.list 'b) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"Prims.Nil",
"Prims.Cons",
"FStar.List.map"
] | [
"recursion"
] | false | true | false | false | false | let rec map f x =
| match x with
| [] -> []
| a :: tl -> f a :: map f tl | false |
FStar.List.fst | FStar.List.nth | val nth: list 'a -> int -> ML 'a | val nth: list 'a -> int -> ML 'a | let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1) | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 33,
"end_line": 87,
"start_col": 0,
"start_line": 76
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | l: Prims.list 'a -> n: Prims.int -> FStar.All.ML 'a | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"Prims.int",
"Prims.op_LessThan",
"FStar.All.failwith",
"Prims.bool",
"Prims.op_Equality",
"FStar.List.nth",
"Prims.op_Subtraction"
] | [
"recursion"
] | false | true | false | false | false | let rec nth l n =
| if n < 0
then failwith "nth takes a non-negative integer as input"
else
if n = 0
then
match l with
| [] -> failwith "not enough elements"
| hd :: _ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _ :: tl -> nth tl (n - 1) | false |
FStar.List.fst | FStar.List.iteri_aux | val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit | val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit | let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 40,
"end_line": 103,
"start_col": 0,
"start_line": 101
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | i: Prims.int -> f: (_: Prims.int -> _: 'a -> FStar.All.ML Prims.unit) -> x: Prims.list 'a
-> FStar.All.ML Prims.unit | FStar.All.ML | [
"ml"
] | [] | [
"Prims.int",
"Prims.unit",
"Prims.list",
"FStar.List.iteri_aux",
"Prims.op_Addition"
] | [
"recursion"
] | false | true | false | false | false | let rec iteri_aux i f x =
| match x with
| [] -> ()
| a :: tl ->
f i a;
iteri_aux (i + 1) f tl | false |
Hacl.Spec.P256.Finv.fst | Hacl.Spec.P256.Finv.lemma_pow_mod_mul | val lemma_pow_mod_mul: f:S.felem -> a:nat -> b:nat ->
Lemma (S.fmul (M.pow f a % S.prime) (M.pow f b % S.prime) == M.pow f (a + b) % S.prime) | val lemma_pow_mod_mul: f:S.felem -> a:nat -> b:nat ->
Lemma (S.fmul (M.pow f a % S.prime) (M.pow f b % S.prime) == M.pow f (a + b) % S.prime) | let lemma_pow_mod_mul f a b =
calc (==) {
S.fmul (M.pow f a % S.prime) (M.pow f b % S.prime);
(==) {
Math.Lemmas.lemma_mod_mul_distr_l (M.pow f a) (M.pow f b % S.prime) S.prime;
Math.Lemmas.lemma_mod_mul_distr_r (M.pow f a) (M.pow f b) S.prime }
M.pow f a * M.pow f b % S.prime;
(==) { M.lemma_pow_add f a b }
M.pow f (a + b) % S.prime;
} | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Finv.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 102,
"start_col": 0,
"start_line": 93
} | module Hacl.Spec.P256.Finv
open FStar.Mul
module SE = Spec.Exponentiation
module LE = Lib.Exponentiation
module M = Lib.NatMod
module S = Spec.P256
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let nat_mod_comm_monoid = M.mk_nat_mod_comm_monoid S.prime
let mk_to_nat_mod_comm_monoid : SE.to_comm_monoid S.felem = {
SE.a_spec = S.felem;
SE.comm_monoid = nat_mod_comm_monoid;
SE.refl = (fun (x:S.felem) -> x);
}
val one_mod : SE.one_st S.felem mk_to_nat_mod_comm_monoid
let one_mod _ = 1
val mul_mod : SE.mul_st S.felem mk_to_nat_mod_comm_monoid
let mul_mod x y = S.fmul x y
val sqr_mod : SE.sqr_st S.felem mk_to_nat_mod_comm_monoid
let sqr_mod x = S.fmul x x
let mk_nat_mod_concrete_ops : SE.concrete_ops S.felem = {
SE.to = mk_to_nat_mod_comm_monoid;
SE.one = one_mod;
SE.mul = mul_mod;
SE.sqr = sqr_mod;
}
let fsquare_times (a:S.felem) (b:nat) : S.felem =
SE.exp_pow2 mk_nat_mod_concrete_ops a b
val fsquare_times_lemma: a:S.felem -> b:nat ->
Lemma (fsquare_times a b == M.pow a (pow2 b) % S.prime)
let fsquare_times_lemma a b =
SE.exp_pow2_lemma mk_nat_mod_concrete_ops a b;
LE.exp_pow2_lemma nat_mod_comm_monoid a b;
assert (fsquare_times a b == LE.pow nat_mod_comm_monoid a (pow2 b));
M.lemma_pow_nat_mod_is_pow #S.prime a (pow2 b)
(**
The algorithm is taken from
https://briansmith.org/ecc-inversion-addition-chains-01
*)
val finv: f:S.felem -> S.felem
let finv f =
let x2 = S.fmul (fsquare_times f 1) f in
let x3 = S.fmul (fsquare_times x2 1) f in
let x6 = S.fmul (fsquare_times x3 3) x3 in
let x12 = S.fmul (fsquare_times x6 6) x6 in
let x15 = S.fmul (fsquare_times x12 3) x3 in
let x30 = S.fmul (fsquare_times x15 15) x15 in
let x32 = S.fmul (fsquare_times x30 2) x2 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x192 = S.fmul (fsquare_times x64 128) x32 in
let x224 = S.fmul (fsquare_times x192 32) x32 in
let x254 = S.fmul (fsquare_times x224 30) x30 in
let x256 = S.fmul (fsquare_times x254 2) f in
x256
val fsqrt: f:S.felem -> S.felem
let fsqrt f =
let x2 = S.fmul (fsquare_times f 1) f in
let x4 = S.fmul (fsquare_times x2 2) x2 in
let x8 = S.fmul (fsquare_times x4 4) x4 in
let x16 = S.fmul (fsquare_times x8 8) x8 in
let x32 = S.fmul (fsquare_times x16 16) x16 in
let x64 = S.fmul (fsquare_times x32 32) f in
let x160 = S.fmul (fsquare_times x64 96) f in
let x254 = fsquare_times x160 94 in
x254
// TODO: mv to lib/
val lemma_pow_mod_1: f:S.felem -> Lemma (f == M.pow f 1 % S.prime)
let lemma_pow_mod_1 f =
M.lemma_pow1 f;
Math.Lemmas.small_mod f S.prime;
assert_norm (pow2 0 = 1);
assert (f == M.pow f 1 % S.prime)
val lemma_pow_mod_mul: f:S.felem -> a:nat -> b:nat -> | {
"checked_file": "/",
"dependencies": [
"Spec.P256.fst.checked",
"Spec.Exponentiation.fsti.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.P256.Finv.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.P256",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Lib.NatMod",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Lib.Exponentiation",
"short_module": "LE"
},
{
"abbrev": true,
"full_module": "Spec.Exponentiation",
"short_module": "SE"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: Spec.P256.PointOps.felem -> a: Prims.nat -> b: Prims.nat
-> FStar.Pervasives.Lemma
(ensures
Spec.P256.PointOps.fmul (Lib.NatMod.pow f a % Spec.P256.PointOps.prime)
(Lib.NatMod.pow f b % Spec.P256.PointOps.prime) ==
Lib.NatMod.pow f (a + b) % Spec.P256.PointOps.prime) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.felem",
"Prims.nat",
"FStar.Calc.calc_finish",
"Prims.eq2",
"Spec.P256.PointOps.fmul",
"Prims.op_Modulus",
"Lib.NatMod.pow",
"Spec.P256.PointOps.prime",
"Prims.op_Addition",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"FStar.Mul.op_Star",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"FStar.Math.Lemmas.lemma_mod_mul_distr_r",
"FStar.Math.Lemmas.lemma_mod_mul_distr_l",
"Prims.squash",
"Lib.NatMod.lemma_pow_add"
] | [] | false | false | true | false | false | let lemma_pow_mod_mul f a b =
| calc ( == ) {
S.fmul (M.pow f a % S.prime) (M.pow f b % S.prime);
( == ) { (Math.Lemmas.lemma_mod_mul_distr_l (M.pow f a) (M.pow f b % S.prime) S.prime;
Math.Lemmas.lemma_mod_mul_distr_r (M.pow f a) (M.pow f b) S.prime) }
M.pow f a * M.pow f b % S.prime;
( == ) { M.lemma_pow_add f a b }
M.pow f (a + b) % S.prime;
} | false |
FStar.List.fst | FStar.List.fold_left | val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a | val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a | let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 37,
"end_line": 185,
"start_col": 0,
"start_line": 183
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> _: 'b -> FStar.All.ML 'a) -> x: 'a -> y: Prims.list 'b -> FStar.All.ML 'a | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"FStar.List.fold_left"
] | [
"recursion"
] | false | true | false | false | false | let rec fold_left f x y =
| match y with
| [] -> x
| hd :: tl -> fold_left f (f x hd) tl | false |
FStar.List.fst | FStar.List.mapi_init | val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b) | val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b) | let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1)) | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 48,
"end_line": 133,
"start_col": 0,
"start_line": 131
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: Prims.int -> _: 'a -> FStar.All.ML 'b) -> l: Prims.list 'a -> i: Prims.int
-> FStar.All.ML (Prims.list 'b) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.int",
"Prims.list",
"Prims.Nil",
"Prims.Cons",
"FStar.List.mapi_init",
"Prims.op_Addition"
] | [
"recursion"
] | false | true | false | false | false | let rec mapi_init f l i =
| match l with
| [] -> []
| hd :: tl -> (f i hd) :: (mapi_init f tl (i + 1)) | false |
FStar.List.fst | FStar.List.concatMap | val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b) | val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b) | let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 12,
"end_line": 155,
"start_col": 0,
"start_line": 150
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> FStar.All.ML (Prims.list 'b)) -> _: Prims.list 'a -> FStar.All.ML (Prims.list 'b) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"Prims.Nil",
"FStar.List.Tot.Base.op_At",
"FStar.List.concatMap"
] | [
"recursion"
] | false | true | false | false | false | let rec concatMap f =
| function
| [] -> []
| a :: tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl | false |
Steel.GhostMonotonicHigherReference.fst | Steel.GhostMonotonicHigherReference.write | val write (#opened: _) (#a:Type) (#p:Preorder.preorder a) (#v:a)
(r:ref a p) (x:a)
: SteelGhost unit opened (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True) | val write (#opened: _) (#a:Type) (#p:Preorder.preorder a) (#v:a)
(r:ref a p) (x:a)
: SteelGhost unit opened (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True) | let write (#opened: _) (#a:Type) (#p:Preorder.preorder a) (#v:a)
(r:ref a p) (x:a)
: SteelGhost unit opened (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True)
= let h_old_e = witness_exists #_ #_ #(pts_to_body r full_perm v) () in
let _ = elim_pure r v h_old_e in
let h_old = read r in
let h: history a p = extend_history' h_old x in
write r h_old_e h;
intro_pure_full r x h | {
"file_name": "lib/steel/Steel.GhostMonotonicHigherReference.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 25,
"end_line": 110,
"start_col": 0,
"start_line": 97
} | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.GhostMonotonicHigherReference
open FStar.Ghost
open FStar.PCM
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.GhostPCMReference
open Steel.FractionalPermission
open Steel.Preorder
module Preorder = FStar.Preorder
module Q = Steel.Preorder
module M = Steel.Memory
module PR = Steel.GhostPCMReference
module A = Steel.Effect.Atomic
open FStar.Real
#set-options "--ide_id_info_off"
let ref a p = PR.ref (history a p) pcm_history
[@@__reduce__]
let pts_to_body #a #p (r:ref a p) (f:perm) (v:a) (h:history a p) =
PR.pts_to r h `star`
pure (history_val h v f)
let pts_to' (#a:Type) (#p:Preorder.preorder a) (r:ref a p) (f:perm) (v: a) =
h_exists (pts_to_body r f v)
let pts_to_sl r f v = hp_of (pts_to' r f v)
let intro_pure #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to_body r f v h)
= A.intro_pure (history_val h v f)
let intro_pure_full #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to r f v)
= intro_pure #_ #a #p #f r v h;
intro_exists h (pts_to_body r f v)
let alloc #_ (#a:Type) (p:Preorder.preorder a) (v:a)
= let h = Current [v] full_perm in
assert (compatible pcm_history h h);
let x : ref a p = alloc h in
intro_pure_full x v h;
x
let extract_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> pts_to_body r f v h)
= elim_pure (history_val h v f);
A.intro_pure (history_val h v f)
let elim_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> PR.pts_to r h)
= let _ = extract_pure r v h in
drop (pure (history_val h v f)) | {
"checked_file": "/",
"dependencies": [
"Steel.Preorder.fst.checked",
"Steel.Memory.fsti.checked",
"Steel.GhostPCMReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.GhostMonotonicHigherReference.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Real",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Effect.Atomic",
"short_module": "A"
},
{
"abbrev": true,
"full_module": "Steel.GhostPCMReference",
"short_module": "PR"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Steel.Preorder",
"short_module": "Q"
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.GhostPCMReference",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | r: Steel.GhostMonotonicHigherReference.ref a p -> x: a -> Steel.Effect.Atomic.SteelGhost Prims.unit | Steel.Effect.Atomic.SteelGhost | [] | [] | [
"Steel.Memory.inames",
"FStar.Preorder.preorder",
"Steel.GhostMonotonicHigherReference.ref",
"Steel.GhostMonotonicHigherReference.intro_pure_full",
"Steel.FractionalPermission.full_perm",
"Prims.unit",
"Steel.GhostPCMReference.write",
"Steel.Preorder.history",
"Steel.Preorder.pcm_history",
"FStar.Ghost.reveal",
"Steel.Preorder.extend_history'",
"Steel.GhostPCMReference.read",
"Steel.Preorder.history_val",
"FStar.Ghost.hide",
"Steel.GhostMonotonicHigherReference.elim_pure",
"FStar.Ghost.erased",
"Steel.Effect.Atomic.witness_exists",
"Steel.GhostMonotonicHigherReference.pts_to_body",
"Steel.GhostMonotonicHigherReference.pts_to",
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.rmem",
"Prims.l_and",
"Prims.l_True"
] | [] | false | true | false | false | false | let write (#opened: _) (#a: Type) (#p: Preorder.preorder a) (#v: a) (r: ref a p) (x: a)
: SteelGhost unit
opened
(pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True) =
| let h_old_e = witness_exists #_ #_ #(pts_to_body r full_perm v) () in
let _ = elim_pure r v h_old_e in
let h_old = read r in
let h:history a p = extend_history' h_old x in
write r h_old_e h;
intro_pure_full r x h | false |
FStar.List.fst | FStar.List.fold_right | val fold_right: ('a -> 'b -> ML 'b) -> list 'a -> 'b -> ML 'b | val fold_right: ('a -> 'b -> ML 'b) -> list 'a -> 'b -> ML 'b | let rec fold_right f l x = match l with
| [] -> x
| hd::tl -> f hd (fold_right f tl x) | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 38,
"end_line": 205,
"start_col": 0,
"start_line": 203
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *)
val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a
let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl
(** [fold_left2 f x [y1; y2; ...; yn] [z1; z2; ...; zn]] computes (f
(... (f x y1 z1) y2 z2 ... yn zn). Raises an exception if [y1; y2;
...] and [z1; z2; ...] have different lengths. (Thus, hides
[List.Tot.fold_left2] which requires such a condition at type-checking
time.) Named as in: OCaml *)
val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's
let rec fold_left2 f a l1 l2 = match l1, l2 with
| [], [] -> a
| hd1::tl1, hd2::tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length"
(** [fold_right f [x1; x2; ...; xn] y] computes (f x1 (f x2 (... (f xn
y)) ... )). (Hides [List.Tot.fold_right], which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> _: 'b -> FStar.All.ML 'b) -> l: Prims.list 'a -> x: 'b -> FStar.All.ML 'b | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"FStar.List.fold_right"
] | [
"recursion"
] | false | true | false | false | false | let rec fold_right f l x =
| match l with
| [] -> x
| hd :: tl -> f hd (fold_right f tl x) | false |
FStar.List.fst | FStar.List.zip | val zip: list 'a -> list 'b -> ML (list ('a * 'b)) | val zip: list 'a -> list 'b -> ML (list ('a * 'b)) | let rec zip l1 l2 = match l1,l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (hd1,hd2)::(zip tl1 tl2)
| _, _ -> failwith "The lists do not have the same length" | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 62,
"end_line": 305,
"start_col": 0,
"start_line": 302
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *)
val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a
let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl
(** [fold_left2 f x [y1; y2; ...; yn] [z1; z2; ...; zn]] computes (f
(... (f x y1 z1) y2 z2 ... yn zn). Raises an exception if [y1; y2;
...] and [z1; z2; ...] have different lengths. (Thus, hides
[List.Tot.fold_left2] which requires such a condition at type-checking
time.) Named as in: OCaml *)
val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's
let rec fold_left2 f a l1 l2 = match l1, l2 with
| [], [] -> a
| hd1::tl1, hd2::tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length"
(** [fold_right f [x1; x2; ...; xn] y] computes (f x1 (f x2 (... (f xn
y)) ... )). (Hides [List.Tot.fold_right], which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val fold_right: ('a -> 'b -> ML 'b) -> list 'a -> 'b -> ML 'b
let rec fold_right f l x = match l with
| [] -> x
| hd::tl -> f hd (fold_right f tl x)
(** List searching **)
(** [filter f l] returns [l] with all elements [x] such that [f x]
does not hold removed. (Hides [List.Tot.filter] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val filter: ('a -> ML bool) -> list 'a -> ML (list 'a)
let rec filter f = function
| [] -> []
| hd::tl -> if f hd then hd::(filter f tl) else filter f tl
(** [for_all f l] returns [true] if, and only if, for all elements [x]
appearing in [l], [f x] holds. (Hides [List.Tot.for_all], which
requires, at type-checking time, [f] to be a pure total function.)
Named as in: OCaml. Similar to: List.forallb in Coq *)
val for_all: ('a -> ML bool) -> list 'a -> ML bool
let rec for_all f l = match l with
| [] -> true
| hd::tl -> if f hd then for_all f tl else false
(** [for_all f l1 l2] returns [true] if, and only if, for all elements
[x1] appearing in [l1] and the element [x2] appearing in [l2] at the
same position, [f x1 x2] holds. Raises an exception if [l1] and [l2]
have different lengths. Similar to: List.for_all2 in OCaml. Similar
to: List.Forall2 in Coq (which is propositional) *)
val forall2: ('a -> 'b -> ML bool) -> list 'a -> list 'b -> ML bool
let rec forall2 f l1 l2 = match l1,l2 with
| [], [] -> true
| hd1::tl1, hd2::tl2 -> if f hd1 hd2 then forall2 f tl1 tl2 else false
| _, _ -> failwith "The lists do not have the same length"
(** [collect f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. It is equivalent to [flatten (map f l)]. (Hides
[List.Tot.collect] which requires, at type-checking time, [f] to be a
pure total function.) TODO: what is the difference with [concatMap]?
*)
val collect: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec collect f l = match l with
| [] -> []
| hd::tl -> append (f hd) (collect f tl)
(** [tryFind f l] returns [Some x] for some element [x] appearing in
[l] such that [f x] holds, or [None] only if no such [x]
exists. (Hides [List.Tot.tryFind], which requires, at type-checking
time, [f] to be a pure total function.) *)
val tryFind: ('a -> ML bool) -> list 'a -> ML (option 'a)
let rec tryFind p l = match l with
| [] -> None
| hd::tl -> if p hd then Some hd else tryFind p tl
(** [tryPick f l] returns [y] for some element [x] appearing in [l]
such that [f x = Some y] for some y, or [None] only if [f x = None]
for all elements [x] of [l]. (Hides [List.Tot.tryPick], which
requires, at type-checking time, [f] to be a pure total function.) *)
val tryPick: ('a -> ML (option 'b)) -> list 'a -> ML (option 'b)
let rec tryPick f l = match l with
| [] -> None
| hd::tl ->
match f hd with
| Some x -> Some x
| None -> tryPick f tl
(** [choose f l] returns the list of [y] for all elements [x]
appearing in [l] such that [f x = Some y] for some [y]. (Hides
[List.Tot.choose] which requires, at type-checking time, [f] to be a
pure total function.) *)
val choose: ('a -> ML (option 'b)) -> list 'a -> ML (list 'b)
let rec choose f l = match l with
| [] -> []
| hd::tl ->
match f hd with
| Some x -> x::(choose f tl)
| None -> choose f tl
(** [partition f l] returns the pair of lists [(l1, l2)] where all
elements [x] of [l] are in [l1] if [f x] holds, and in [l2]
otherwise. Both [l1] and [l2] retain the original order of [l]. (Hides
[List.Tot.partition], which requires, at type-checking time, [f] to be
a pure total function.) *)
val partition: ('a -> ML bool) -> list 'a -> ML (list 'a * list 'a)
let rec partition f = function
| [] -> [], []
| hd::tl ->
let l1, l2 = partition f tl in
if f hd
then hd::l1, l2
else l1, hd::l2
(** List of tuples **)
(** [zip] takes two lists [x1, ..., xn] and [y1, ..., yn] and returns
the list of pairs [(x1, y1), ..., (xn, yn)]. Raises an exception if
the two lists have different lengths. Named as in: Haskell *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | l1: Prims.list 'a -> l2: Prims.list 'b -> FStar.All.ML (Prims.list ('a * 'b)) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"FStar.Pervasives.Native.Mktuple2",
"Prims.Nil",
"FStar.Pervasives.Native.tuple2",
"Prims.Cons",
"FStar.List.zip",
"FStar.All.failwith"
] | [
"recursion"
] | false | true | false | false | false | let rec zip l1 l2 =
| match l1, l2 with
| [], [] -> []
| hd1 :: tl1, hd2 :: tl2 -> (hd1, hd2) :: (zip tl1 tl2)
| _, _ -> failwith "The lists do not have the same length" | false |
FStar.List.fst | FStar.List.filter | val filter: ('a -> ML bool) -> list 'a -> ML (list 'a) | val filter: ('a -> ML bool) -> list 'a -> ML (list 'a) | let rec filter f = function
| [] -> []
| hd::tl -> if f hd then hd::(filter f tl) else filter f tl | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 61,
"end_line": 216,
"start_col": 0,
"start_line": 214
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *)
val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a
let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl
(** [fold_left2 f x [y1; y2; ...; yn] [z1; z2; ...; zn]] computes (f
(... (f x y1 z1) y2 z2 ... yn zn). Raises an exception if [y1; y2;
...] and [z1; z2; ...] have different lengths. (Thus, hides
[List.Tot.fold_left2] which requires such a condition at type-checking
time.) Named as in: OCaml *)
val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's
let rec fold_left2 f a l1 l2 = match l1, l2 with
| [], [] -> a
| hd1::tl1, hd2::tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length"
(** [fold_right f [x1; x2; ...; xn] y] computes (f x1 (f x2 (... (f xn
y)) ... )). (Hides [List.Tot.fold_right], which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val fold_right: ('a -> 'b -> ML 'b) -> list 'a -> 'b -> ML 'b
let rec fold_right f l x = match l with
| [] -> x
| hd::tl -> f hd (fold_right f tl x)
(** List searching **)
(** [filter f l] returns [l] with all elements [x] such that [f x]
does not hold removed. (Hides [List.Tot.filter] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> FStar.All.ML Prims.bool) -> _: Prims.list 'a -> FStar.All.ML (Prims.list 'a) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.bool",
"Prims.list",
"Prims.Nil",
"Prims.Cons",
"FStar.List.filter"
] | [
"recursion"
] | false | true | false | false | false | let rec filter f =
| function
| [] -> []
| hd :: tl -> if f hd then hd :: (filter f tl) else filter f tl | false |
FStar.List.fst | FStar.List.for_all | val for_all: ('a -> ML bool) -> list 'a -> ML bool | val for_all: ('a -> ML bool) -> list 'a -> ML bool | let rec for_all f l = match l with
| [] -> true
| hd::tl -> if f hd then for_all f tl else false | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 52,
"end_line": 225,
"start_col": 0,
"start_line": 223
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *)
val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a
let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl
(** [fold_left2 f x [y1; y2; ...; yn] [z1; z2; ...; zn]] computes (f
(... (f x y1 z1) y2 z2 ... yn zn). Raises an exception if [y1; y2;
...] and [z1; z2; ...] have different lengths. (Thus, hides
[List.Tot.fold_left2] which requires such a condition at type-checking
time.) Named as in: OCaml *)
val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's
let rec fold_left2 f a l1 l2 = match l1, l2 with
| [], [] -> a
| hd1::tl1, hd2::tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length"
(** [fold_right f [x1; x2; ...; xn] y] computes (f x1 (f x2 (... (f xn
y)) ... )). (Hides [List.Tot.fold_right], which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val fold_right: ('a -> 'b -> ML 'b) -> list 'a -> 'b -> ML 'b
let rec fold_right f l x = match l with
| [] -> x
| hd::tl -> f hd (fold_right f tl x)
(** List searching **)
(** [filter f l] returns [l] with all elements [x] such that [f x]
does not hold removed. (Hides [List.Tot.filter] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val filter: ('a -> ML bool) -> list 'a -> ML (list 'a)
let rec filter f = function
| [] -> []
| hd::tl -> if f hd then hd::(filter f tl) else filter f tl
(** [for_all f l] returns [true] if, and only if, for all elements [x]
appearing in [l], [f x] holds. (Hides [List.Tot.for_all], which
requires, at type-checking time, [f] to be a pure total function.)
Named as in: OCaml. Similar to: List.forallb in Coq *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> FStar.All.ML Prims.bool) -> l: Prims.list 'a -> FStar.All.ML Prims.bool | FStar.All.ML | [
"ml"
] | [] | [
"Prims.bool",
"Prims.list",
"FStar.List.for_all"
] | [
"recursion"
] | false | true | false | false | false | let rec for_all f l =
| match l with
| [] -> true
| hd :: tl -> if f hd then for_all f tl else false | false |
Steel.SpinLock.fst | Steel.SpinLock.intro_lockinv_locked | val intro_lockinv_locked (#uses:inames) (p:vprop) (r:ref bool)
: SteelGhostT unit uses (pts_to r full_perm locked) (fun _ -> lockinv p r) | val intro_lockinv_locked (#uses:inames) (p:vprop) (r:ref bool)
: SteelGhostT unit uses (pts_to r full_perm locked) (fun _ -> lockinv p r) | let intro_lockinv_locked #uses p r =
intro_exists true
(fun b -> pts_to r full_perm b `star`
(if b then emp else p)) | {
"file_name": "lib/steel/Steel.SpinLock.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 33,
"end_line": 52,
"start_col": 0,
"start_line": 49
} | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.SpinLock
open FStar.Ghost
open Steel.Effect.Atomic
open Steel.Effect
open Steel.Reference
open Steel.FractionalPermission
#set-options "--ide_id_info_off --fuel 0 --ifuel 0"
let available = false
let locked = true
let lockinv (p:vprop) (r:ref bool) : vprop =
h_exists (fun b -> pts_to r full_perm b `star` (if b then emp else p))
noeq
type lock (p:vprop) = | Lock: r: ref bool -> i: inv (lockinv p r) -> lock p
val intro_lockinv_available (#uses:inames) (p:vprop) (r:ref bool)
: SteelGhostT unit uses (pts_to r full_perm available `star` p) (fun _ -> lockinv p r)
val intro_lockinv_locked (#uses:inames) (p:vprop) (r:ref bool)
: SteelGhostT unit uses (pts_to r full_perm locked) (fun _ -> lockinv p r)
let intro_lockinv_available #uses p r =
intro_exists false
(fun (b: bool) ->
pts_to r full_perm b `star`
(if b then emp else p)
) | {
"checked_file": "/",
"dependencies": [
"Steel.Reference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.SpinLock.fst"
} | [
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Reference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | p: Steel.Effect.Common.vprop -> r: Steel.Reference.ref Prims.bool
-> Steel.Effect.Atomic.SteelGhostT Prims.unit | Steel.Effect.Atomic.SteelGhostT | [] | [] | [
"Steel.Memory.inames",
"Steel.Effect.Common.vprop",
"Steel.Reference.ref",
"Prims.bool",
"Steel.Effect.Atomic.intro_exists",
"Steel.Effect.Common.star",
"Steel.Reference.pts_to",
"Steel.FractionalPermission.full_perm",
"Steel.Effect.Common.emp",
"Prims.unit"
] | [] | false | true | false | false | false | let intro_lockinv_locked #uses p r =
| intro_exists true (fun b -> (pts_to r full_perm b) `star` (if b then emp else p)) | false |
FStar.List.fst | FStar.List.tryFind | val tryFind: ('a -> ML bool) -> list 'a -> ML (option 'a) | val tryFind: ('a -> ML bool) -> list 'a -> ML (option 'a) | let rec tryFind p l = match l with
| [] -> None
| hd::tl -> if p hd then Some hd else tryFind p tl | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 54,
"end_line": 256,
"start_col": 0,
"start_line": 254
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *)
val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a
let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl
(** [fold_left2 f x [y1; y2; ...; yn] [z1; z2; ...; zn]] computes (f
(... (f x y1 z1) y2 z2 ... yn zn). Raises an exception if [y1; y2;
...] and [z1; z2; ...] have different lengths. (Thus, hides
[List.Tot.fold_left2] which requires such a condition at type-checking
time.) Named as in: OCaml *)
val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's
let rec fold_left2 f a l1 l2 = match l1, l2 with
| [], [] -> a
| hd1::tl1, hd2::tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length"
(** [fold_right f [x1; x2; ...; xn] y] computes (f x1 (f x2 (... (f xn
y)) ... )). (Hides [List.Tot.fold_right], which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val fold_right: ('a -> 'b -> ML 'b) -> list 'a -> 'b -> ML 'b
let rec fold_right f l x = match l with
| [] -> x
| hd::tl -> f hd (fold_right f tl x)
(** List searching **)
(** [filter f l] returns [l] with all elements [x] such that [f x]
does not hold removed. (Hides [List.Tot.filter] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val filter: ('a -> ML bool) -> list 'a -> ML (list 'a)
let rec filter f = function
| [] -> []
| hd::tl -> if f hd then hd::(filter f tl) else filter f tl
(** [for_all f l] returns [true] if, and only if, for all elements [x]
appearing in [l], [f x] holds. (Hides [List.Tot.for_all], which
requires, at type-checking time, [f] to be a pure total function.)
Named as in: OCaml. Similar to: List.forallb in Coq *)
val for_all: ('a -> ML bool) -> list 'a -> ML bool
let rec for_all f l = match l with
| [] -> true
| hd::tl -> if f hd then for_all f tl else false
(** [for_all f l1 l2] returns [true] if, and only if, for all elements
[x1] appearing in [l1] and the element [x2] appearing in [l2] at the
same position, [f x1 x2] holds. Raises an exception if [l1] and [l2]
have different lengths. Similar to: List.for_all2 in OCaml. Similar
to: List.Forall2 in Coq (which is propositional) *)
val forall2: ('a -> 'b -> ML bool) -> list 'a -> list 'b -> ML bool
let rec forall2 f l1 l2 = match l1,l2 with
| [], [] -> true
| hd1::tl1, hd2::tl2 -> if f hd1 hd2 then forall2 f tl1 tl2 else false
| _, _ -> failwith "The lists do not have the same length"
(** [collect f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. It is equivalent to [flatten (map f l)]. (Hides
[List.Tot.collect] which requires, at type-checking time, [f] to be a
pure total function.) TODO: what is the difference with [concatMap]?
*)
val collect: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec collect f l = match l with
| [] -> []
| hd::tl -> append (f hd) (collect f tl)
(** [tryFind f l] returns [Some x] for some element [x] appearing in
[l] such that [f x] holds, or [None] only if no such [x]
exists. (Hides [List.Tot.tryFind], which requires, at type-checking
time, [f] to be a pure total function.) *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | p: (_: 'a -> FStar.All.ML Prims.bool) -> l: Prims.list 'a
-> FStar.All.ML (FStar.Pervasives.Native.option 'a) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.bool",
"Prims.list",
"FStar.Pervasives.Native.None",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.Some",
"FStar.List.tryFind"
] | [
"recursion"
] | false | true | false | false | false | let rec tryFind p l =
| match l with
| [] -> None
| hd :: tl -> if p hd then Some hd else tryFind p tl | false |
FStar.List.fst | FStar.List.collect | val collect: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b) | val collect: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b) | let rec collect f l = match l with
| [] -> []
| hd::tl -> append (f hd) (collect f tl) | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 44,
"end_line": 247,
"start_col": 0,
"start_line": 245
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *)
val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a
let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl
(** [fold_left2 f x [y1; y2; ...; yn] [z1; z2; ...; zn]] computes (f
(... (f x y1 z1) y2 z2 ... yn zn). Raises an exception if [y1; y2;
...] and [z1; z2; ...] have different lengths. (Thus, hides
[List.Tot.fold_left2] which requires such a condition at type-checking
time.) Named as in: OCaml *)
val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's
let rec fold_left2 f a l1 l2 = match l1, l2 with
| [], [] -> a
| hd1::tl1, hd2::tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length"
(** [fold_right f [x1; x2; ...; xn] y] computes (f x1 (f x2 (... (f xn
y)) ... )). (Hides [List.Tot.fold_right], which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val fold_right: ('a -> 'b -> ML 'b) -> list 'a -> 'b -> ML 'b
let rec fold_right f l x = match l with
| [] -> x
| hd::tl -> f hd (fold_right f tl x)
(** List searching **)
(** [filter f l] returns [l] with all elements [x] such that [f x]
does not hold removed. (Hides [List.Tot.filter] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val filter: ('a -> ML bool) -> list 'a -> ML (list 'a)
let rec filter f = function
| [] -> []
| hd::tl -> if f hd then hd::(filter f tl) else filter f tl
(** [for_all f l] returns [true] if, and only if, for all elements [x]
appearing in [l], [f x] holds. (Hides [List.Tot.for_all], which
requires, at type-checking time, [f] to be a pure total function.)
Named as in: OCaml. Similar to: List.forallb in Coq *)
val for_all: ('a -> ML bool) -> list 'a -> ML bool
let rec for_all f l = match l with
| [] -> true
| hd::tl -> if f hd then for_all f tl else false
(** [for_all f l1 l2] returns [true] if, and only if, for all elements
[x1] appearing in [l1] and the element [x2] appearing in [l2] at the
same position, [f x1 x2] holds. Raises an exception if [l1] and [l2]
have different lengths. Similar to: List.for_all2 in OCaml. Similar
to: List.Forall2 in Coq (which is propositional) *)
val forall2: ('a -> 'b -> ML bool) -> list 'a -> list 'b -> ML bool
let rec forall2 f l1 l2 = match l1,l2 with
| [], [] -> true
| hd1::tl1, hd2::tl2 -> if f hd1 hd2 then forall2 f tl1 tl2 else false
| _, _ -> failwith "The lists do not have the same length"
(** [collect f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. It is equivalent to [flatten (map f l)]. (Hides
[List.Tot.collect] which requires, at type-checking time, [f] to be a
pure total function.) TODO: what is the difference with [concatMap]?
*) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> FStar.All.ML (Prims.list 'b)) -> l: Prims.list 'a -> FStar.All.ML (Prims.list 'b) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.list",
"Prims.Nil",
"FStar.List.Tot.Base.append",
"FStar.List.collect"
] | [
"recursion"
] | false | true | false | false | false | let rec collect f l =
| match l with
| [] -> []
| hd :: tl -> append (f hd) (collect f tl) | false |
FStar.List.fst | FStar.List.splitAt | val splitAt: nat -> list 'a -> ML (list 'a * list 'a) | val splitAt: nat -> list 'a -> ML (list 'a * list 'a) | let rec splitAt n l =
if n = 0 then [], l
else
match l with
| [] -> failwith "splitAt index is more that list length"
| hd::tl ->
let l1, l2 = splitAt (n - 1) tl in
hd::l1, l2 | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 18,
"end_line": 332,
"start_col": 0,
"start_line": 325
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *)
val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a
let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl
(** [fold_left2 f x [y1; y2; ...; yn] [z1; z2; ...; zn]] computes (f
(... (f x y1 z1) y2 z2 ... yn zn). Raises an exception if [y1; y2;
...] and [z1; z2; ...] have different lengths. (Thus, hides
[List.Tot.fold_left2] which requires such a condition at type-checking
time.) Named as in: OCaml *)
val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's
let rec fold_left2 f a l1 l2 = match l1, l2 with
| [], [] -> a
| hd1::tl1, hd2::tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length"
(** [fold_right f [x1; x2; ...; xn] y] computes (f x1 (f x2 (... (f xn
y)) ... )). (Hides [List.Tot.fold_right], which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val fold_right: ('a -> 'b -> ML 'b) -> list 'a -> 'b -> ML 'b
let rec fold_right f l x = match l with
| [] -> x
| hd::tl -> f hd (fold_right f tl x)
(** List searching **)
(** [filter f l] returns [l] with all elements [x] such that [f x]
does not hold removed. (Hides [List.Tot.filter] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val filter: ('a -> ML bool) -> list 'a -> ML (list 'a)
let rec filter f = function
| [] -> []
| hd::tl -> if f hd then hd::(filter f tl) else filter f tl
(** [for_all f l] returns [true] if, and only if, for all elements [x]
appearing in [l], [f x] holds. (Hides [List.Tot.for_all], which
requires, at type-checking time, [f] to be a pure total function.)
Named as in: OCaml. Similar to: List.forallb in Coq *)
val for_all: ('a -> ML bool) -> list 'a -> ML bool
let rec for_all f l = match l with
| [] -> true
| hd::tl -> if f hd then for_all f tl else false
(** [for_all f l1 l2] returns [true] if, and only if, for all elements
[x1] appearing in [l1] and the element [x2] appearing in [l2] at the
same position, [f x1 x2] holds. Raises an exception if [l1] and [l2]
have different lengths. Similar to: List.for_all2 in OCaml. Similar
to: List.Forall2 in Coq (which is propositional) *)
val forall2: ('a -> 'b -> ML bool) -> list 'a -> list 'b -> ML bool
let rec forall2 f l1 l2 = match l1,l2 with
| [], [] -> true
| hd1::tl1, hd2::tl2 -> if f hd1 hd2 then forall2 f tl1 tl2 else false
| _, _ -> failwith "The lists do not have the same length"
(** [collect f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. It is equivalent to [flatten (map f l)]. (Hides
[List.Tot.collect] which requires, at type-checking time, [f] to be a
pure total function.) TODO: what is the difference with [concatMap]?
*)
val collect: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec collect f l = match l with
| [] -> []
| hd::tl -> append (f hd) (collect f tl)
(** [tryFind f l] returns [Some x] for some element [x] appearing in
[l] such that [f x] holds, or [None] only if no such [x]
exists. (Hides [List.Tot.tryFind], which requires, at type-checking
time, [f] to be a pure total function.) *)
val tryFind: ('a -> ML bool) -> list 'a -> ML (option 'a)
let rec tryFind p l = match l with
| [] -> None
| hd::tl -> if p hd then Some hd else tryFind p tl
(** [tryPick f l] returns [y] for some element [x] appearing in [l]
such that [f x = Some y] for some y, or [None] only if [f x = None]
for all elements [x] of [l]. (Hides [List.Tot.tryPick], which
requires, at type-checking time, [f] to be a pure total function.) *)
val tryPick: ('a -> ML (option 'b)) -> list 'a -> ML (option 'b)
let rec tryPick f l = match l with
| [] -> None
| hd::tl ->
match f hd with
| Some x -> Some x
| None -> tryPick f tl
(** [choose f l] returns the list of [y] for all elements [x]
appearing in [l] such that [f x = Some y] for some [y]. (Hides
[List.Tot.choose] which requires, at type-checking time, [f] to be a
pure total function.) *)
val choose: ('a -> ML (option 'b)) -> list 'a -> ML (list 'b)
let rec choose f l = match l with
| [] -> []
| hd::tl ->
match f hd with
| Some x -> x::(choose f tl)
| None -> choose f tl
(** [partition f l] returns the pair of lists [(l1, l2)] where all
elements [x] of [l] are in [l1] if [f x] holds, and in [l2]
otherwise. Both [l1] and [l2] retain the original order of [l]. (Hides
[List.Tot.partition], which requires, at type-checking time, [f] to be
a pure total function.) *)
val partition: ('a -> ML bool) -> list 'a -> ML (list 'a * list 'a)
let rec partition f = function
| [] -> [], []
| hd::tl ->
let l1, l2 = partition f tl in
if f hd
then hd::l1, l2
else l1, hd::l2
(** List of tuples **)
(** [zip] takes two lists [x1, ..., xn] and [y1, ..., yn] and returns
the list of pairs [(x1, y1), ..., (xn, yn)]. Raises an exception if
the two lists have different lengths. Named as in: Haskell *)
val zip: list 'a -> list 'b -> ML (list ('a * 'b))
let rec zip l1 l2 = match l1,l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (hd1,hd2)::(zip tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** Sorting (implemented as quicksort) **)
(** [sortWith compare l] returns the list [l'] containing the elements
of [l] sorted along the comparison function [compare], in such a way
that if [compare x y > 0], then [x] appears before [y] in [l']. (Hides
[List.Tot.sortWith], which requires, at type-checking time, [compare]
to be a pure total function.) *)
val sortWith: ('a -> 'a -> ML int) -> list 'a -> ML (list 'a)
let rec sortWith f = function
| [] -> []
| pivot::tl ->
let hi, lo = partition (fun x -> f pivot x > 0) tl in
sortWith f lo@(pivot::sortWith f hi)
(** [splitAt n l] returns the pair of lists [(l1, l2)] such that [l1]
contains the first [n] elements of [l] and [l2] contains the
rest. Raises an exception if [l] has fewer than [n] elements. *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | n: Prims.nat -> l: Prims.list 'a -> FStar.All.ML (Prims.list 'a * Prims.list 'a) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.nat",
"Prims.list",
"Prims.op_Equality",
"Prims.int",
"FStar.Pervasives.Native.Mktuple2",
"Prims.Nil",
"FStar.Pervasives.Native.tuple2",
"Prims.bool",
"FStar.All.failwith",
"Prims.Cons",
"FStar.List.splitAt",
"Prims.op_Subtraction"
] | [
"recursion"
] | false | true | false | false | false | let rec splitAt n l =
| if n = 0
then [], l
else
match l with
| [] -> failwith "splitAt index is more that list length"
| hd :: tl ->
let l1, l2 = splitAt (n - 1) tl in
hd :: l1, l2 | false |
FStar.List.fst | FStar.List.sortWith | val sortWith: ('a -> 'a -> ML int) -> list 'a -> ML (list 'a) | val sortWith: ('a -> 'a -> ML int) -> list 'a -> ML (list 'a) | let rec sortWith f = function
| [] -> []
| pivot::tl ->
let hi, lo = partition (fun x -> f pivot x > 0) tl in
sortWith f lo@(pivot::sortWith f hi) | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 41,
"end_line": 319,
"start_col": 0,
"start_line": 315
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *)
val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a
let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl
(** [fold_left2 f x [y1; y2; ...; yn] [z1; z2; ...; zn]] computes (f
(... (f x y1 z1) y2 z2 ... yn zn). Raises an exception if [y1; y2;
...] and [z1; z2; ...] have different lengths. (Thus, hides
[List.Tot.fold_left2] which requires such a condition at type-checking
time.) Named as in: OCaml *)
val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's
let rec fold_left2 f a l1 l2 = match l1, l2 with
| [], [] -> a
| hd1::tl1, hd2::tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length"
(** [fold_right f [x1; x2; ...; xn] y] computes (f x1 (f x2 (... (f xn
y)) ... )). (Hides [List.Tot.fold_right], which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val fold_right: ('a -> 'b -> ML 'b) -> list 'a -> 'b -> ML 'b
let rec fold_right f l x = match l with
| [] -> x
| hd::tl -> f hd (fold_right f tl x)
(** List searching **)
(** [filter f l] returns [l] with all elements [x] such that [f x]
does not hold removed. (Hides [List.Tot.filter] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val filter: ('a -> ML bool) -> list 'a -> ML (list 'a)
let rec filter f = function
| [] -> []
| hd::tl -> if f hd then hd::(filter f tl) else filter f tl
(** [for_all f l] returns [true] if, and only if, for all elements [x]
appearing in [l], [f x] holds. (Hides [List.Tot.for_all], which
requires, at type-checking time, [f] to be a pure total function.)
Named as in: OCaml. Similar to: List.forallb in Coq *)
val for_all: ('a -> ML bool) -> list 'a -> ML bool
let rec for_all f l = match l with
| [] -> true
| hd::tl -> if f hd then for_all f tl else false
(** [for_all f l1 l2] returns [true] if, and only if, for all elements
[x1] appearing in [l1] and the element [x2] appearing in [l2] at the
same position, [f x1 x2] holds. Raises an exception if [l1] and [l2]
have different lengths. Similar to: List.for_all2 in OCaml. Similar
to: List.Forall2 in Coq (which is propositional) *)
val forall2: ('a -> 'b -> ML bool) -> list 'a -> list 'b -> ML bool
let rec forall2 f l1 l2 = match l1,l2 with
| [], [] -> true
| hd1::tl1, hd2::tl2 -> if f hd1 hd2 then forall2 f tl1 tl2 else false
| _, _ -> failwith "The lists do not have the same length"
(** [collect f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. It is equivalent to [flatten (map f l)]. (Hides
[List.Tot.collect] which requires, at type-checking time, [f] to be a
pure total function.) TODO: what is the difference with [concatMap]?
*)
val collect: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec collect f l = match l with
| [] -> []
| hd::tl -> append (f hd) (collect f tl)
(** [tryFind f l] returns [Some x] for some element [x] appearing in
[l] such that [f x] holds, or [None] only if no such [x]
exists. (Hides [List.Tot.tryFind], which requires, at type-checking
time, [f] to be a pure total function.) *)
val tryFind: ('a -> ML bool) -> list 'a -> ML (option 'a)
let rec tryFind p l = match l with
| [] -> None
| hd::tl -> if p hd then Some hd else tryFind p tl
(** [tryPick f l] returns [y] for some element [x] appearing in [l]
such that [f x = Some y] for some y, or [None] only if [f x = None]
for all elements [x] of [l]. (Hides [List.Tot.tryPick], which
requires, at type-checking time, [f] to be a pure total function.) *)
val tryPick: ('a -> ML (option 'b)) -> list 'a -> ML (option 'b)
let rec tryPick f l = match l with
| [] -> None
| hd::tl ->
match f hd with
| Some x -> Some x
| None -> tryPick f tl
(** [choose f l] returns the list of [y] for all elements [x]
appearing in [l] such that [f x = Some y] for some [y]. (Hides
[List.Tot.choose] which requires, at type-checking time, [f] to be a
pure total function.) *)
val choose: ('a -> ML (option 'b)) -> list 'a -> ML (list 'b)
let rec choose f l = match l with
| [] -> []
| hd::tl ->
match f hd with
| Some x -> x::(choose f tl)
| None -> choose f tl
(** [partition f l] returns the pair of lists [(l1, l2)] where all
elements [x] of [l] are in [l1] if [f x] holds, and in [l2]
otherwise. Both [l1] and [l2] retain the original order of [l]. (Hides
[List.Tot.partition], which requires, at type-checking time, [f] to be
a pure total function.) *)
val partition: ('a -> ML bool) -> list 'a -> ML (list 'a * list 'a)
let rec partition f = function
| [] -> [], []
| hd::tl ->
let l1, l2 = partition f tl in
if f hd
then hd::l1, l2
else l1, hd::l2
(** List of tuples **)
(** [zip] takes two lists [x1, ..., xn] and [y1, ..., yn] and returns
the list of pairs [(x1, y1), ..., (xn, yn)]. Raises an exception if
the two lists have different lengths. Named as in: Haskell *)
val zip: list 'a -> list 'b -> ML (list ('a * 'b))
let rec zip l1 l2 = match l1,l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (hd1,hd2)::(zip tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** Sorting (implemented as quicksort) **)
(** [sortWith compare l] returns the list [l'] containing the elements
of [l] sorted along the comparison function [compare], in such a way
that if [compare x y > 0], then [x] appears before [y] in [l']. (Hides
[List.Tot.sortWith], which requires, at type-checking time, [compare]
to be a pure total function.) *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> _: 'a -> FStar.All.ML Prims.int) -> _: Prims.list 'a -> FStar.All.ML (Prims.list 'a) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.int",
"Prims.list",
"Prims.Nil",
"FStar.List.Tot.Base.op_At",
"Prims.Cons",
"FStar.List.sortWith",
"FStar.Pervasives.Native.tuple2",
"FStar.List.partition",
"Prims.op_GreaterThan",
"Prims.bool"
] | [
"recursion"
] | false | true | false | false | false | let rec sortWith f =
| function
| [] -> []
| pivot :: tl ->
let hi, lo = partition (fun x -> f pivot x > 0) tl in
sortWith f lo @ (pivot :: sortWith f hi) | false |
FStar.List.fst | FStar.List.index | val index: ('a -> ML bool) -> list 'a -> ML int | val index: ('a -> ML bool) -> list 'a -> ML int | let index f l =
let rec index l i : ML int =
match l with
| [] ->
failwith "List.index: not found"
| hd :: tl ->
if f hd then
i
else
index tl (i + 1)
in
index l 0 | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 11,
"end_line": 367,
"start_col": 0,
"start_line": 356
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *)
val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a
let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl
(** [fold_left2 f x [y1; y2; ...; yn] [z1; z2; ...; zn]] computes (f
(... (f x y1 z1) y2 z2 ... yn zn). Raises an exception if [y1; y2;
...] and [z1; z2; ...] have different lengths. (Thus, hides
[List.Tot.fold_left2] which requires such a condition at type-checking
time.) Named as in: OCaml *)
val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's
let rec fold_left2 f a l1 l2 = match l1, l2 with
| [], [] -> a
| hd1::tl1, hd2::tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length"
(** [fold_right f [x1; x2; ...; xn] y] computes (f x1 (f x2 (... (f xn
y)) ... )). (Hides [List.Tot.fold_right], which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val fold_right: ('a -> 'b -> ML 'b) -> list 'a -> 'b -> ML 'b
let rec fold_right f l x = match l with
| [] -> x
| hd::tl -> f hd (fold_right f tl x)
(** List searching **)
(** [filter f l] returns [l] with all elements [x] such that [f x]
does not hold removed. (Hides [List.Tot.filter] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val filter: ('a -> ML bool) -> list 'a -> ML (list 'a)
let rec filter f = function
| [] -> []
| hd::tl -> if f hd then hd::(filter f tl) else filter f tl
(** [for_all f l] returns [true] if, and only if, for all elements [x]
appearing in [l], [f x] holds. (Hides [List.Tot.for_all], which
requires, at type-checking time, [f] to be a pure total function.)
Named as in: OCaml. Similar to: List.forallb in Coq *)
val for_all: ('a -> ML bool) -> list 'a -> ML bool
let rec for_all f l = match l with
| [] -> true
| hd::tl -> if f hd then for_all f tl else false
(** [for_all f l1 l2] returns [true] if, and only if, for all elements
[x1] appearing in [l1] and the element [x2] appearing in [l2] at the
same position, [f x1 x2] holds. Raises an exception if [l1] and [l2]
have different lengths. Similar to: List.for_all2 in OCaml. Similar
to: List.Forall2 in Coq (which is propositional) *)
val forall2: ('a -> 'b -> ML bool) -> list 'a -> list 'b -> ML bool
let rec forall2 f l1 l2 = match l1,l2 with
| [], [] -> true
| hd1::tl1, hd2::tl2 -> if f hd1 hd2 then forall2 f tl1 tl2 else false
| _, _ -> failwith "The lists do not have the same length"
(** [collect f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. It is equivalent to [flatten (map f l)]. (Hides
[List.Tot.collect] which requires, at type-checking time, [f] to be a
pure total function.) TODO: what is the difference with [concatMap]?
*)
val collect: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec collect f l = match l with
| [] -> []
| hd::tl -> append (f hd) (collect f tl)
(** [tryFind f l] returns [Some x] for some element [x] appearing in
[l] such that [f x] holds, or [None] only if no such [x]
exists. (Hides [List.Tot.tryFind], which requires, at type-checking
time, [f] to be a pure total function.) *)
val tryFind: ('a -> ML bool) -> list 'a -> ML (option 'a)
let rec tryFind p l = match l with
| [] -> None
| hd::tl -> if p hd then Some hd else tryFind p tl
(** [tryPick f l] returns [y] for some element [x] appearing in [l]
such that [f x = Some y] for some y, or [None] only if [f x = None]
for all elements [x] of [l]. (Hides [List.Tot.tryPick], which
requires, at type-checking time, [f] to be a pure total function.) *)
val tryPick: ('a -> ML (option 'b)) -> list 'a -> ML (option 'b)
let rec tryPick f l = match l with
| [] -> None
| hd::tl ->
match f hd with
| Some x -> Some x
| None -> tryPick f tl
(** [choose f l] returns the list of [y] for all elements [x]
appearing in [l] such that [f x = Some y] for some [y]. (Hides
[List.Tot.choose] which requires, at type-checking time, [f] to be a
pure total function.) *)
val choose: ('a -> ML (option 'b)) -> list 'a -> ML (list 'b)
let rec choose f l = match l with
| [] -> []
| hd::tl ->
match f hd with
| Some x -> x::(choose f tl)
| None -> choose f tl
(** [partition f l] returns the pair of lists [(l1, l2)] where all
elements [x] of [l] are in [l1] if [f x] holds, and in [l2]
otherwise. Both [l1] and [l2] retain the original order of [l]. (Hides
[List.Tot.partition], which requires, at type-checking time, [f] to be
a pure total function.) *)
val partition: ('a -> ML bool) -> list 'a -> ML (list 'a * list 'a)
let rec partition f = function
| [] -> [], []
| hd::tl ->
let l1, l2 = partition f tl in
if f hd
then hd::l1, l2
else l1, hd::l2
(** List of tuples **)
(** [zip] takes two lists [x1, ..., xn] and [y1, ..., yn] and returns
the list of pairs [(x1, y1), ..., (xn, yn)]. Raises an exception if
the two lists have different lengths. Named as in: Haskell *)
val zip: list 'a -> list 'b -> ML (list ('a * 'b))
let rec zip l1 l2 = match l1,l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (hd1,hd2)::(zip tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** Sorting (implemented as quicksort) **)
(** [sortWith compare l] returns the list [l'] containing the elements
of [l] sorted along the comparison function [compare], in such a way
that if [compare x y > 0], then [x] appears before [y] in [l']. (Hides
[List.Tot.sortWith], which requires, at type-checking time, [compare]
to be a pure total function.) *)
val sortWith: ('a -> 'a -> ML int) -> list 'a -> ML (list 'a)
let rec sortWith f = function
| [] -> []
| pivot::tl ->
let hi, lo = partition (fun x -> f pivot x > 0) tl in
sortWith f lo@(pivot::sortWith f hi)
(** [splitAt n l] returns the pair of lists [(l1, l2)] such that [l1]
contains the first [n] elements of [l] and [l2] contains the
rest. Raises an exception if [l] has fewer than [n] elements. *)
val splitAt: nat -> list 'a -> ML (list 'a * list 'a)
let rec splitAt n l =
if n = 0 then [], l
else
match l with
| [] -> failwith "splitAt index is more that list length"
| hd::tl ->
let l1, l2 = splitAt (n - 1) tl in
hd::l1, l2
(** [filter_map f l] returns the list of [y] for all elements [x]
appearing in [l] such that [f x = Some y] for some [y]. (Implemented
here as a tail-recursive version of [choose] *)
let filter_map (f:'a -> ML (option 'b)) (l:list 'a) : ML (list 'b) =
let rec filter_map_acc (acc:list 'b) (l:list 'a) : ML (list 'b) =
match l with
| [] ->
rev acc
| hd :: tl ->
match f hd with
| Some hd ->
filter_map_acc (hd :: acc) tl
| None ->
filter_map_acc acc tl
in
filter_map_acc [] l
(** [index f l] returns the position index in list [l] of the first
element [x] in [l] such that [f x] holds. Raises an exception if no
such [x] exists. TODO: rename this function (it hides List.Tot.index
which has a completely different semantics.) *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> FStar.All.ML Prims.bool) -> l: Prims.list 'a -> FStar.All.ML Prims.int | FStar.All.ML | [
"ml"
] | [] | [
"Prims.bool",
"Prims.list",
"Prims.int",
"FStar.All.failwith",
"Prims.op_Addition"
] | [] | false | true | false | false | false | let index f l =
| let rec index l i : ML int =
match l with
| [] -> failwith "List.index: not found"
| hd :: tl -> if f hd then i else index tl (i + 1)
in
index l 0 | false |
FStar.PartialMap.fst | FStar.PartialMap.empty | val empty (k:eqtype) (v:Type) : t k v | val empty (k:eqtype) (v:Type) : t k v | let empty _ _ = on_dom _ (fun _ -> None) | {
"file_name": "ulib/FStar.PartialMap.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 40,
"end_line": 25,
"start_col": 0,
"start_line": 25
} | (*
Copyright 2008-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.
Author: Aseem Rastogi
*)
module FStar.PartialMap
open FStar.FunctionalExtensionality
type t k v = k ^-> option v | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.PartialMap.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.FunctionalExtensionality",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | k: Prims.eqtype -> v: Type -> FStar.PartialMap.t k v | Prims.Tot | [
"total"
] | [] | [
"Prims.eqtype",
"FStar.FunctionalExtensionality.on_dom",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.None",
"FStar.PartialMap.t"
] | [] | false | false | false | false | false | let empty _ _ =
| on_dom _ (fun _ -> None) | false |
FStar.List.fst | FStar.List.choose | val choose: ('a -> ML (option 'b)) -> list 'a -> ML (list 'b) | val choose: ('a -> ML (option 'b)) -> list 'a -> ML (list 'b) | let rec choose f l = match l with
| [] -> []
| hd::tl ->
match f hd with
| Some x -> x::(choose f tl)
| None -> choose f tl | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 30,
"end_line": 280,
"start_col": 0,
"start_line": 275
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *)
val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a
let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl
(** [fold_left2 f x [y1; y2; ...; yn] [z1; z2; ...; zn]] computes (f
(... (f x y1 z1) y2 z2 ... yn zn). Raises an exception if [y1; y2;
...] and [z1; z2; ...] have different lengths. (Thus, hides
[List.Tot.fold_left2] which requires such a condition at type-checking
time.) Named as in: OCaml *)
val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's
let rec fold_left2 f a l1 l2 = match l1, l2 with
| [], [] -> a
| hd1::tl1, hd2::tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length"
(** [fold_right f [x1; x2; ...; xn] y] computes (f x1 (f x2 (... (f xn
y)) ... )). (Hides [List.Tot.fold_right], which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val fold_right: ('a -> 'b -> ML 'b) -> list 'a -> 'b -> ML 'b
let rec fold_right f l x = match l with
| [] -> x
| hd::tl -> f hd (fold_right f tl x)
(** List searching **)
(** [filter f l] returns [l] with all elements [x] such that [f x]
does not hold removed. (Hides [List.Tot.filter] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val filter: ('a -> ML bool) -> list 'a -> ML (list 'a)
let rec filter f = function
| [] -> []
| hd::tl -> if f hd then hd::(filter f tl) else filter f tl
(** [for_all f l] returns [true] if, and only if, for all elements [x]
appearing in [l], [f x] holds. (Hides [List.Tot.for_all], which
requires, at type-checking time, [f] to be a pure total function.)
Named as in: OCaml. Similar to: List.forallb in Coq *)
val for_all: ('a -> ML bool) -> list 'a -> ML bool
let rec for_all f l = match l with
| [] -> true
| hd::tl -> if f hd then for_all f tl else false
(** [for_all f l1 l2] returns [true] if, and only if, for all elements
[x1] appearing in [l1] and the element [x2] appearing in [l2] at the
same position, [f x1 x2] holds. Raises an exception if [l1] and [l2]
have different lengths. Similar to: List.for_all2 in OCaml. Similar
to: List.Forall2 in Coq (which is propositional) *)
val forall2: ('a -> 'b -> ML bool) -> list 'a -> list 'b -> ML bool
let rec forall2 f l1 l2 = match l1,l2 with
| [], [] -> true
| hd1::tl1, hd2::tl2 -> if f hd1 hd2 then forall2 f tl1 tl2 else false
| _, _ -> failwith "The lists do not have the same length"
(** [collect f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. It is equivalent to [flatten (map f l)]. (Hides
[List.Tot.collect] which requires, at type-checking time, [f] to be a
pure total function.) TODO: what is the difference with [concatMap]?
*)
val collect: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec collect f l = match l with
| [] -> []
| hd::tl -> append (f hd) (collect f tl)
(** [tryFind f l] returns [Some x] for some element [x] appearing in
[l] such that [f x] holds, or [None] only if no such [x]
exists. (Hides [List.Tot.tryFind], which requires, at type-checking
time, [f] to be a pure total function.) *)
val tryFind: ('a -> ML bool) -> list 'a -> ML (option 'a)
let rec tryFind p l = match l with
| [] -> None
| hd::tl -> if p hd then Some hd else tryFind p tl
(** [tryPick f l] returns [y] for some element [x] appearing in [l]
such that [f x = Some y] for some y, or [None] only if [f x = None]
for all elements [x] of [l]. (Hides [List.Tot.tryPick], which
requires, at type-checking time, [f] to be a pure total function.) *)
val tryPick: ('a -> ML (option 'b)) -> list 'a -> ML (option 'b)
let rec tryPick f l = match l with
| [] -> None
| hd::tl ->
match f hd with
| Some x -> Some x
| None -> tryPick f tl
(** [choose f l] returns the list of [y] for all elements [x]
appearing in [l] such that [f x = Some y] for some [y]. (Hides
[List.Tot.choose] which requires, at type-checking time, [f] to be a
pure total function.) *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> FStar.All.ML (FStar.Pervasives.Native.option 'b)) -> l: Prims.list 'a
-> FStar.All.ML (Prims.list 'b) | FStar.All.ML | [
"ml"
] | [] | [
"FStar.Pervasives.Native.option",
"Prims.list",
"Prims.Nil",
"Prims.Cons",
"FStar.List.choose"
] | [
"recursion"
] | false | true | false | false | false | let rec choose f l =
| match l with
| [] -> []
| hd :: tl ->
match f hd with
| Some x -> x :: (choose f tl)
| None -> choose f tl | false |
FStar.PartialMap.fst | FStar.PartialMap.literal | val literal (#k:eqtype) (#v:Type) (f:k -> option v) : t k v | val literal (#k:eqtype) (#v:Type) (f:k -> option v) : t k v | let literal f = on_dom _ (fun x -> f x) | {
"file_name": "ulib/FStar.PartialMap.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 39,
"end_line": 26,
"start_col": 0,
"start_line": 26
} | (*
Copyright 2008-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.
Author: Aseem Rastogi
*)
module FStar.PartialMap
open FStar.FunctionalExtensionality
type t k v = k ^-> option v | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.PartialMap.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.FunctionalExtensionality",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: k -> FStar.Pervasives.Native.option v) -> FStar.PartialMap.t k v | Prims.Tot | [
"total"
] | [] | [
"Prims.eqtype",
"FStar.Pervasives.Native.option",
"FStar.FunctionalExtensionality.on_dom",
"FStar.PartialMap.t"
] | [] | false | false | false | false | false | let literal f =
| on_dom _ (fun x -> f x) | false |
FStar.List.fst | FStar.List.tryPick | val tryPick: ('a -> ML (option 'b)) -> list 'a -> ML (option 'b) | val tryPick: ('a -> ML (option 'b)) -> list 'a -> ML (option 'b) | let rec tryPick f l = match l with
| [] -> None
| hd::tl ->
match f hd with
| Some x -> Some x
| None -> tryPick f tl | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 31,
"end_line": 268,
"start_col": 0,
"start_line": 263
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *)
val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a
let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl
(** [fold_left2 f x [y1; y2; ...; yn] [z1; z2; ...; zn]] computes (f
(... (f x y1 z1) y2 z2 ... yn zn). Raises an exception if [y1; y2;
...] and [z1; z2; ...] have different lengths. (Thus, hides
[List.Tot.fold_left2] which requires such a condition at type-checking
time.) Named as in: OCaml *)
val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's
let rec fold_left2 f a l1 l2 = match l1, l2 with
| [], [] -> a
| hd1::tl1, hd2::tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length"
(** [fold_right f [x1; x2; ...; xn] y] computes (f x1 (f x2 (... (f xn
y)) ... )). (Hides [List.Tot.fold_right], which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val fold_right: ('a -> 'b -> ML 'b) -> list 'a -> 'b -> ML 'b
let rec fold_right f l x = match l with
| [] -> x
| hd::tl -> f hd (fold_right f tl x)
(** List searching **)
(** [filter f l] returns [l] with all elements [x] such that [f x]
does not hold removed. (Hides [List.Tot.filter] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val filter: ('a -> ML bool) -> list 'a -> ML (list 'a)
let rec filter f = function
| [] -> []
| hd::tl -> if f hd then hd::(filter f tl) else filter f tl
(** [for_all f l] returns [true] if, and only if, for all elements [x]
appearing in [l], [f x] holds. (Hides [List.Tot.for_all], which
requires, at type-checking time, [f] to be a pure total function.)
Named as in: OCaml. Similar to: List.forallb in Coq *)
val for_all: ('a -> ML bool) -> list 'a -> ML bool
let rec for_all f l = match l with
| [] -> true
| hd::tl -> if f hd then for_all f tl else false
(** [for_all f l1 l2] returns [true] if, and only if, for all elements
[x1] appearing in [l1] and the element [x2] appearing in [l2] at the
same position, [f x1 x2] holds. Raises an exception if [l1] and [l2]
have different lengths. Similar to: List.for_all2 in OCaml. Similar
to: List.Forall2 in Coq (which is propositional) *)
val forall2: ('a -> 'b -> ML bool) -> list 'a -> list 'b -> ML bool
let rec forall2 f l1 l2 = match l1,l2 with
| [], [] -> true
| hd1::tl1, hd2::tl2 -> if f hd1 hd2 then forall2 f tl1 tl2 else false
| _, _ -> failwith "The lists do not have the same length"
(** [collect f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. It is equivalent to [flatten (map f l)]. (Hides
[List.Tot.collect] which requires, at type-checking time, [f] to be a
pure total function.) TODO: what is the difference with [concatMap]?
*)
val collect: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec collect f l = match l with
| [] -> []
| hd::tl -> append (f hd) (collect f tl)
(** [tryFind f l] returns [Some x] for some element [x] appearing in
[l] such that [f x] holds, or [None] only if no such [x]
exists. (Hides [List.Tot.tryFind], which requires, at type-checking
time, [f] to be a pure total function.) *)
val tryFind: ('a -> ML bool) -> list 'a -> ML (option 'a)
let rec tryFind p l = match l with
| [] -> None
| hd::tl -> if p hd then Some hd else tryFind p tl
(** [tryPick f l] returns [y] for some element [x] appearing in [l]
such that [f x = Some y] for some y, or [None] only if [f x = None]
for all elements [x] of [l]. (Hides [List.Tot.tryPick], which
requires, at type-checking time, [f] to be a pure total function.) *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> FStar.All.ML (FStar.Pervasives.Native.option 'b)) -> l: Prims.list 'a
-> FStar.All.ML (FStar.Pervasives.Native.option 'b) | FStar.All.ML | [
"ml"
] | [] | [
"FStar.Pervasives.Native.option",
"Prims.list",
"FStar.Pervasives.Native.None",
"FStar.Pervasives.Native.Some",
"FStar.List.tryPick"
] | [
"recursion"
] | false | true | false | false | false | let rec tryPick f l =
| match l with
| [] -> None
| hd :: tl ->
match f hd with
| Some x -> Some x
| None -> tryPick f tl | false |
FStar.PartialMap.fst | FStar.PartialMap.sel | val sel (#k:eqtype) (#v:Type) (m:t k v) (x:k) : option v | val sel (#k:eqtype) (#v:Type) (m:t k v) (x:k) : option v | let sel m x = m x | {
"file_name": "ulib/FStar.PartialMap.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 17,
"end_line": 27,
"start_col": 0,
"start_line": 27
} | (*
Copyright 2008-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.
Author: Aseem Rastogi
*)
module FStar.PartialMap
open FStar.FunctionalExtensionality
type t k v = k ^-> option v
let empty _ _ = on_dom _ (fun _ -> None) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.FunctionalExtensionality.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.PartialMap.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.FunctionalExtensionality",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | m: FStar.PartialMap.t k v -> x: k -> FStar.Pervasives.Native.option v | Prims.Tot | [
"total"
] | [] | [
"Prims.eqtype",
"FStar.PartialMap.t",
"FStar.Pervasives.Native.option"
] | [] | false | false | false | false | false | let sel m x =
| m x | false |
FStar.List.fst | FStar.List.partition | val partition: ('a -> ML bool) -> list 'a -> ML (list 'a * list 'a) | val partition: ('a -> ML bool) -> list 'a -> ML (list 'a * list 'a) | let rec partition f = function
| [] -> [], []
| hd::tl ->
let l1, l2 = partition f tl in
if f hd
then hd::l1, l2
else l1, hd::l2 | {
"file_name": "ulib/FStar.List.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 20,
"end_line": 294,
"start_col": 0,
"start_line": 288
} | (*
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 List module.
@summary F* stdlib List module.
*)
module FStar.List
open FStar.All
include FStar.List.Tot
(** Base operations **)
(** [hd l] returns the first element of [l]. Raises an exception if
[l] is empty (thus, [hd] hides [List.Tot.hd] which requires [l] to be
nonempty at type-checking time.) Named as in: OCaml, F#, Coq *)
val hd: list 'a -> ML 'a
let hd = function
| hd::tl -> hd
| _ -> failwith "head of empty list"
(** [tail l] returns [l] without its first element. Raises an
exception if [l] is empty (thus, [tail] hides [List.Tot.tail] which
requires [l] to be nonempty at type-checking time). Similar to: tl in
OCaml, F#, Coq *)
val tail: list 'a -> ML (list 'a)
let tail = function
| hd::tl -> tl
| _ -> failwith "tail of empty list"
(** [tl l] returns [l] without its first element. Raises an exception
if [l] is empty (thus, [tl] hides [List.Tot.tl] which requires [l] to
be nonempty at type-checking time). Named as in: tl in OCaml, F#, Coq
*)
val tl : list 'a -> ML (list 'a)
let tl l = tail l
(** [last l] returns the last element of [l]. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val last: list 'a -> ML 'a
let rec last = function
| [hd] -> hd
| _::tl -> last tl
| _ -> failwith "last of empty list"
(** [init l] returns [l] without its last element. Requires, at
type-checking time, that [l] be nonempty. Named as in: Haskell
*)
val init: list 'a -> ML (list 'a)
let rec init = function
| [_] -> []
| hd::tl -> hd::(init tl)
| _ -> failwith "init of empty list"
(** [nth l n] returns the [n]-th element in list [l] (with the first
element being the 0-th) if [l] is long enough, or raises an exception
otherwise (thus, [nth] hides [List.Tot.nth] which has [option] type.)
Named as in: OCaml, F#, Coq *)
val nth: list 'a -> int -> ML 'a
let rec nth l n =
if n < 0 then
failwith "nth takes a non-negative integer as input"
else
if n = 0 then
match l with
| [] -> failwith "not enough elements"
| hd::_ -> hd
else
match l with
| [] -> failwith "not enough elements"
| _::tl -> nth tl (n - 1)
(** Iterators **)
(** [iter f l] performs [f x] for each element [x] of [l], in the
order in which they appear in [l]. Named as in: OCaml, F# . *)
val iter: ('a -> ML unit) -> list 'a -> ML unit
let rec iter f x = match x with
| [] -> ()
| a::tl -> let _ = f a in iter f tl
(** [iteri_aux n f l] performs, for each i, [f (i+n) x] for the i-th
element [x] of [l], in the order in which they appear in [l]. *)
val iteri_aux: int -> (int -> 'a -> ML unit) -> list 'a -> ML unit
let rec iteri_aux i f x = match x with
| [] -> ()
| a::tl -> f i a; iteri_aux (i+1) f tl
(** [iteri_aux f l] performs, for each [i], [f i x] for the i-th
element [x] of [l], in the order in which they appear in [l]. Named as
in: OCaml *)
val iteri: (int -> 'a -> ML unit) -> list 'a -> ML unit
let iteri f x = iteri_aux 0 f x
(** [map f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. (Hides
[List.Tot.map] which requires, at type-checking time, [f] to be a pure
total function.) Named as in: OCaml, Coq, F# *)
val map: ('a -> ML 'b) -> list 'a -> ML (list 'b)
let rec map f x = match x with
| [] -> []
| a::tl -> f a::map f tl
(** [mapT f l] applies [f] to each element of [l] and returns the list
of results, in the order of the original elements in [l]. Requires, at
type-checking time, [f] to be a pure total function. *)
val mapT: ('a -> Tot 'b) -> list 'a -> Tot (list 'b)
let mapT = FStar.List.Tot.map
(** [mapi_init f n l] applies, for each [k], [f (n+k)] to the [k]-th
element of [l] and returns the list of results, in the order of the
original elements in [l]. (Hides [List.Tot.mapi_init] which requires,
at type-checking time, [f] to be a pure total function.) *)
val mapi_init: (int -> 'a -> ML 'b) -> list 'a -> int -> ML (list 'b)
let rec mapi_init f l i = match l with
| [] -> []
| hd::tl -> (f i hd)::(mapi_init f tl (i+1))
(** [mapi f l] applies, for each [k], [f k] to the [k]-th element of
[l] and returns the list of results, in the order of the original
elements in [l]. (Hides [List.Tot.mapi] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml *)
val mapi: (int -> 'a -> ML 'b) -> list 'a -> ML (list 'b)
let mapi f l = mapi_init f l 0
(** [concatMap f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. This is equivalent to [flatten (map f l)]. (Hides
[List.Tot.concatMap], which requires, at type-checking time, [f] to be
a pure total function.) *)
val concatMap: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec concatMap f = function
| [] -> []
| a::tl ->
let fa = f a in
let ftl = concatMap f tl in
fa @ ftl
(** [map2 f l1 l2] computes [f x1 x2] for each element x1 of [l1] and
the element [x2] of [l2] at the same position, and returns the list of
such results, in the order of the original elements in [l1]. Raises an
exception if [l1] and [l2] have different lengths. Named as in: OCaml
*)
val map2: ('a -> 'b -> ML 'c) -> list 'a -> list 'b -> ML (list 'c)
let rec map2 f l1 l2 = match l1, l2 with
| [], [] -> []
| hd1::tl1, hd2::tl2 -> (f hd1 hd2)::(map2 f tl1 tl2)
| _, _ -> failwith "The lists do not have the same length"
(** [map3 f l1 l2 l3] computes [f x1 x2 x3] for each element x1 of
[l1] and the element [x2] of [l2] and the element [x3] of [l3] at the
same position, and returns the list of such results, in the order of
the original elements in [l1]. Raises an exception if [l1], [l2] and
[l3] have different lengths. Named as in: OCaml *)
val map3: ('a -> 'b -> 'c -> ML 'd) -> list 'a -> list 'b -> list 'c -> ML (list 'd)
let rec map3 f l1 l2 l3 = match l1, l2, l3 with
| [], [], [] -> []
| hd1::tl1, hd2::tl2, hd3::tl3 -> (f hd1 hd2 hd3)::(map3 f tl1 tl2 tl3)
| _, _, _ -> failwith "The lists do not have the same length"
(** [fold_left f x [y1; y2; ...; yn]] computes (f (... (f x y1) y2)
... yn). (Hides [List.Tot.fold_left], which requires, at type-checking
time, [f] to be a pure total function.) Named as in: OCaml, Coq *)
val fold_left: ('a -> 'b -> ML 'a) -> 'a -> list 'b -> ML 'a
let rec fold_left f x y = match y with
| [] -> x
| hd::tl -> fold_left f (f x hd) tl
(** [fold_left2 f x [y1; y2; ...; yn] [z1; z2; ...; zn]] computes (f
(... (f x y1 z1) y2 z2 ... yn zn). Raises an exception if [y1; y2;
...] and [z1; z2; ...] have different lengths. (Thus, hides
[List.Tot.fold_left2] which requires such a condition at type-checking
time.) Named as in: OCaml *)
val fold_left2: ('s -> 'a -> 'b -> ML 's) -> 's -> list 'a -> list 'b -> ML 's
let rec fold_left2 f a l1 l2 = match l1, l2 with
| [], [] -> a
| hd1::tl1, hd2::tl2 -> fold_left2 f (f a hd1 hd2) tl1 tl2
| _, _ -> failwith "The lists do not have the same length"
(** [fold_right f [x1; x2; ...; xn] y] computes (f x1 (f x2 (... (f xn
y)) ... )). (Hides [List.Tot.fold_right], which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val fold_right: ('a -> 'b -> ML 'b) -> list 'a -> 'b -> ML 'b
let rec fold_right f l x = match l with
| [] -> x
| hd::tl -> f hd (fold_right f tl x)
(** List searching **)
(** [filter f l] returns [l] with all elements [x] such that [f x]
does not hold removed. (Hides [List.Tot.filter] which requires, at
type-checking time, [f] to be a pure total function.) Named as in:
OCaml, Coq *)
val filter: ('a -> ML bool) -> list 'a -> ML (list 'a)
let rec filter f = function
| [] -> []
| hd::tl -> if f hd then hd::(filter f tl) else filter f tl
(** [for_all f l] returns [true] if, and only if, for all elements [x]
appearing in [l], [f x] holds. (Hides [List.Tot.for_all], which
requires, at type-checking time, [f] to be a pure total function.)
Named as in: OCaml. Similar to: List.forallb in Coq *)
val for_all: ('a -> ML bool) -> list 'a -> ML bool
let rec for_all f l = match l with
| [] -> true
| hd::tl -> if f hd then for_all f tl else false
(** [for_all f l1 l2] returns [true] if, and only if, for all elements
[x1] appearing in [l1] and the element [x2] appearing in [l2] at the
same position, [f x1 x2] holds. Raises an exception if [l1] and [l2]
have different lengths. Similar to: List.for_all2 in OCaml. Similar
to: List.Forall2 in Coq (which is propositional) *)
val forall2: ('a -> 'b -> ML bool) -> list 'a -> list 'b -> ML bool
let rec forall2 f l1 l2 = match l1,l2 with
| [], [] -> true
| hd1::tl1, hd2::tl2 -> if f hd1 hd2 then forall2 f tl1 tl2 else false
| _, _ -> failwith "The lists do not have the same length"
(** [collect f l] applies [f] to each element of [l] and returns the
concatenation of the results, in the order of the original elements of
[l]. It is equivalent to [flatten (map f l)]. (Hides
[List.Tot.collect] which requires, at type-checking time, [f] to be a
pure total function.) TODO: what is the difference with [concatMap]?
*)
val collect: ('a -> ML (list 'b)) -> list 'a -> ML (list 'b)
let rec collect f l = match l with
| [] -> []
| hd::tl -> append (f hd) (collect f tl)
(** [tryFind f l] returns [Some x] for some element [x] appearing in
[l] such that [f x] holds, or [None] only if no such [x]
exists. (Hides [List.Tot.tryFind], which requires, at type-checking
time, [f] to be a pure total function.) *)
val tryFind: ('a -> ML bool) -> list 'a -> ML (option 'a)
let rec tryFind p l = match l with
| [] -> None
| hd::tl -> if p hd then Some hd else tryFind p tl
(** [tryPick f l] returns [y] for some element [x] appearing in [l]
such that [f x = Some y] for some y, or [None] only if [f x = None]
for all elements [x] of [l]. (Hides [List.Tot.tryPick], which
requires, at type-checking time, [f] to be a pure total function.) *)
val tryPick: ('a -> ML (option 'b)) -> list 'a -> ML (option 'b)
let rec tryPick f l = match l with
| [] -> None
| hd::tl ->
match f hd with
| Some x -> Some x
| None -> tryPick f tl
(** [choose f l] returns the list of [y] for all elements [x]
appearing in [l] such that [f x = Some y] for some [y]. (Hides
[List.Tot.choose] which requires, at type-checking time, [f] to be a
pure total function.) *)
val choose: ('a -> ML (option 'b)) -> list 'a -> ML (list 'b)
let rec choose f l = match l with
| [] -> []
| hd::tl ->
match f hd with
| Some x -> x::(choose f tl)
| None -> choose f tl
(** [partition f l] returns the pair of lists [(l1, l2)] where all
elements [x] of [l] are in [l1] if [f x] holds, and in [l2]
otherwise. Both [l1] and [l2] retain the original order of [l]. (Hides
[List.Tot.partition], which requires, at type-checking time, [f] to be
a pure total function.) *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "FStar.List.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: 'a -> FStar.All.ML Prims.bool) -> _: Prims.list 'a
-> FStar.All.ML (Prims.list 'a * Prims.list 'a) | FStar.All.ML | [
"ml"
] | [] | [
"Prims.bool",
"Prims.list",
"FStar.Pervasives.Native.Mktuple2",
"Prims.Nil",
"FStar.Pervasives.Native.tuple2",
"Prims.Cons",
"FStar.List.partition"
] | [
"recursion"
] | false | true | false | false | false | let rec partition f =
| function
| [] -> [], []
| hd :: tl ->
let l1, l2 = partition f tl in
if f hd then hd :: l1, l2 else l1, hd :: l2 | false |
Steel.SpinLock.fst | Steel.SpinLock.intro_lockinv_available | val intro_lockinv_available (#uses:inames) (p:vprop) (r:ref bool)
: SteelGhostT unit uses (pts_to r full_perm available `star` p) (fun _ -> lockinv p r) | val intro_lockinv_available (#uses:inames) (p:vprop) (r:ref bool)
: SteelGhostT unit uses (pts_to r full_perm available `star` p) (fun _ -> lockinv p r) | let intro_lockinv_available #uses p r =
intro_exists false
(fun (b: bool) ->
pts_to r full_perm b `star`
(if b then emp else p)
) | {
"file_name": "lib/steel/Steel.SpinLock.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 5,
"end_line": 47,
"start_col": 0,
"start_line": 42
} | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.SpinLock
open FStar.Ghost
open Steel.Effect.Atomic
open Steel.Effect
open Steel.Reference
open Steel.FractionalPermission
#set-options "--ide_id_info_off --fuel 0 --ifuel 0"
let available = false
let locked = true
let lockinv (p:vprop) (r:ref bool) : vprop =
h_exists (fun b -> pts_to r full_perm b `star` (if b then emp else p))
noeq
type lock (p:vprop) = | Lock: r: ref bool -> i: inv (lockinv p r) -> lock p
val intro_lockinv_available (#uses:inames) (p:vprop) (r:ref bool)
: SteelGhostT unit uses (pts_to r full_perm available `star` p) (fun _ -> lockinv p r)
val intro_lockinv_locked (#uses:inames) (p:vprop) (r:ref bool)
: SteelGhostT unit uses (pts_to r full_perm locked) (fun _ -> lockinv p r) | {
"checked_file": "/",
"dependencies": [
"Steel.Reference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.SpinLock.fst"
} | [
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Reference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | p: Steel.Effect.Common.vprop -> r: Steel.Reference.ref Prims.bool
-> Steel.Effect.Atomic.SteelGhostT Prims.unit | Steel.Effect.Atomic.SteelGhostT | [] | [] | [
"Steel.Memory.inames",
"Steel.Effect.Common.vprop",
"Steel.Reference.ref",
"Prims.bool",
"Steel.Effect.Atomic.intro_exists",
"Steel.Effect.Common.star",
"Steel.Reference.pts_to",
"Steel.FractionalPermission.full_perm",
"Steel.Effect.Common.emp",
"Prims.unit"
] | [] | false | true | false | false | false | let intro_lockinv_available #uses p r =
| intro_exists false (fun (b: bool) -> (pts_to r full_perm b) `star` (if b then emp else p)) | false |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.