val certificateExtension_case_of_extensionType (x: extensionType) : Type0
val certificateExtension_case_of_extensionType (x: extensionType) : Type0
let certificateExtension_case_of_extensionType (x:extensionType) : Type0 =
  match x with
  | Status_request -> certificateExtension_e_status_request
  | Signed_certificate_timestamp -> certificateExtension_e_signed_certificate_timestamp
  | Key_share -> certificateExtension_e_default
  | Signature_algorithms_cert -> certificateExtension_e_default
  | Post_handshake_auth -> certificateExtension_e_default
  | Oid_filters -> certificateExtension_e_default
  | Certificate_authorities -> certificateExtension_e_default
  | Psk_key_exchange_modes -> certificateExtension_e_default
  | Cookie -> certificateExtension_e_default
  | Supported_versions -> certificateExtension_e_default
  | Early_data -> certificateExtension_e_default
  | Pre_shared_key -> certificateExtension_e_default
  | Session_ticket -> certificateExtension_e_default
  | Extended_master_secret -> certificateExtension_e_default
  | Encrypt_then_mac -> certificateExtension_e_default
  | Padding -> certificateExtension_e_default
  | Server_certificate_type -> certificateExtension_e_default
  | Client_certificate_type -> certificateExtension_e_default
  | Application_layer_protocol_negotiation -> certificateExtension_e_default
  | Heartbeat -> certificateExtension_e_default
  | Use_srtp -> certificateExtension_e_default
  | Signature_algorithms -> certificateExtension_e_default
  | Ec_point_formats -> certificateExtension_e_default
  | Supported_groups -> certificateExtension_e_default
  | Max_fragment_length -> certificateExtension_e_default
  | Server_name -> certificateExtension_e_default
  | Unknown_extensionType _ -> squash False
module MiTLS.Parsers.CertificateExtension

(* This file has been automatically generated by EverParse. *)
open FStar.Bytes
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module LP = LowParse.Spec
module LT = LowParse.TacLib
module LS = LowParse.SLow
module LSZ = LowParse.SLow
module LPI = LowParse.Spec.AllIntegers
module LL = LowParse.Low
module L = FStar.List.Tot
module B = LowStar.Buffer
module BY = FStar.Bytes
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST

#reset-options "--using_facts_from '* -FStar.Tactics -FStar.Reflection' --z3rlimit 16 --z3cliopt smt.arith.nl=false --max_fuel 2 --max_ifuel 2"

friend MiTLS.Parsers.ExtensionType

// Need high Z3 limits for large sum types
#set-options "--z3rlimit 1560"

inline_for_extraction unfold let known_extensionType_as_enum_key
  (x: extensionType { norm [delta; zeta; iota; primops] (LP.list_mem x (LP.list_map fst extensionType_enum)) == true })
  : LP.enum_key extensionType_enum =
  [@inline_let] let _ = norm_spec [delta; zeta; iota; primops] (LP.list_mem x (LP.list_map fst extensionType_enum)) in x

inline_for_extraction let unknown_extensionType_as_enum_key (r:extensionType_repr) : Pure (LP.unknown_enum_repr extensionType_enum)
  (requires known_extensionType_repr r == false) (ensures fun _ -> True) =
  [@inline_let] let _ = assert_norm(LP.list_mem r (LP.list_map snd extensionType_enum) == known_extensionType_repr r) in r

inline_for_extraction let unknown_enum_repr_extensionType_as_repr (r:LP.unknown_enum_repr extensionType_enum) : Pure extensionType_repr
  (requires True) (ensures fun r -> known_extensionType_repr r == false) =
  [@inline_let] let _ = assert_norm(LP.list_mem r (LP.list_map snd extensionType_enum) == known_extensionType_repr r) in r

