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
DPE.Messages.Spec.fst
DPE.Messages.Spec.open_session_input_args_group
val open_session_input_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group ))
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 2, "end_line": 258, "start_col": 0, "start_line": 254 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.open_session_initiator_handshake", "CDDL.Spec.bytes", "DPE.Messages.Spec.open_session_is_migratable", "CDDL.Spec.t_bool", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let open_session_input_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal open_session_initiator_handshake) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal open_session_is_migratable) Cddl.t_bool) false (default_args_group))
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.get_profile_output_args
val get_profile_output_args:Cddl.typ
val get_profile_output_args:Cddl.typ
let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group )
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 1, "end_line": 245, "start_col": 17, "start_line": 243 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.typ
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.get_profile_output_args_group" ]
[]
false
false
false
true
false
let get_profile_output_args:Cddl.typ =
Cddl.t_map (get_profile_output_args_group)
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.close_session_output_args
val close_session_output_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let close_session_output_args = Cddl.t_map default_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 78, "end_line": 288, "start_col": 17, "start_line": 288 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let close_session_output_args =
Cddl.t_map default_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sync_session_initiator_counter
val sync_session_initiator_counter : FStar.UInt64.t
let sync_session_initiator_counter = 2uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 40, "end_line": 295, "start_col": 0, "start_line": 295 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let sync_session_initiator_counter =
2uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.open_session_output_args
val open_session_output_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let open_session_output_args = Cddl.t_map open_session_output_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 89, "end_line": 280, "start_col": 17, "start_line": 280 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.open_session_output_args_group" ]
[]
false
false
false
true
false
let open_session_output_args =
Cddl.t_map open_session_output_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.open_session_responder_handshake
val open_session_responder_handshake : FStar.UInt64.t
let open_session_responder_handshake = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 42, "end_line": 268, "start_col": 0, "start_line": 268 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let open_session_responder_handshake =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.open_session_output_args_group
val open_session_output_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 1, "end_line": 273, "start_col": 0, "start_line": 270 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.open_session_responder_handshake", "CDDL.Spec.bytes", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let open_session_output_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal open_session_responder_handshake) Cddl.bytes) false (default_args_group)
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.close_session_input_args
val close_session_input_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let close_session_input_args = Cddl.t_map default_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 76, "end_line": 286, "start_col": 16, "start_line": 286 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let close_session_input_args =
Cddl.t_map default_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.responder_handshake_payload
val responder_handshake_payload : CDDL.Spec.typ
let responder_handshake_payload = Cddl.uint
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 43, "end_line": 282, "start_col": 0, "start_line": 282 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.typ
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.uint" ]
[]
false
false
false
true
false
let responder_handshake_payload =
Cddl.uint
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sync_session_input_args_group
val sync_session_input_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ))
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 2, "end_line": 301, "start_col": 0, "start_line": 297 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.sync_session_session_id", "CDDL.Spec.uint", "DPE.Messages.Spec.sync_session_initiator_counter", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let sync_session_input_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal sync_session_session_id) Cddl.uint) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal sync_session_initiator_counter) Cddl.uint) false (default_args_group))
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.open_session_input_args
val open_session_input_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let open_session_input_args = Cddl.t_map open_session_input_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 86, "end_line": 265, "start_col": 16, "start_line": 265 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.open_session_input_args_group" ]
[]
false
false
false
true
false
let open_session_input_args =
Cddl.t_map open_session_input_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sync_session_session_id
val sync_session_session_id : FStar.UInt64.t
let sync_session_session_id = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 33, "end_line": 293, "start_col": 0, "start_line": 293 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let sync_session_session_id =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sync_session_output_args_group
val sync_session_output_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 1, "end_line": 316, "start_col": 0, "start_line": 313 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.sync_session_responder_counter", "CDDL.Spec.uint", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let sync_session_output_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal sync_session_responder_counter) Cddl.uint) false (default_args_group)
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sync_session_output_args
val sync_session_output_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let sync_session_output_args = Cddl.t_map sync_session_output_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 89, "end_line": 323, "start_col": 17, "start_line": 323 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.sync_session_output_args_group" ]
[]
false
false
false
true
false
let sync_session_output_args =
Cddl.t_map sync_session_output_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sync_session_input_args
val sync_session_input_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let sync_session_input_args = Cddl.t_map sync_session_input_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 86, "end_line": 308, "start_col": 16, "start_line": 308 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.sync_session_input_args_group" ]
[]
false
false
false
true
false
let sync_session_input_args =
Cddl.t_map sync_session_input_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.export_session_importer_identity
val export_session_importer_identity : FStar.UInt64.t
let export_session_importer_identity = 2uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 42, "end_line": 330, "start_col": 0, "start_line": 330 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let export_session_importer_identity =
2uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.export_session_psk
val export_session_psk : FStar.UInt64.t
let export_session_psk = 3uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 28, "end_line": 332, "start_col": 0, "start_line": 332 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let export_session_psk =
3uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sync_session_responder_counter
val sync_session_responder_counter : FStar.UInt64.t
let sync_session_responder_counter = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 40, "end_line": 311, "start_col": 0, "start_line": 311 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let sync_session_responder_counter =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.export_session_session_id
val export_session_session_id : FStar.UInt64.t
let export_session_session_id = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 35, "end_line": 328, "start_col": 0, "start_line": 328 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let export_session_session_id =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.export_session_input_args_group
val export_session_input_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 3, "end_line": 339, "start_col": 0, "start_line": 334 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.export_session_session_id", "CDDL.Spec.uint", "DPE.Messages.Spec.export_session_importer_identity", "CDDL.Spec.bytes", "DPE.Messages.Spec.export_session_psk", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let export_session_input_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal export_session_session_id) Cddl.uint) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal export_session_importer_identity) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal export_session_psk) Cddl.bytes) false (default_args_group)))
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.export_session_output_args_group
val export_session_output_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 1, "end_line": 354, "start_col": 0, "start_line": 351 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.export_session_exported_data", "CDDL.Spec.bytes", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let export_session_output_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal export_session_exported_data) Cddl.bytes) false (default_args_group)
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.import_session_retain_context
val import_session_retain_context : FStar.UInt64.t
let import_session_retain_context = 2uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 39, "end_line": 368, "start_col": 0, "start_line": 368 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let import_session_retain_context =
2uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.export_session_output_args
val export_session_output_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let export_session_output_args = Cddl.t_map export_session_output_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 93, "end_line": 361, "start_col": 17, "start_line": 361 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.export_session_output_args_group" ]
[]
false
false
false
true
false
let export_session_output_args =
Cddl.t_map export_session_output_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.export_session_exported_data
val export_session_exported_data : FStar.UInt64.t
let export_session_exported_data = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 38, "end_line": 349, "start_col": 0, "start_line": 349 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let export_session_exported_data =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.export_session_input_args
val export_session_input_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let export_session_input_args = Cddl.t_map export_session_input_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 90, "end_line": 346, "start_col": 16, "start_line": 346 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.export_session_input_args_group" ]
[]
false
false
false
true
false
let export_session_input_args =
Cddl.t_map export_session_input_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.import_session_context_handle
val import_session_context_handle : FStar.UInt64.t
let import_session_context_handle = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 39, "end_line": 366, "start_col": 0, "start_line": 366 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let import_session_context_handle =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.import_session_psk
val import_session_psk : FStar.UInt64.t
let import_session_psk = 4uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 28, "end_line": 372, "start_col": 0, "start_line": 372 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let import_session_psk =
4uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.import_session_input_args_group
val import_session_input_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 4, "end_line": 380, "start_col": 0, "start_line": 374 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.import_session_context_handle", "CDDL.Spec.bytes", "DPE.Messages.Spec.import_session_retain_context", "CDDL.Spec.t_bool", "DPE.Messages.Spec.import_session_exported_data", "DPE.Messages.Spec.import_session_psk", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let import_session_input_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal import_session_context_handle) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal import_session_retain_context) Cddl.t_bool) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal import_session_exported_data) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal import_session_psk) Cddl.bytes) false (default_args_group))))
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.import_session_importer_identity
val import_session_importer_identity : FStar.UInt64.t
let import_session_importer_identity = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 42, "end_line": 390, "start_col": 0, "start_line": 390 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let import_session_importer_identity =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.import_session_exported_data
val import_session_exported_data : FStar.UInt64.t
let import_session_exported_data = 3uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 38, "end_line": 370, "start_col": 0, "start_line": 370 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let import_session_exported_data =
3uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.import_session_output_args_group
val import_session_output_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 2, "end_line": 398, "start_col": 0, "start_line": 394 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.import_session_importer_identity", "CDDL.Spec.bytes", "DPE.Messages.Spec.import_session_new_context_handle", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let import_session_output_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal import_session_importer_identity) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal import_session_new_context_handle) Cddl.bytes) false (default_args_group))
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.initialize_context_simulation
val initialize_context_simulation : FStar.UInt64.t
let initialize_context_simulation = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 39, "end_line": 410, "start_col": 0, "start_line": 410 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let initialize_context_simulation =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.import_session_input_args
val import_session_input_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let import_session_input_args = Cddl.t_map import_session_input_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 90, "end_line": 387, "start_col": 16, "start_line": 387 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.import_session_input_args_group" ]
[]
false
false
false
true
false
let import_session_input_args =
Cddl.t_map import_session_input_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.initialize_context_use_default_context
val initialize_context_use_default_context : FStar.UInt64.t
let initialize_context_use_default_context = 2uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 48, "end_line": 412, "start_col": 0, "start_line": 412 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let initialize_context_use_default_context =
2uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.import_session_output_args
val import_session_output_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let import_session_output_args = Cddl.t_map import_session_output_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 93, "end_line": 405, "start_col": 17, "start_line": 405 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.import_session_output_args_group" ]
[]
false
false
false
true
false
let import_session_output_args =
Cddl.t_map import_session_output_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.import_session_new_context_handle
val import_session_new_context_handle : FStar.UInt64.t
let import_session_new_context_handle = 2uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 43, "end_line": 392, "start_col": 0, "start_line": 392 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let import_session_new_context_handle =
2uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.initialize_context_new_context_handle
val initialize_context_new_context_handle : FStar.UInt64.t
let initialize_context_new_context_handle = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 47, "end_line": 431, "start_col": 0, "start_line": 431 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let initialize_context_new_context_handle =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_context_handle
val derive_child_context_handle : FStar.UInt64.t
let derive_child_context_handle = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 37, "end_line": 448, "start_col": 0, "start_line": 448 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let derive_child_context_handle =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.t_create_choice_from_gen
val t_create_choice_from_gen (attr: T.term) (f: (T.term -> T.term -> T.term)) : T.Tac T.term
val t_create_choice_from_gen (attr: T.term) (f: (T.term -> T.term -> T.term)) : T.Tac T.term
let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 30, "end_line": 196, "start_col": 0, "start_line": 186 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
attr: FStar.Stubs.Reflection.Types.term -> f: (_: FStar.Stubs.Reflection.Types.term -> _: FStar.Stubs.Reflection.Types.term -> FStar.Stubs.Reflection.Types.term) -> FStar.Tactics.Effect.Tac FStar.Stubs.Reflection.Types.term
FStar.Tactics.Effect.Tac
[]
[]
[ "FStar.Stubs.Reflection.Types.term", "Prims.list", "FStar.Stubs.Reflection.Types.fv", "FStar.Stubs.Tactics.V1.Builtins.pack", "FStar.Stubs.Reflection.V1.Data.Tv_FVar", "FStar.Stubs.Reflection.V1.Builtins.lookup_attr", "FStar.Stubs.Reflection.Types.env", "FStar.Tactics.V1.Derived.cur_env" ]
[]
false
true
false
false
false
let t_create_choice_from_gen (attr: T.term) (f: (T.term -> T.term -> T.term)) : T.Tac T.term =
let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.initialize_context_seed
val initialize_context_seed : FStar.UInt64.t
let initialize_context_seed = 3uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 33, "end_line": 414, "start_col": 0, "start_line": 414 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let initialize_context_seed =
3uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.initialize_context_input_args
val initialize_context_input_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 98, "end_line": 428, "start_col": 16, "start_line": 428 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.initialize_context_input_args_group" ]
[]
false
false
false
true
false
let initialize_context_input_args =
Cddl.t_map initialize_context_input_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.initialize_context_output_args_group
val initialize_context_output_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 1, "end_line": 436, "start_col": 0, "start_line": 433 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.initialize_context_new_context_handle", "CDDL.Spec.bytes", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let initialize_context_output_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal initialize_context_new_context_handle) Cddl.bytes) false (default_args_group)
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_retain_parent_context
val derive_child_retain_parent_context : FStar.UInt64.t
let derive_child_retain_parent_context = 2uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 44, "end_line": 450, "start_col": 0, "start_line": 450 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let derive_child_retain_parent_context =
2uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.initialize_context_output_args
val initialize_context_output_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 101, "end_line": 443, "start_col": 17, "start_line": 443 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.initialize_context_output_args_group" ]
[]
false
false
false
true
false
let initialize_context_output_args =
Cddl.t_map initialize_context_output_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_create_certificate
val derive_child_create_certificate : FStar.UInt64.t
let derive_child_create_certificate = 4uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 41, "end_line": 454, "start_col": 0, "start_line": 454 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let derive_child_create_certificate =
4uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.initialize_context_input_args_group
val initialize_context_input_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 3, "end_line": 421, "start_col": 0, "start_line": 416 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.initialize_context_simulation", "CDDL.Spec.t_bool", "DPE.Messages.Spec.initialize_context_use_default_context", "DPE.Messages.Spec.initialize_context_seed", "CDDL.Spec.bytes", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let initialize_context_input_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal initialize_context_simulation) Cddl.t_bool) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal initialize_context_use_default_context) Cddl.t_bool) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal initialize_context_seed) Cddl.bytes) false (default_args_group)))
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_new_session_initiator_handshake
val derive_child_new_session_initiator_handshake : FStar.UInt64.t
let derive_child_new_session_initiator_handshake = 5uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 54, "end_line": 456, "start_col": 0, "start_line": 456 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let derive_child_new_session_initiator_handshake =
5uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_allow_child_to_derive
val derive_child_allow_child_to_derive : FStar.UInt64.t
let derive_child_allow_child_to_derive = 3uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 44, "end_line": 452, "start_col": 0, "start_line": 452 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let derive_child_allow_child_to_derive =
3uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.internal_input_type_dpe_info
val internal_input_type_dpe_info : FStar.UInt64.t
let internal_input_type_dpe_info = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 38, "end_line": 465, "start_col": 0, "start_line": 465 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let internal_input_type_dpe_info =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.internal_input_type_dpe_dice
val internal_input_type_dpe_dice : FStar.UInt64.t
let internal_input_type_dpe_dice = 2uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 38, "end_line": 467, "start_col": 0, "start_line": 467 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let internal_input_type_dpe_dice =
2uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_input_args_group
val derive_child_input_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group ))))))))
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 8, "end_line": 483, "start_col": 0, "start_line": 473 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.derive_child_context_handle", "CDDL.Spec.bytes", "DPE.Messages.Spec.derive_child_retain_parent_context", "CDDL.Spec.t_bool", "DPE.Messages.Spec.derive_child_allow_child_to_derive", "DPE.Messages.Spec.derive_child_create_certificate", "DPE.Messages.Spec.derive_child_new_session_initiator_handshake", "DPE.Messages.Spec.derive_child_new_session_is_migratable", "DPE.Messages.Spec.derive_child_input_data", "DPE.Messages.Spec.derive_child_internal_inputs", "CDDL.Spec.t_array3", "CDDL.Spec.array_group3_zero_or_more", "CDDL.Spec.array_group3_item", "DPE.Messages.Spec.internal_input_type", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let derive_child_input_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal derive_child_context_handle) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal derive_child_retain_parent_context) Cddl.t_bool) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal derive_child_allow_child_to_derive) Cddl.t_bool) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal derive_child_create_certificate) Cddl.t_bool) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal derive_child_new_session_initiator_handshake) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal derive_child_new_session_is_migratable) Cddl.t_bool) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal derive_child_input_data) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal derive_child_internal_inputs) (Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type)))) false (default_args_group))))))))
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_internal_inputs
val derive_child_internal_inputs : FStar.UInt64.t
let derive_child_internal_inputs = 8uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 38, "end_line": 462, "start_col": 0, "start_line": 462 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let derive_child_internal_inputs =
8uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.internal_input_type
val internal_input_type : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 50, "end_line": 471, "start_col": 0, "start_line": 469 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_choice", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.internal_input_type_dpe_info", "DPE.Messages.Spec.internal_input_type_dpe_dice" ]
[]
false
false
false
true
false
let internal_input_type =
(Cddl.t_uint_literal internal_input_type_dpe_info) `Cddl.t_choice` (Cddl.t_uint_literal internal_input_type_dpe_dice)
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_new_context_handle
val derive_child_new_context_handle : FStar.UInt64.t
let derive_child_new_context_handle = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 41, "end_line": 493, "start_col": 0, "start_line": 493 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let derive_child_new_context_handle =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_new_session_is_migratable
val derive_child_new_session_is_migratable : FStar.UInt64.t
let derive_child_new_session_is_migratable = 6uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 48, "end_line": 458, "start_col": 0, "start_line": 458 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let derive_child_new_session_is_migratable =
6uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_input_data
val derive_child_input_data : FStar.UInt64.t
let derive_child_input_data = 7uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 33, "end_line": 460, "start_col": 0, "start_line": 460 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let derive_child_input_data =
7uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_new_session_responder_handshake
val derive_child_new_session_responder_handshake : FStar.UInt64.t
let derive_child_new_session_responder_handshake = 2uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 54, "end_line": 495, "start_col": 0, "start_line": 495 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let derive_child_new_session_responder_handshake =
2uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_output_args_group
val derive_child_output_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 3, "end_line": 504, "start_col": 0, "start_line": 499 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.derive_child_new_context_handle", "CDDL.Spec.bytes", "DPE.Messages.Spec.derive_child_new_session_responder_handshake", "DPE.Messages.Spec.derive_child_parent_context_handle", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let derive_child_output_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal derive_child_new_context_handle) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal derive_child_new_session_responder_handshake) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal derive_child_parent_context_handle) Cddl.bytes) false (default_args_group)))
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_parent_context_handle
val derive_child_parent_context_handle : FStar.UInt64.t
let derive_child_parent_context_handle = 3uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 44, "end_line": 497, "start_col": 0, "start_line": 497 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let derive_child_parent_context_handle =
3uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.certify_key_context_handle
val certify_key_context_handle : FStar.UInt64.t
let certify_key_context_handle = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 36, "end_line": 516, "start_col": 0, "start_line": 516 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let certify_key_context_handle =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_input_args
val derive_child_input_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let derive_child_input_args = Cddl.t_map derive_child_input_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 86, "end_line": 490, "start_col": 16, "start_line": 490 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.derive_child_input_args_group" ]
[]
false
false
false
true
false
let derive_child_input_args =
Cddl.t_map derive_child_input_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.certify_key_public_key
val certify_key_public_key : FStar.UInt64.t
let certify_key_public_key = 3uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 32, "end_line": 520, "start_col": 0, "start_line": 520 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let certify_key_public_key =
3uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.certify_key_label
val certify_key_label : FStar.UInt64.t
let certify_key_label = 4uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 27, "end_line": 522, "start_col": 0, "start_line": 522 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let certify_key_label =
4uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.derive_child_output_args
val derive_child_output_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let derive_child_output_args = Cddl.t_map derive_child_output_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 89, "end_line": 511, "start_col": 17, "start_line": 511 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.derive_child_output_args_group" ]
[]
false
false
false
true
false
let derive_child_output_args =
Cddl.t_map derive_child_output_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.certify_key_policies
val certify_key_policies : FStar.UInt64.t
let certify_key_policies = 5uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 30, "end_line": 524, "start_col": 0, "start_line": 524 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let certify_key_policies =
5uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.tcg_dice_kp_attestLoc
val tcg_dice_kp_attestLoc : FStar.UInt64.t
let tcg_dice_kp_attestLoc = 9uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 31, "end_line": 533, "start_col": 0, "start_line": 533 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let tcg_dice_kp_attestLoc =
9uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.certify_key_retain_context
val certify_key_retain_context : FStar.UInt64.t
let certify_key_retain_context = 2uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 36, "end_line": 518, "start_col": 0, "start_line": 518 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let certify_key_retain_context =
2uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.tcg_dice_kp_attestInit
val tcg_dice_kp_attestInit : FStar.UInt64.t
let tcg_dice_kp_attestInit = 8uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 32, "end_line": 531, "start_col": 0, "start_line": 531 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let tcg_dice_kp_attestInit =
8uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.tcg_dice_kp_assertLoc
val tcg_dice_kp_assertLoc : FStar.UInt64.t
let tcg_dice_kp_assertLoc = 11uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 32, "end_line": 537, "start_col": 0, "start_line": 537 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let tcg_dice_kp_assertLoc =
11uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.tcg_dice_kp_assertInit
val tcg_dice_kp_assertInit : FStar.UInt64.t
let tcg_dice_kp_assertInit = 10uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 33, "end_line": 535, "start_col": 0, "start_line": 535 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let tcg_dice_kp_assertInit =
10uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.certify_key_new_context_handle
val certify_key_new_context_handle : FStar.UInt64.t
let certify_key_new_context_handle = 3uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 40, "end_line": 568, "start_col": 0, "start_line": 568 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let certify_key_new_context_handle =
3uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.tcg_dice_kp_identityInit
val tcg_dice_kp_identityInit : FStar.UInt64.t
let tcg_dice_kp_identityInit = 6uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 34, "end_line": 527, "start_col": 0, "start_line": 527 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let tcg_dice_kp_identityInit =
6uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.certify_key_derived_public_key
val certify_key_derived_public_key : FStar.UInt64.t
let certify_key_derived_public_key = 2uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 40, "end_line": 566, "start_col": 0, "start_line": 566 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let certify_key_derived_public_key =
2uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.certify_key_input_args_group
val certify_key_input_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group )))))
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 5, "end_line": 554, "start_col": 0, "start_line": 547 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.certify_key_context_handle", "CDDL.Spec.bytes", "DPE.Messages.Spec.certify_key_retain_context", "CDDL.Spec.t_bool", "DPE.Messages.Spec.certify_key_public_key", "DPE.Messages.Spec.certify_key_label", "DPE.Messages.Spec.certify_key_policies", "CDDL.Spec.t_array3", "CDDL.Spec.array_group3_zero_or_more", "CDDL.Spec.array_group3_item", "DPE.Messages.Spec.policy_type", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let certify_key_input_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal certify_key_context_handle) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal certify_key_retain_context) Cddl.t_bool) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal certify_key_public_key) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal certify_key_label) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal certify_key_policies) (Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type )))) false (default_args_group)))))
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.certify_key_output_args_group
val certify_key_output_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 3, "end_line": 575, "start_col": 0, "start_line": 570 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.certify_key_certificate_chain", "CDDL.Spec.t_array3", "CDDL.Spec.array_group3_one_or_more", "CDDL.Spec.array_group3_item", "CDDL.Spec.bytes", "DPE.Messages.Spec.certify_key_derived_public_key", "DPE.Messages.Spec.certify_key_new_context_handle", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let certify_key_output_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal certify_key_certificate_chain) (Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes)))) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal certify_key_derived_public_key) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal certify_key_new_context_handle) Cddl.bytes) false (default_args_group)))
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.certify_key_certificate_chain
val certify_key_certificate_chain : FStar.UInt64.t
let certify_key_certificate_chain = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 39, "end_line": 564, "start_col": 0, "start_line": 564 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let certify_key_certificate_chain =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.policy_type
val policy_type : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 43, "end_line": 545, "start_col": 0, "start_line": 539 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_choice", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.tcg_dice_kp_identityInit", "DPE.Messages.Spec.tcg_dice_kp_identityLoc", "DPE.Messages.Spec.tcg_dice_kp_attestInit", "DPE.Messages.Spec.tcg_dice_kp_attestLoc", "DPE.Messages.Spec.tcg_dice_kp_assertInit", "DPE.Messages.Spec.tcg_dice_kp_assertLoc" ]
[]
false
false
false
true
false
let policy_type =
(((((Cddl.t_uint_literal tcg_dice_kp_identityInit) `Cddl.t_choice` (Cddl.t_uint_literal tcg_dice_kp_identityLoc)) `Cddl.t_choice` (Cddl.t_uint_literal tcg_dice_kp_attestInit)) `Cddl.t_choice` (Cddl.t_uint_literal tcg_dice_kp_attestLoc)) `Cddl.t_choice` (Cddl.t_uint_literal tcg_dice_kp_assertInit)) `Cddl.t_choice` (Cddl.t_uint_literal tcg_dice_kp_assertLoc)
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.tcg_dice_kp_identityLoc
val tcg_dice_kp_identityLoc : FStar.UInt64.t
let tcg_dice_kp_identityLoc = 7uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 33, "end_line": 529, "start_col": 0, "start_line": 529 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let tcg_dice_kp_identityLoc =
7uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.certify_key_output_args
val certify_key_output_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let certify_key_output_args = Cddl.t_map certify_key_output_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 87, "end_line": 582, "start_col": 17, "start_line": 582 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.certify_key_output_args_group" ]
[]
false
false
false
true
false
let certify_key_output_args =
Cddl.t_map certify_key_output_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sign_is_symmetric
val sign_is_symmetric : FStar.UInt64.t
let sign_is_symmetric = 4uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 27, "end_line": 593, "start_col": 0, "start_line": 593 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let sign_is_symmetric =
4uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.certify_key_input_args
val certify_key_input_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let certify_key_input_args = Cddl.t_map certify_key_input_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 84, "end_line": 561, "start_col": 16, "start_line": 561 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.certify_key_input_args_group" ]
[]
false
false
false
true
false
let certify_key_input_args =
Cddl.t_map certify_key_input_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sign_context_handle
val sign_context_handle : FStar.UInt64.t
let sign_context_handle = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 29, "end_line": 587, "start_col": 0, "start_line": 587 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let sign_context_handle =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sign_to_be_signed
val sign_to_be_signed : FStar.UInt64.t
let sign_to_be_signed = 5uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 27, "end_line": 595, "start_col": 0, "start_line": 595 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let sign_to_be_signed =
5uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sign_label
val sign_label : FStar.UInt64.t
let sign_label = 3uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 20, "end_line": 591, "start_col": 0, "start_line": 591 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let sign_label =
3uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sign_output_args
val sign_output_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let sign_output_args = Cddl.t_map sign_output_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 73, "end_line": 629, "start_col": 17, "start_line": 629 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (sign_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_input_args_group #pop-options [@@_input_args] let sign_input_args = Cddl.t_map sign_input_args_group [@@CMacro] let sign_signature = 1uL [@@CMacro] let sign_new_context_handle = 2uL let sign_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_signature `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sign_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_output_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.sign_output_args_group" ]
[]
false
false
false
true
false
let sign_output_args =
Cddl.t_map sign_output_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sign_retain_context
val sign_retain_context : FStar.UInt64.t
let sign_retain_context = 2uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 29, "end_line": 589, "start_col": 0, "start_line": 589 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let sign_retain_context =
2uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sign_new_context_handle
val sign_new_context_handle : FStar.UInt64.t
let sign_new_context_handle = 2uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 33, "end_line": 616, "start_col": 0, "start_line": 616 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (sign_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_input_args_group #pop-options [@@_input_args] let sign_input_args = Cddl.t_map sign_input_args_group [@@CMacro] let sign_signature = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let sign_new_context_handle =
2uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.seal_retain_context
val seal_retain_context : FStar.UInt64.t
let seal_retain_context = 2uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 29, "end_line": 636, "start_col": 0, "start_line": 636 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (sign_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_input_args_group #pop-options [@@_input_args] let sign_input_args = Cddl.t_map sign_input_args_group [@@CMacro] let sign_signature = 1uL [@@CMacro] let sign_new_context_handle = 2uL let sign_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_signature `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sign_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_output_args_group #pop-options [@@_output_args] let sign_output_args = Cddl.t_map sign_output_args_group // Section 6.11 [@@CMacro] let seal_context_handle = 1uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let seal_retain_context =
2uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sign_signature
val sign_signature : FStar.UInt64.t
let sign_signature = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 24, "end_line": 614, "start_col": 0, "start_line": 614 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (sign_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_input_args_group #pop-options [@@_input_args] let sign_input_args = Cddl.t_map sign_input_args_group
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let sign_signature =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sign_input_args_group
val sign_input_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))))
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 5, "end_line": 604, "start_col": 0, "start_line": 597 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.sign_context_handle", "CDDL.Spec.bytes", "DPE.Messages.Spec.sign_retain_context", "CDDL.Spec.t_bool", "DPE.Messages.Spec.sign_label", "DPE.Messages.Spec.sign_is_symmetric", "DPE.Messages.Spec.sign_to_be_signed", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let sign_input_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal sign_context_handle) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal sign_retain_context) Cddl.t_bool) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal sign_label) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal sign_is_symmetric) Cddl.t_bool) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal sign_to_be_signed) Cddl.bytes) false (default_args_group)))))
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.seal_label
val seal_label : FStar.UInt64.t
let seal_label = 4uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 20, "end_line": 640, "start_col": 0, "start_line": 640 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (sign_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_input_args_group #pop-options [@@_input_args] let sign_input_args = Cddl.t_map sign_input_args_group [@@CMacro] let sign_signature = 1uL [@@CMacro] let sign_new_context_handle = 2uL let sign_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_signature `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sign_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_output_args_group #pop-options [@@_output_args] let sign_output_args = Cddl.t_map sign_output_args_group // Section 6.11 [@@CMacro] let seal_context_handle = 1uL [@@CMacro] let seal_retain_context = 2uL [@@CMacro] let seal_unseal_policy = 3uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let seal_label =
4uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.seal_unseal_policy
val seal_unseal_policy : FStar.UInt64.t
let seal_unseal_policy = 3uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 28, "end_line": 638, "start_col": 0, "start_line": 638 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (sign_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_input_args_group #pop-options [@@_input_args] let sign_input_args = Cddl.t_map sign_input_args_group [@@CMacro] let sign_signature = 1uL [@@CMacro] let sign_new_context_handle = 2uL let sign_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_signature `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sign_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_output_args_group #pop-options [@@_output_args] let sign_output_args = Cddl.t_map sign_output_args_group // Section 6.11 [@@CMacro] let seal_context_handle = 1uL [@@CMacro] let seal_retain_context = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let seal_unseal_policy =
3uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.seal_data_to_seal
val seal_data_to_seal : FStar.UInt64.t
let seal_data_to_seal = 5uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 27, "end_line": 642, "start_col": 0, "start_line": 642 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (sign_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_input_args_group #pop-options [@@_input_args] let sign_input_args = Cddl.t_map sign_input_args_group [@@CMacro] let sign_signature = 1uL [@@CMacro] let sign_new_context_handle = 2uL let sign_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_signature `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sign_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_output_args_group #pop-options [@@_output_args] let sign_output_args = Cddl.t_map sign_output_args_group // Section 6.11 [@@CMacro] let seal_context_handle = 1uL [@@CMacro] let seal_retain_context = 2uL [@@CMacro] let seal_unseal_policy = 3uL [@@CMacro] let seal_label = 4uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let seal_data_to_seal =
5uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.seal_context_handle
val seal_context_handle : FStar.UInt64.t
let seal_context_handle = 1uL
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 29, "end_line": 634, "start_col": 0, "start_line": 634 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (sign_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_input_args_group #pop-options [@@_input_args] let sign_input_args = Cddl.t_map sign_input_args_group [@@CMacro] let sign_signature = 1uL [@@CMacro] let sign_new_context_handle = 2uL let sign_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_signature `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sign_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_output_args_group #pop-options [@@_output_args] let sign_output_args = Cddl.t_map sign_output_args_group // Section 6.11
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
FStar.UInt64.t
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.__uint_to_t" ]
[]
false
false
false
true
false
let seal_context_handle =
1uL
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sign_output_args_group
val sign_output_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let sign_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_signature `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 2, "end_line": 622, "start_col": 0, "start_line": 618 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (sign_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_input_args_group #pop-options [@@_input_args] let sign_input_args = Cddl.t_map sign_input_args_group [@@CMacro] let sign_signature = 1uL [@@CMacro] let sign_new_context_handle = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.sign_signature", "CDDL.Spec.bytes", "DPE.Messages.Spec.sign_new_context_handle", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let sign_output_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal sign_signature) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal sign_new_context_handle) Cddl.bytes) false (default_args_group))
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.seal_output_args_group
val seal_output_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let seal_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_sealed_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 2, "end_line": 669, "start_col": 0, "start_line": 665 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (sign_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_input_args_group #pop-options [@@_input_args] let sign_input_args = Cddl.t_map sign_input_args_group [@@CMacro] let sign_signature = 1uL [@@CMacro] let sign_new_context_handle = 2uL let sign_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_signature `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sign_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_output_args_group #pop-options [@@_output_args] let sign_output_args = Cddl.t_map sign_output_args_group // Section 6.11 [@@CMacro] let seal_context_handle = 1uL [@@CMacro] let seal_retain_context = 2uL [@@CMacro] let seal_unseal_policy = 3uL [@@CMacro] let seal_label = 4uL [@@CMacro] let seal_data_to_seal = 5uL let seal_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_unseal_policy `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_data_to_seal `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (seal_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv seal_input_args_group #pop-options [@@_input_args] let seal_input_args = Cddl.t_map seal_input_args_group [@@CMacro] let seal_sealed_data = 1uL [@@CMacro] let seal_new_context_handle = 2uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.seal_sealed_data", "CDDL.Spec.bytes", "DPE.Messages.Spec.seal_new_context_handle", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let seal_output_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal seal_sealed_data) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal seal_new_context_handle) Cddl.bytes) false (default_args_group))
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.seal_input_args
val seal_input_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let seal_input_args = Cddl.t_map seal_input_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 70, "end_line": 658, "start_col": 16, "start_line": 658 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (sign_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_input_args_group #pop-options [@@_input_args] let sign_input_args = Cddl.t_map sign_input_args_group [@@CMacro] let sign_signature = 1uL [@@CMacro] let sign_new_context_handle = 2uL let sign_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_signature `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sign_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_output_args_group #pop-options [@@_output_args] let sign_output_args = Cddl.t_map sign_output_args_group // Section 6.11 [@@CMacro] let seal_context_handle = 1uL [@@CMacro] let seal_retain_context = 2uL [@@CMacro] let seal_unseal_policy = 3uL [@@CMacro] let seal_label = 4uL [@@CMacro] let seal_data_to_seal = 5uL let seal_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_unseal_policy `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_data_to_seal `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (seal_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv seal_input_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.seal_input_args_group" ]
[]
false
false
false
true
false
let seal_input_args =
Cddl.t_map seal_input_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.sign_input_args
val sign_input_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let sign_input_args = Cddl.t_map sign_input_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 70, "end_line": 611, "start_col": 16, "start_line": 611 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (sign_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_input_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.sign_input_args_group" ]
[]
false
false
false
true
false
let sign_input_args =
Cddl.t_map sign_input_args_group
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.seal_input_args_group
val seal_input_args_group : CDDL.Spec.map_group FStar.Pervasives.Native.None
let seal_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_unseal_policy `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_data_to_seal `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))))
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 5, "end_line": 651, "start_col": 0, "start_line": 644 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (sign_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_input_args_group #pop-options [@@_input_args] let sign_input_args = Cddl.t_map sign_input_args_group [@@CMacro] let sign_signature = 1uL [@@CMacro] let sign_new_context_handle = 2uL let sign_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_signature `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sign_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_output_args_group #pop-options [@@_output_args] let sign_output_args = Cddl.t_map sign_output_args_group // Section 6.11 [@@CMacro] let seal_context_handle = 1uL [@@CMacro] let seal_retain_context = 2uL [@@CMacro] let seal_unseal_policy = 3uL [@@CMacro] let seal_label = 4uL [@@CMacro] let seal_data_to_seal = 5uL
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.map_group FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.map_group_cons_zero_or_one", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "CDDL.Spec.MapGroupEntry", "CDDL.Spec.t_uint_literal", "DPE.Messages.Spec.seal_context_handle", "CDDL.Spec.bytes", "DPE.Messages.Spec.seal_retain_context", "CDDL.Spec.t_bool", "DPE.Messages.Spec.seal_unseal_policy", "DPE.Messages.Spec.seal_label", "DPE.Messages.Spec.seal_data_to_seal", "DPE.Messages.Spec.default_args_group" ]
[]
false
false
false
true
false
let seal_input_args_group =
Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal seal_context_handle) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal seal_retain_context) Cddl.t_bool) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal seal_unseal_policy) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal seal_label) Cddl.bytes) false (Cddl.map_group_cons_zero_or_one (Cddl.MapGroupEntry (Cddl.t_uint_literal seal_data_to_seal) Cddl.bytes) false (default_args_group)))))
false
DPE.Messages.Spec.fst
DPE.Messages.Spec.seal_output_args
val seal_output_args : CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
let seal_output_args = Cddl.t_map seal_output_args_group
{ "file_name": "share/steel/examples/pulse/dice/dpe/DPE.Messages.Spec.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 73, "end_line": 676, "start_col": 17, "start_line": 676 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module DPE.Messages.Spec module Cddl = CDDL.Spec module Cbor = CBOR.Spec module U64 = FStar.UInt64 module U8 = FStar.UInt8 (* TCG DICE Protection Engine, Version 1.0, Revision 0.6 *) // Section 5.9.2: DPE uses CBOR (RFC 8949) Section 4.2.1 let data_item_order = Cbor.deterministically_encoded_cbor_map_key_order // Section 5.9.3 let session_message : Cddl.typ = Cddl.t_array3 ( Cddl.array_group3_item (* session-id *) Cddl.uint `Cddl.array_group3_concat` Cddl.array_group3_item (* message *) Cddl.bytes ) // Section 5.9.4 [@@CMacro] let get_profile = 1uL [@@CMacro] let open_session = 2uL [@@CMacro] let close_session = 3uL [@@CMacro] let sync_session = 4uL [@@CMacro] let export_session = 5uL [@@CMacro] let import_session = 6uL [@@CMacro] let initialize_context = 7uL [@@CMacro] let derive_child = 8uL [@@CMacro] let certify_key = 9uL [@@CMacro] let sign = 10uL [@@CMacro] let seal = 11uL [@@CMacro] let unseal = 12uL [@@CMacro] let derive_sealing_public_key = 13uL [@@CMacro] let rotate_context_handle = 14uL [@@CMacro] let destroy_context = 15uL let command_id = Cddl.t_uint_literal get_profile `Cddl.t_choice` Cddl.t_uint_literal open_session `Cddl.t_choice` Cddl.t_uint_literal close_session `Cddl.t_choice` Cddl.t_uint_literal sync_session `Cddl.t_choice` Cddl.t_uint_literal export_session `Cddl.t_choice` Cddl.t_uint_literal import_session `Cddl.t_choice` Cddl.t_uint_literal initialize_context `Cddl.t_choice` Cddl.t_uint_literal derive_child `Cddl.t_choice` Cddl.t_uint_literal certify_key `Cddl.t_choice` Cddl.t_uint_literal sign `Cddl.t_choice` Cddl.t_uint_literal seal `Cddl.t_choice` Cddl.t_uint_literal unseal `Cddl.t_choice` Cddl.t_uint_literal derive_sealing_public_key `Cddl.t_choice` Cddl.t_uint_literal rotate_context_handle `Cddl.t_choice` Cddl.t_uint_literal destroy_context [@@CMacro] let no_error = 0uL [@@CMacro] let internal_error = 1uL [@@CMacro] let invalid_command = 2uL [@@CMacro] let invalid_argument = 3uL [@@CMacro] let argument_not_supported = 4uL [@@CMacro] let session_exhausted = 5uL let error_code = Cddl.t_uint_literal no_error `Cddl.t_choice` Cddl.t_uint_literal internal_error `Cddl.t_choice` Cddl.t_uint_literal invalid_command `Cddl.t_choice` Cddl.t_uint_literal invalid_argument `Cddl.t_choice` Cddl.t_uint_literal argument_not_supported `Cddl.t_choice` Cddl.t_uint_literal session_exhausted let _input_args = () let _output_args = () // Section 7.4 let _pd_attribute_bool = () let _pd_attribute_number = () let _pd_attribute_string = () [@@_pd_attribute_string; CMacro] let pd_name = 1uL [@@_pd_attribute_number; CMacro] let pd_dpe_spec_version = 2uL [@@_pd_attribute_number; CMacro] let pd_max_message_size = 3uL [@@_pd_attribute_bool; CMacro] let pd_uses_multi_part_messaghes = 4uL [@@_pd_attribute_bool; CMacro] let pd_supports_concurrent_operations = 5uL [@@_pd_attribute_bool; CMacro] let pd_supports_encrypted_sessions = 6uL [@@_pd_attribute_bool; CMacro] let pd_supports_derived_sessions = 7uL [@@_pd_attribute_number; CMacro] let pd_max_sessions = 8uL [@@_pd_attribute_string; CMacro] let pd_session_protocol = 9uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_sync = 10uL [@@_pd_attribute_string; CMacro] let pd_session_sync_policy = 11uL [@@_pd_attribute_bool; CMacro] let pd_supports_session_migration = 12uL [@@_pd_attribute_string; CMacro] let pd_session_migration_protocol = 13uL [@@_pd_attribute_bool; CMacro] let pd_supports_default_context = 14uL [@@_pd_attribute_bool; CMacro] let pd_supports_context_handles = 15uL [@@_pd_attribute_number; CMacro] let pd_max_contexts_per_session = 16uL [@@_pd_attribute_number; CMacro] let pd_max_context_handle_size = 17uL [@@_pd_attribute_bool; CMacro] let pd_supports_auto_init = 18uL [@@_pd_attribute_bool; CMacro] let pd_supports_simulation = 19uL [@@_pd_attribute_bool; CMacro] let pd_supports_attestation = 20uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing = 21uL [@@_pd_attribute_bool; CMacro] let pd_supports_get_profile = 22uL [@@_pd_attribute_bool; CMacro] let pd_supports_open_session = 23uL [@@_pd_attribute_bool; CMacro] let pd_supports_close_session = 24uL [@@_pd_attribute_bool; CMacro] let pd_supports_sync_session = 25uL [@@_pd_attribute_bool; CMacro] let pd_supports_export_session = 26uL [@@_pd_attribute_bool; CMacro] let pd_supports_import_session = 27uL [@@_pd_attribute_bool; CMacro] let pd_supports_init_context = 28uL [@@_pd_attribute_bool; CMacro] let pd_supports_certify_key = 29uL [@@_pd_attribute_bool; CMacro] let pd_supports_sign = 30uL [@@_pd_attribute_bool; CMacro] let pd_supports_seal = 31uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal = 32uL [@@_pd_attribute_bool; CMacro] let pd_supports_sealing_public = 33uL [@@_pd_attribute_bool; CMacro] let pd_supports_rotate_context_handle = 34uL [@@_pd_attribute_string; CMacro] let pd_dice_derivation = 35uL [@@_pd_attribute_string; CMacro] let pd_asymmetric_derivation = 36uL [@@_pd_attribute_string; CMacro] let pd_symmetric_derivation = 37uL [@@_pd_attribute_bool; CMacro] let pd_supports_any_label = 38uL [@@_pd_attribute_string; CMacro] let pd_supported_labels = 39uL [@@_pd_attribute_string; CMacro] let pd_initial_derivation = 40uL [@@_pd_attribute_string; CMacro] let pd_input_format = 41uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_inputs = 42uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_info = 43uL [@@_pd_attribute_bool; CMacro] let pd_supports_internal_dpe_dice = 44uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_info_type = 45uL [@@_pd_attribute_string; CMacro] let pd_internal_dpe_dice_type = 46uL [@@_pd_attribute_string; CMacro] let pd_internal_inputs = 47uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificates = 48uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_size = 49uL [@@_pd_attribute_number; CMacro] let pd_max_certificate_chain_size = 50uL [@@_pd_attribute_bool; CMacro] let pd_appends_more_certificates = 51uL [@@_pd_attribute_bool; CMacro] let pd_supports_certificate_policies = 52uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_init = 53uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_identity_loc = 54uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_init = 55uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_attest_loc = 56uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_init = 57uL [@@_pd_attribute_bool; CMacro] let pd_supports_policy_assert_loc = 58uL [@@_pd_attribute_string; CMacro] let pd_certificate_policies = 59uL [@@_pd_attribute_bool; CMacro] let pd_supports_eca_certificates = 60uL [@@_pd_attribute_string; CMacro] let pd_eca_certificate_format = 61uL [@@_pd_attribute_string; CMacro] let pd_leaf_certificate_format = 62uL [@@_pd_attribute_string; CMacro] let pd_public_key_format = 63uL [@@_pd_attribute_bool; CMacro] let pd_supports_external_key = 64uL [@@_pd_attribute_string; CMacro] let pd_to_be_signed_format = 65uL [@@_pd_attribute_string; CMacro] let pd_signature_format = 66uL [@@_pd_attribute_bool; CMacro] let pd_supports_symmetric_sign = 67uL [@@_pd_attribute_bool; CMacro] let pd_supports_asymmetric_unseal = 68uL [@@_pd_attribute_bool; CMacro] let pd_supports_unseal_policy = 69uL [@@_pd_attribute_string; CMacro] let pd_unseal_policy_format = 70uL module T = FStar.Tactics [@@noextract_to "krml"] let t_create_choice_from_gen (attr: T.term) (f: T.term -> T.term -> T.term) : T.Tac T.term = let e = T.cur_env () in let l = T.lookup_attr attr e in let rec aux (accu: T.term) (l: list T.fv) : T.Tac T.term = match l with | [] -> accu | v :: l' -> let accu' = f accu (T.pack (T.Tv_FVar v)) in aux accu' l' in aux (`Cddl.t_always_false) l [@@noextract_to "krml"] let create_uint_choice_from (attr: T.term) : T.Tac unit = T.exact (t_create_choice_from_gen attr (fun accu t -> T.mk_e_app (`Cddl.t_choice) [ T.mk_e_app (`Cddl.t_uint_literal) [ t ]; accu; ] )) let pd_attribute_bool : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_bool)) let pd_attribute_number : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_number)) let pd_attribute_string : Cddl.typ = _ by (create_uint_choice_from (`_pd_attribute_string)) let profile_descriptor : Cddl.typ = Cddl.t_map ( Cddl.map_group_cons_zero_or_more (pd_attribute_bool `Cddl.MapGroupEntry` Cddl.t_bool) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_number `Cddl.MapGroupEntry` Cddl.uint) false (* FIXME: really? *) ( Cddl.map_group_cons_zero_or_more (pd_attribute_string `Cddl.MapGroupEntry` Cddl.tstr) false (* FIXME: really? *) ( Cddl.map_group_empty )))) // Section 6.1 let default_args_group = Cddl.map_group_cons_zero_or_more (Cddl.uint `Cddl.MapGroupEntry` Cddl.any) false Cddl.map_group_empty [@@_input_args] let get_profile_input_args : Cddl.typ = Cddl.t_map ( default_args_group ) [@@CMacro] let get_profile_profile_descriptor = 1uL let get_profile_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal get_profile_profile_descriptor `Cddl.MapGroupEntry` profile_descriptor) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (get_profile_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv get_profile_output_args_group #pop-options [@@_output_args] let get_profile_output_args : Cddl.typ = Cddl.t_map ( get_profile_output_args_group ) // Section 6.2 [@@CMacro] let open_session_initiator_handshake = 1uL [@@CMacro] let open_session_is_migratable = 2uL let open_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (open_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_input_args_group #pop-options [@@_input_args] let open_session_input_args = Cddl.t_map open_session_input_args_group [@@CMacro] let open_session_responder_handshake = 1uL let open_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal open_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (open_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv open_session_output_args_group #pop-options [@@_output_args] let open_session_output_args = Cddl.t_map open_session_output_args_group let responder_handshake_payload = Cddl.uint // Section 6.3 [@@_input_args] let close_session_input_args = Cddl.t_map default_args_group [@@_output_args] let close_session_output_args = Cddl.t_map default_args_group // Section 6.4 [@@CMacro] let sync_session_session_id = 1uL [@@CMacro] let sync_session_initiator_counter = 2uL let sync_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_initiator_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sync_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_input_args_group #pop-options [@@_input_args] let sync_session_input_args = Cddl.t_map sync_session_input_args_group [@@CMacro] let sync_session_responder_counter = 1uL let sync_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sync_session_responder_counter `Cddl.MapGroupEntry` Cddl.uint) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (sync_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sync_session_output_args_group #pop-options [@@_output_args] let sync_session_output_args = Cddl.t_map sync_session_output_args_group // Section 6.5 [@@CMacro] let export_session_session_id = 1uL [@@CMacro] let export_session_importer_identity = 2uL [@@CMacro] let export_session_psk = 3uL let export_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_session_id `Cddl.MapGroupEntry` Cddl.uint) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (export_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_input_args_group #pop-options [@@_input_args] let export_session_input_args = Cddl.t_map export_session_input_args_group [@@CMacro] let export_session_exported_data = 1uL let export_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal export_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (export_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv export_session_output_args_group #pop-options [@@_output_args] let export_session_output_args = Cddl.t_map export_session_output_args_group // Section 6.6 [@@CMacro] let import_session_context_handle = 1uL [@@CMacro] let import_session_retain_context = 2uL [@@CMacro] let import_session_exported_data = 3uL [@@CMacro] let import_session_psk = 4uL let import_session_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_exported_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_psk `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )))) #push-options "--z3rlimit 32" let _ : squash (import_session_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_input_args_group #pop-options [@@_input_args] let import_session_input_args = Cddl.t_map import_session_input_args_group [@@CMacro] let import_session_importer_identity = 1uL [@@CMacro] let import_session_new_context_handle = 2uL let import_session_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_importer_identity `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal import_session_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (import_session_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv import_session_output_args_group #pop-options [@@_output_args] let import_session_output_args = Cddl.t_map import_session_output_args_group // Section 6.7 [@@CMacro] let initialize_context_simulation = 1uL [@@CMacro] let initialize_context_use_default_context = 2uL [@@CMacro] let initialize_context_seed = 3uL let initialize_context_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_simulation `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_use_default_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_seed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (initialize_context_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_input_args_group #pop-options [@@_input_args] let initialize_context_input_args = Cddl.t_map initialize_context_input_args_group [@@CMacro] let initialize_context_new_context_handle = 1uL let initialize_context_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal initialize_context_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ) #push-options "--z3rlimit 32" let _ : squash (initialize_context_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv initialize_context_output_args_group #pop-options [@@_output_args] let initialize_context_output_args = Cddl.t_map initialize_context_output_args_group // Section 6.8 [@@CMacro] let derive_child_context_handle = 1uL [@@CMacro] let derive_child_retain_parent_context = 2uL [@@CMacro] let derive_child_allow_child_to_derive = 3uL [@@CMacro] let derive_child_create_certificate = 4uL [@@CMacro] let derive_child_new_session_initiator_handshake = 5uL [@@CMacro] let derive_child_new_session_is_migratable = 6uL [@@CMacro] let derive_child_input_data = 7uL [@@CMacro] let derive_child_internal_inputs = 8uL [@@CMacro] let internal_input_type_dpe_info = 1uL [@@CMacro] let internal_input_type_dpe_dice = 2uL let internal_input_type = Cddl.t_uint_literal internal_input_type_dpe_info `Cddl.t_choice` Cddl.t_uint_literal internal_input_type_dpe_dice let derive_child_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_retain_parent_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_allow_child_to_derive `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_create_certificate `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_initiator_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_is_migratable `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_input_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_internal_inputs `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item internal_input_type))) false ( default_args_group )))))))) #push-options "--z3rlimit 32 --fuel 10" let _ : squash (derive_child_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_input_args_group #pop-options [@@_input_args] let derive_child_input_args = Cddl.t_map derive_child_input_args_group [@@CMacro] let derive_child_new_context_handle = 1uL [@@CMacro] let derive_child_new_session_responder_handshake = 2uL [@@CMacro] let derive_child_parent_context_handle = 3uL let derive_child_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_new_session_responder_handshake `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal derive_child_parent_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (derive_child_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv derive_child_output_args_group #pop-options [@@_output_args] let derive_child_output_args = Cddl.t_map derive_child_output_args_group // Section 6.9 [@@CMacro] let certify_key_context_handle = 1uL [@@CMacro] let certify_key_retain_context = 2uL [@@CMacro] let certify_key_public_key = 3uL [@@CMacro] let certify_key_label = 4uL [@@CMacro] let certify_key_policies = 5uL [@@CMacro] let tcg_dice_kp_identityInit = 6uL [@@CMacro] let tcg_dice_kp_identityLoc = 7uL [@@CMacro] let tcg_dice_kp_attestInit = 8uL [@@CMacro] let tcg_dice_kp_attestLoc = 9uL [@@CMacro] let tcg_dice_kp_assertInit = 10uL [@@CMacro] let tcg_dice_kp_assertLoc = 11uL let policy_type = Cddl.t_uint_literal tcg_dice_kp_identityInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_identityLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_attestLoc `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertInit `Cddl.t_choice` Cddl.t_uint_literal tcg_dice_kp_assertLoc let certify_key_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_policies `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_zero_or_more (Cddl.array_group3_item policy_type))) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (certify_key_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_input_args_group #pop-options [@@_input_args] let certify_key_input_args = Cddl.t_map certify_key_input_args_group [@@CMacro] let certify_key_certificate_chain = 1uL [@@CMacro] let certify_key_derived_public_key = 2uL [@@CMacro] let certify_key_new_context_handle = 3uL let certify_key_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_certificate_chain `Cddl.MapGroupEntry` Cddl.t_array3 (Cddl.array_group3_one_or_more (Cddl.array_group3_item Cddl.bytes))) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_derived_public_key `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal certify_key_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))) #push-options "--z3rlimit 32" let _ : squash (certify_key_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv certify_key_output_args_group #pop-options [@@_output_args] let certify_key_output_args = Cddl.t_map certify_key_output_args_group // Section 6.10 [@@CMacro] let sign_context_handle = 1uL [@@CMacro] let sign_retain_context = 2uL [@@CMacro] let sign_label = 3uL [@@CMacro] let sign_is_symmetric = 4uL [@@CMacro] let sign_to_be_signed = 5uL let sign_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_is_symmetric `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_to_be_signed `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (sign_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_input_args_group #pop-options [@@_input_args] let sign_input_args = Cddl.t_map sign_input_args_group [@@CMacro] let sign_signature = 1uL [@@CMacro] let sign_new_context_handle = 2uL let sign_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_signature `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal sign_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (sign_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv sign_output_args_group #pop-options [@@_output_args] let sign_output_args = Cddl.t_map sign_output_args_group // Section 6.11 [@@CMacro] let seal_context_handle = 1uL [@@CMacro] let seal_retain_context = 2uL [@@CMacro] let seal_unseal_policy = 3uL [@@CMacro] let seal_label = 4uL [@@CMacro] let seal_data_to_seal = 5uL let seal_input_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_retain_context `Cddl.MapGroupEntry` Cddl.t_bool) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_unseal_policy `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_label `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_data_to_seal `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group ))))) #push-options "--z3rlimit 32" let _ : squash (seal_input_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv seal_input_args_group #pop-options [@@_input_args] let seal_input_args = Cddl.t_map seal_input_args_group [@@CMacro] let seal_sealed_data = 1uL [@@CMacro] let seal_new_context_handle = 2uL let seal_output_args_group = Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_sealed_data `Cddl.MapGroupEntry` Cddl.bytes) false ( Cddl.map_group_cons_zero_or_one (Cddl.t_uint_literal seal_new_context_handle `Cddl.MapGroupEntry` Cddl.bytes) false ( default_args_group )) #push-options "--z3rlimit 32" let _ : squash (seal_output_args_group `Cddl.map_group_equiv` default_args_group) = Cddl.map_group_ignore_restricted_entries_no_one_equiv seal_output_args_group #pop-options
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.Tactics.Effect.fsti.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.fsti.checked", "CDDL.Spec.fsti.checked", "CBOR.Spec.fsti.checked" ], "interface_file": false, "source_file": "DPE.Messages.Spec.fst" }
[ { "abbrev": true, "full_module": "FStar.Tactics", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.UInt8", "short_module": "U8" }, { "abbrev": true, "full_module": "FStar.UInt64", "short_module": "U64" }, { "abbrev": true, "full_module": "CBOR.Spec", "short_module": "Cbor" }, { "abbrev": true, "full_module": "CDDL.Spec", "short_module": "Cddl" }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "DPE.Messages", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": 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
CDDL.Spec.bounded_typ_gen FStar.Pervasives.Native.None
Prims.Tot
[ "total" ]
[]
[ "CDDL.Spec.t_map", "FStar.Pervasives.Native.None", "CBOR.Spec.Type.raw_data_item", "DPE.Messages.Spec.seal_output_args_group" ]
[]
false
false
false
true
false
let seal_output_args =
Cddl.t_map seal_output_args_group
false