inline_for_extraction let key_of_certificateExtension (x:certificateExtension) : LP.maybe_enum_key extensionType_enum =
  match x with
  | E_status_request _ -> LP.Known (known_extensionType_as_enum_key Status_request)
  | E_signed_certificate_timestamp _ -> LP.Known (known_extensionType_as_enum_key Signed_certificate_timestamp)
  | E_key_share _ -> LP.Known (known_extensionType_as_enum_key Key_share)
  | E_signature_algorithms_cert _ -> LP.Known (known_extensionType_as_enum_key Signature_algorithms_cert)
  | E_post_handshake_auth _ -> LP.Known (known_extensionType_as_enum_key Post_handshake_auth)
  | E_oid_filters _ -> LP.Known (known_extensionType_as_enum_key Oid_filters)
  | E_certificate_authorities _ -> LP.Known (known_extensionType_as_enum_key Certificate_authorities)
  | E_psk_key_exchange_modes _ -> LP.Known (known_extensionType_as_enum_key Psk_key_exchange_modes)
  | E_cookie _ -> LP.Known (known_extensionType_as_enum_key Cookie)
  | E_supported_versions _ -> LP.Known (known_extensionType_as_enum_key Supported_versions)
  | E_early_data _ -> LP.Known (known_extensionType_as_enum_key Early_data)
  | E_pre_shared_key _ -> LP.Known (known_extensionType_as_enum_key Pre_shared_key)
  | E_session_ticket _ -> LP.Known (known_extensionType_as_enum_key Session_ticket)
  | E_extended_master_secret _ -> LP.Known (known_extensionType_as_enum_key Extended_master_secret)
  | E_encrypt_then_mac _ -> LP.Known (known_extensionType_as_enum_key Encrypt_then_mac)
  | E_padding _ -> LP.Known (known_extensionType_as_enum_key Padding)
  | E_server_certificate_type _ -> LP.Known (known_extensionType_as_enum_key Server_certificate_type)
  | E_client_certificate_type _ -> LP.Known (known_extensionType_as_enum_key Client_certificate_type)
  | E_application_layer_protocol_negotiation _ -> LP.Known (known_extensionType_as_enum_key Application_layer_protocol_negotiation)
  | E_heartbeat _ -> LP.Known (known_extensionType_as_enum_key Heartbeat)
  | E_use_srtp _ -> LP.Known (known_extensionType_as_enum_key Use_srtp)
  | E_signature_algorithms _ -> LP.Known (known_extensionType_as_enum_key Signature_algorithms)
  | E_ec_point_formats _ -> LP.Known (known_extensionType_as_enum_key Ec_point_formats)
  | E_supported_groups _ -> LP.Known (known_extensionType_as_enum_key Supported_groups)
  | E_max_fragment_length _ -> LP.Known (known_extensionType_as_enum_key Max_fragment_length)
  | E_server_name _ -> LP.Known (known_extensionType_as_enum_key Server_name)
  | E_Unknown_extensionType v _ -> LP.Unknown (unknown_extensionType_as_enum_key v)
/
prims.fst.checked MiTLS.Parsers.ExtensionType.fst.checked LowStar.Buffer.fst.checked LowParse.TacLib.fst.checked LowParse.Spec.AllIntegers.fst.checked LowParse.Spec.fst.checked LowParse.SLow.fst.checked LowParse.Low.fst.checked FStar.UInt8.fsti.checked FStar.UInt64.fsti.checked FStar.UInt32.fsti.checked FStar.UInt16.fsti.checked FStar.Tactics.Effect.fsti.checked FStar.Seq.fst.checked FStar.Pervasives.fsti.checked FStar.List.Tot.fst.checked FStar.HyperStack.ST.fsti.checked FStar.HyperStack.fst.checked FStar.Bytes.fsti.checked
MiTLS.Parsers.CertificateExtension.fst
x: MiTLS.Parsers.ExtensionType.extensionType -> Type0
MiTLS.Parsers.ExtensionType.extensionType MiTLS.Parsers.CertificateExtension_e_status_request.certificateExtension_e_status_request MiTLS.Parsers.CertificateExtension_e_signed_certificate_timestamp.certificateExtension_e_signed_certificate_timestamp MiTLS.Parsers.CertificateExtension_e_default.certificateExtension_e_default FStar.UInt16.t Prims.b2t Prims.op_Negation MiTLS.Parsers.ExtensionType.known_extensionType_repr Prims.squash Prims.l_False
let certificateExtension_case_of_extensionType (x: extensionType) : Type0 =
  
match x with
| Status_request -> certificateExtension_e_status_request
| Signed_certificate_timestamp -> certificateExtension_e_signed_certificate_timestamp
| Key_share -> certificateExtension_e_default
| Signature_algorithms_cert -> certificateExtension_e_default
| Post_handshake_auth -> certificateExtension_e_default
| Oid_filters -> certificateExtension_e_default
| Certificate_authorities -> certificateExtension_e_default
| Psk_key_exchange_modes -> certificateExtension_e_default
| Cookie -> certificateExtension_e_default
| Supported_versions -> certificateExtension_e_default
| Early_data -> certificateExtension_e_default
| Pre_shared_key -> certificateExtension_e_default
| Session_ticket -> certificateExtension_e_default
| Extended_master_secret -> certificateExtension_e_default
| Encrypt_then_mac -> certificateExtension_e_default
| Padding -> certificateExtension_e_default
| Server_certificate_type -> certificateExtension_e_default
| Client_certificate_type -> certificateExtension_e_default
| Application_layer_protocol_negotiation -> certificateExtension_e_default
| Heartbeat -> certificateExtension_e_default
| Use_srtp -> certificateExtension_e_default
| Signature_algorithms -> certificateExtension_e_default
| Ec_point_formats -> certificateExtension_e_default
| Supported_groups -> certificateExtension_e_default
| Max_fragment_length -> certificateExtension_e_default
| Server_name -> certificateExtension_e_default
| Unknown_extensionType _ -> squash False