val newSessionTicketExtension_bytesize_eqn_padding  (x: newSessionTicketExtension_e_default) : Lemma (newSessionTicketExtension_bytesize (E_padding  x) == 2 + (newSessionTicketExtension_e_default_bytesize (x))) [SMTPat (newSessionTicketExtension_bytesize (E_padding  x))]
val newSessionTicketExtension_bytesize_eqn_padding  (x: newSessionTicketExtension_e_default) : Lemma (newSessionTicketExtension_bytesize (E_padding  x) == 2 + (newSessionTicketExtension_e_default_bytesize (x))) [SMTPat (newSessionTicketExtension_bytesize (E_padding  x))]
let newSessionTicketExtension_bytesize_eqn_padding  x =
    assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);

  LP.serialize_dsum_eq newSessionTicketExtension_sum extensionType_repr_serializer parse_newSessionTicketExtension_cases serialize_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser newSessionTicketExtension_e_default_serializer (E_padding  x) ;
  let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_padding  x) in
  assert_norm (tg == LP.Known (known_extensionType_as_enum_key Padding));
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _ extensionType_repr_serializer (LP.dsum_enum newSessionTicketExtension_sum)) tg) in assert (2 <= ln /\ ln <= 2));
  (newSessionTicketExtension_e_default_bytesize_eq (x))
module MiTLS.Parsers.NewSessionTicketExtension

(* 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_newSessionTicketExtension (x:newSessionTicketExtension) : LP.maybe_enum_key extensionType_enum =
  match x with
  | 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_signed_certificate_timestamp _ -> LP.Known (known_extensionType_as_enum_key Signed_certificate_timestamp)
  | 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_status_request _ -> LP.Known (known_extensionType_as_enum_key Status_request)
  | 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)

inline_for_extraction let newSessionTicketExtension_case_of_extensionType (x:extensionType) : Type0 =
  match x with
  | Key_share -> newSessionTicketExtension_e_default
  | Signature_algorithms_cert -> newSessionTicketExtension_e_default
  | Post_handshake_auth -> newSessionTicketExtension_e_default
  | Oid_filters -> newSessionTicketExtension_e_default
  | Certificate_authorities -> newSessionTicketExtension_e_default
  | Psk_key_exchange_modes -> newSessionTicketExtension_e_default
  | Cookie -> newSessionTicketExtension_e_default
  | Supported_versions -> newSessionTicketExtension_e_default
  | Early_data -> newSessionTicketExtension_e_default
  | Pre_shared_key -> newSessionTicketExtension_e_default
  | Session_ticket -> newSessionTicketExtension_e_default
  | Extended_master_secret -> newSessionTicketExtension_e_default
  | Encrypt_then_mac -> newSessionTicketExtension_e_default
  | Padding -> newSessionTicketExtension_e_default
  | Server_certificate_type -> newSessionTicketExtension_e_default
  | Client_certificate_type -> newSessionTicketExtension_e_default
  | Signed_certificate_timestamp -> newSessionTicketExtension_e_default
  | Application_layer_protocol_negotiation -> newSessionTicketExtension_e_default
  | Heartbeat -> newSessionTicketExtension_e_default
  | Use_srtp -> newSessionTicketExtension_e_default
  | Signature_algorithms -> newSessionTicketExtension_e_default
  | Ec_point_formats -> newSessionTicketExtension_e_default
  | Supported_groups -> newSessionTicketExtension_e_default
  | Status_request -> newSessionTicketExtension_e_default
  | Max_fragment_length -> newSessionTicketExtension_e_default
  | Server_name -> newSessionTicketExtension_e_default
  | Unknown_extensionType _ -> squash False

unfold inline_for_extraction let newSessionTicketExtension_value_type (x:LP.maybe_enum_key extensionType_enum) =
  LP.dsum_type_of_tag' extensionType_enum newSessionTicketExtension_case_of_extensionType newSessionTicketExtension_e_default x

unfold inline_for_extraction let newSessionTicketExtension_refine (k:LP.maybe_enum_key extensionType_enum) (x:newSessionTicketExtension)
  : Pure (LP.refine_with_tag key_of_newSessionTicketExtension k)
  (requires key_of_newSessionTicketExtension x == k) (ensures fun y -> y == x) =
  [@inline_let] let _ = norm_spec [delta; iota; zeta] (key_of_newSessionTicketExtension x) in x

unfold inline_for_extraction let newSessionTicketExtension_type_of_known_case (k: LP.enum_key extensionType_enum)
  (x:extensionType) (q: squash ((k <: extensionType) == x))
  (#x' : LP.maybe_enum_key extensionType_enum) (y: newSessionTicketExtension_value_type x')
  : Pure (norm [delta_only [(`%newSessionTicketExtension_case_of_extensionType)]; iota] (newSessionTicketExtension_case_of_extensionType x))
  (requires (LP.Known k == x')) (ensures (fun y' -> y' == y)) =
  [@inline_let] let _ = norm_spec [delta_only [(`%newSessionTicketExtension_case_of_extensionType)]; iota] (newSessionTicketExtension_case_of_extensionType k) in y

unfold inline_for_extraction let newSessionTicketExtension_known_case (k: LP.enum_key extensionType_enum)
  (x: extensionType) (y: norm [delta_only [(`%newSessionTicketExtension_case_of_extensionType)]; iota] (newSessionTicketExtension_case_of_extensionType x))
  : Pure (newSessionTicketExtension_case_of_extensionType k) (requires (k == x)) (ensures (fun y' -> y' == y)) =
  [@inline_let] let _ = norm_spec [delta_only [(`%newSessionTicketExtension_case_of_extensionType)] ; iota] (newSessionTicketExtension_case_of_extensionType x) in y

inline_for_extraction let synth_known_newSessionTicketExtension_cases (k:LP.enum_key extensionType_enum)
  (y:newSessionTicketExtension_value_type (LP.Known k)) : LP.refine_with_tag key_of_newSessionTicketExtension (LP.Known k) =
  match k with
  | Key_share ->
    [@inline_let] let x : newSessionTicketExtension = E_key_share (newSessionTicketExtension_type_of_known_case k Key_share () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Key_share) in
    newSessionTicketExtension_refine (LP.Known Key_share) x
  | Signature_algorithms_cert ->
    [@inline_let] let x : newSessionTicketExtension = E_signature_algorithms_cert (newSessionTicketExtension_type_of_known_case k Signature_algorithms_cert () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Signature_algorithms_cert) in
    newSessionTicketExtension_refine (LP.Known Signature_algorithms_cert) x
  | Post_handshake_auth ->
    [@inline_let] let x : newSessionTicketExtension = E_post_handshake_auth (newSessionTicketExtension_type_of_known_case k Post_handshake_auth () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Post_handshake_auth) in
    newSessionTicketExtension_refine (LP.Known Post_handshake_auth) x
  | Oid_filters ->
    [@inline_let] let x : newSessionTicketExtension = E_oid_filters (newSessionTicketExtension_type_of_known_case k Oid_filters () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Oid_filters) in
    newSessionTicketExtension_refine (LP.Known Oid_filters) x
  | Certificate_authorities ->
    [@inline_let] let x : newSessionTicketExtension = E_certificate_authorities (newSessionTicketExtension_type_of_known_case k Certificate_authorities () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Certificate_authorities) in
    newSessionTicketExtension_refine (LP.Known Certificate_authorities) x
  | Psk_key_exchange_modes ->
    [@inline_let] let x : newSessionTicketExtension = E_psk_key_exchange_modes (newSessionTicketExtension_type_of_known_case k Psk_key_exchange_modes () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Psk_key_exchange_modes) in
    newSessionTicketExtension_refine (LP.Known Psk_key_exchange_modes) x
  | Cookie ->
    [@inline_let] let x : newSessionTicketExtension = E_cookie (newSessionTicketExtension_type_of_known_case k Cookie () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Cookie) in
    newSessionTicketExtension_refine (LP.Known Cookie) x
  | Supported_versions ->
    [@inline_let] let x : newSessionTicketExtension = E_supported_versions (newSessionTicketExtension_type_of_known_case k Supported_versions () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Supported_versions) in
    newSessionTicketExtension_refine (LP.Known Supported_versions) x
  | Early_data ->
    [@inline_let] let x : newSessionTicketExtension = E_early_data (newSessionTicketExtension_type_of_known_case k Early_data () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Early_data) in
    newSessionTicketExtension_refine (LP.Known Early_data) x
  | Pre_shared_key ->
    [@inline_let] let x : newSessionTicketExtension = E_pre_shared_key (newSessionTicketExtension_type_of_known_case k Pre_shared_key () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Pre_shared_key) in
    newSessionTicketExtension_refine (LP.Known Pre_shared_key) x
  | Session_ticket ->
    [@inline_let] let x : newSessionTicketExtension = E_session_ticket (newSessionTicketExtension_type_of_known_case k Session_ticket () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Session_ticket) in
    newSessionTicketExtension_refine (LP.Known Session_ticket) x
  | Extended_master_secret ->
    [@inline_let] let x : newSessionTicketExtension = E_extended_master_secret (newSessionTicketExtension_type_of_known_case k Extended_master_secret () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Extended_master_secret) in
    newSessionTicketExtension_refine (LP.Known Extended_master_secret) x
  | Encrypt_then_mac ->
    [@inline_let] let x : newSessionTicketExtension = E_encrypt_then_mac (newSessionTicketExtension_type_of_known_case k Encrypt_then_mac () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Encrypt_then_mac) in
    newSessionTicketExtension_refine (LP.Known Encrypt_then_mac) x
  | Padding ->
    [@inline_let] let x : newSessionTicketExtension = E_padding (newSessionTicketExtension_type_of_known_case k Padding () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Padding) in
    newSessionTicketExtension_refine (LP.Known Padding) x
  | Server_certificate_type ->
    [@inline_let] let x : newSessionTicketExtension = E_server_certificate_type (newSessionTicketExtension_type_of_known_case k Server_certificate_type () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Server_certificate_type) in
    newSessionTicketExtension_refine (LP.Known Server_certificate_type) x
  | Client_certificate_type ->
    [@inline_let] let x : newSessionTicketExtension = E_client_certificate_type (newSessionTicketExtension_type_of_known_case k Client_certificate_type () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Client_certificate_type) in
    newSessionTicketExtension_refine (LP.Known Client_certificate_type) x
  | Signed_certificate_timestamp ->
    [@inline_let] let x : newSessionTicketExtension = E_signed_certificate_timestamp (newSessionTicketExtension_type_of_known_case k Signed_certificate_timestamp () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Signed_certificate_timestamp) in
    newSessionTicketExtension_refine (LP.Known Signed_certificate_timestamp) x
  | Application_layer_protocol_negotiation ->
    [@inline_let] let x : newSessionTicketExtension = E_application_layer_protocol_negotiation (newSessionTicketExtension_type_of_known_case k Application_layer_protocol_negotiation () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Application_layer_protocol_negotiation) in
    newSessionTicketExtension_refine (LP.Known Application_layer_protocol_negotiation) x
  | Heartbeat ->
    [@inline_let] let x : newSessionTicketExtension = E_heartbeat (newSessionTicketExtension_type_of_known_case k Heartbeat () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Heartbeat) in
    newSessionTicketExtension_refine (LP.Known Heartbeat) x
  | Use_srtp ->
    [@inline_let] let x : newSessionTicketExtension = E_use_srtp (newSessionTicketExtension_type_of_known_case k Use_srtp () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Use_srtp) in
    newSessionTicketExtension_refine (LP.Known Use_srtp) x
  | Signature_algorithms ->
    [@inline_let] let x : newSessionTicketExtension = E_signature_algorithms (newSessionTicketExtension_type_of_known_case k Signature_algorithms () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Signature_algorithms) in
    newSessionTicketExtension_refine (LP.Known Signature_algorithms) x
  | Ec_point_formats ->
    [@inline_let] let x : newSessionTicketExtension = E_ec_point_formats (newSessionTicketExtension_type_of_known_case k Ec_point_formats () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Ec_point_formats) in
    newSessionTicketExtension_refine (LP.Known Ec_point_formats) x
  | Supported_groups ->
    [@inline_let] let x : newSessionTicketExtension = E_supported_groups (newSessionTicketExtension_type_of_known_case k Supported_groups () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Supported_groups) in
    newSessionTicketExtension_refine (LP.Known Supported_groups) x
  | Status_request ->
    [@inline_let] let x : newSessionTicketExtension = E_status_request (newSessionTicketExtension_type_of_known_case k Status_request () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Status_request) in
    newSessionTicketExtension_refine (LP.Known Status_request) x
  | Max_fragment_length ->
    [@inline_let] let x : newSessionTicketExtension = E_max_fragment_length (newSessionTicketExtension_type_of_known_case k Max_fragment_length () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Max_fragment_length) in
    newSessionTicketExtension_refine (LP.Known Max_fragment_length) x
  | Server_name ->
    [@inline_let] let x : newSessionTicketExtension = E_server_name (newSessionTicketExtension_type_of_known_case k Server_name () y) in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Known Server_name) in
    newSessionTicketExtension_refine (LP.Known Server_name) x

inline_for_extraction let synth_newSessionTicketExtension_cases (x:LP.maybe_enum_key extensionType_enum)
  (y:newSessionTicketExtension_value_type x) : LP.refine_with_tag key_of_newSessionTicketExtension x =
  match x with
  | LP.Unknown v ->
    [@inline_let] let x : newSessionTicketExtension = E_Unknown_extensionType (unknown_enum_repr_extensionType_as_repr v) y in
    [@inline_let] let _ = assert_norm (key_of_newSessionTicketExtension x == LP.Unknown v) in
    newSessionTicketExtension_refine (LP.Unknown v) x
  | LP.Known k -> synth_known_newSessionTicketExtension_cases k y

unfold inline_for_extraction let from_newSessionTicketExtension_case_of_extensionType (#x':extensionType) (x:extensionType)
  (y: norm [delta_only [(`%newSessionTicketExtension_case_of_extensionType)]; iota] (newSessionTicketExtension_case_of_extensionType x))
  : Pure (newSessionTicketExtension_case_of_extensionType x') (requires (x == x')) (ensures (fun y' -> y' == y)) =
  [@inline_let] let _ = norm_spec [delta_only [(`%newSessionTicketExtension_case_of_extensionType)] ; iota] (newSessionTicketExtension_case_of_extensionType x) in y

let synth_newSessionTicketExtension_cases_recip_pre (k:LP.maybe_enum_key extensionType_enum)
  (x:LP.refine_with_tag key_of_newSessionTicketExtension k) : GTot bool =
  match k with
  | LP.Known Key_share -> E_key_share? x
  | LP.Known Signature_algorithms_cert -> E_signature_algorithms_cert? x
  | LP.Known Post_handshake_auth -> E_post_handshake_auth? x
  | LP.Known Oid_filters -> E_oid_filters? x
  | LP.Known Certificate_authorities -> E_certificate_authorities? x
  | LP.Known Psk_key_exchange_modes -> E_psk_key_exchange_modes? x
  | LP.Known Cookie -> E_cookie? x
  | LP.Known Supported_versions -> E_supported_versions? x
  | LP.Known Early_data -> E_early_data? x
  | LP.Known Pre_shared_key -> E_pre_shared_key? x
  | LP.Known Session_ticket -> E_session_ticket? x
  | LP.Known Extended_master_secret -> E_extended_master_secret? x
  | LP.Known Encrypt_then_mac -> E_encrypt_then_mac? x
  | LP.Known Padding -> E_padding? x
  | LP.Known Server_certificate_type -> E_server_certificate_type? x
  | LP.Known Client_certificate_type -> E_client_certificate_type? x
  | LP.Known Signed_certificate_timestamp -> E_signed_certificate_timestamp? x
  | LP.Known Application_layer_protocol_negotiation -> E_application_layer_protocol_negotiation? x
  | LP.Known Heartbeat -> E_heartbeat? x
  | LP.Known Use_srtp -> E_use_srtp? x
  | LP.Known Signature_algorithms -> E_signature_algorithms? x
  | LP.Known Ec_point_formats -> E_ec_point_formats? x
  | LP.Known Supported_groups -> E_supported_groups? x
  | LP.Known Status_request -> E_status_request? x
  | LP.Known Max_fragment_length -> E_max_fragment_length? x
  | LP.Known Server_name -> E_server_name? x
  | LP.Known _ -> false
  | LP.Unknown _ -> E_Unknown_extensionType? x

let synth_newSessionTicketExtension_cases_recip_pre_intro' (x: newSessionTicketExtension)
  : Lemma (synth_newSessionTicketExtension_cases_recip_pre (key_of_newSessionTicketExtension x) x) = ()

let synth_newSessionTicketExtension_cases_recip_pre_intro (k:LP.maybe_enum_key extensionType_enum)
  (x:LP.refine_with_tag key_of_newSessionTicketExtension k)
  : Lemma (synth_newSessionTicketExtension_cases_recip_pre k x == true) =
  synth_newSessionTicketExtension_cases_recip_pre_intro' x

inline_for_extraction let synth_newSessionTicketExtension_cases_recip (k:LP.maybe_enum_key extensionType_enum)
  (x:LP.refine_with_tag key_of_newSessionTicketExtension k) : (newSessionTicketExtension_value_type k) =
  match k with
  | LP.Unknown z ->
    [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Unknown z) x in
    (match x with E_Unknown_extensionType _ y ->  (y <: newSessionTicketExtension_value_type k))
  | LP.Known k' ->
    match k' with
    | Key_share -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Key_share) x in
      (match x with E_key_share y -> newSessionTicketExtension_known_case k' Key_share y)
    | Signature_algorithms_cert -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Signature_algorithms_cert) x in
      (match x with E_signature_algorithms_cert y -> newSessionTicketExtension_known_case k' Signature_algorithms_cert y)
    | Post_handshake_auth -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Post_handshake_auth) x in
      (match x with E_post_handshake_auth y -> newSessionTicketExtension_known_case k' Post_handshake_auth y)
    | Oid_filters -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Oid_filters) x in
      (match x with E_oid_filters y -> newSessionTicketExtension_known_case k' Oid_filters y)
    | Certificate_authorities -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Certificate_authorities) x in
      (match x with E_certificate_authorities y -> newSessionTicketExtension_known_case k' Certificate_authorities y)
    | Psk_key_exchange_modes -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Psk_key_exchange_modes) x in
      (match x with E_psk_key_exchange_modes y -> newSessionTicketExtension_known_case k' Psk_key_exchange_modes y)
    | Cookie -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Cookie) x in
      (match x with E_cookie y -> newSessionTicketExtension_known_case k' Cookie y)
    | Supported_versions -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Supported_versions) x in
      (match x with E_supported_versions y -> newSessionTicketExtension_known_case k' Supported_versions y)
    | Early_data -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Early_data) x in
      (match x with E_early_data y -> newSessionTicketExtension_known_case k' Early_data y)
    | Pre_shared_key -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Pre_shared_key) x in
      (match x with E_pre_shared_key y -> newSessionTicketExtension_known_case k' Pre_shared_key y)
    | Session_ticket -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Session_ticket) x in
      (match x with E_session_ticket y -> newSessionTicketExtension_known_case k' Session_ticket y)
    | Extended_master_secret -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Extended_master_secret) x in
      (match x with E_extended_master_secret y -> newSessionTicketExtension_known_case k' Extended_master_secret y)
    | Encrypt_then_mac -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Encrypt_then_mac) x in
      (match x with E_encrypt_then_mac y -> newSessionTicketExtension_known_case k' Encrypt_then_mac y)
    | Padding -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Padding) x in
      (match x with E_padding y -> newSessionTicketExtension_known_case k' Padding y)
    | Server_certificate_type -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Server_certificate_type) x in
      (match x with E_server_certificate_type y -> newSessionTicketExtension_known_case k' Server_certificate_type y)
    | Client_certificate_type -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Client_certificate_type) x in
      (match x with E_client_certificate_type y -> newSessionTicketExtension_known_case k' Client_certificate_type y)
    | Signed_certificate_timestamp -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Signed_certificate_timestamp) x in
      (match x with E_signed_certificate_timestamp y -> newSessionTicketExtension_known_case k' Signed_certificate_timestamp y)
    | Application_layer_protocol_negotiation -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Application_layer_protocol_negotiation) x in
      (match x with E_application_layer_protocol_negotiation y -> newSessionTicketExtension_known_case k' Application_layer_protocol_negotiation y)
    | Heartbeat -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Heartbeat) x in
      (match x with E_heartbeat y -> newSessionTicketExtension_known_case k' Heartbeat y)
    | Use_srtp -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Use_srtp) x in
      (match x with E_use_srtp y -> newSessionTicketExtension_known_case k' Use_srtp y)
    | Signature_algorithms -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Signature_algorithms) x in
      (match x with E_signature_algorithms y -> newSessionTicketExtension_known_case k' Signature_algorithms y)
    | Ec_point_formats -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Ec_point_formats) x in
      (match x with E_ec_point_formats y -> newSessionTicketExtension_known_case k' Ec_point_formats y)
    | Supported_groups -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Supported_groups) x in
      (match x with E_supported_groups y -> newSessionTicketExtension_known_case k' Supported_groups y)
    | Status_request -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Status_request) x in
      (match x with E_status_request y -> newSessionTicketExtension_known_case k' Status_request y)
    | Max_fragment_length -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Max_fragment_length) x in
      (match x with E_max_fragment_length y -> newSessionTicketExtension_known_case k' Max_fragment_length y)
    | Server_name -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known Server_name) x in
      (match x with E_server_name y -> newSessionTicketExtension_known_case k' Server_name y)
   | _ -> [@inline_let] let _ = synth_newSessionTicketExtension_cases_recip_pre_intro (LP.Known k') in false_elim ()

inline_for_extraction let newSessionTicketExtension_sum : LP.dsum = LP.make_dsum' extensionType_enum key_of_newSessionTicketExtension
  newSessionTicketExtension_case_of_extensionType newSessionTicketExtension_e_default synth_newSessionTicketExtension_cases synth_newSessionTicketExtension_cases_recip
  (_ by (LP.make_dsum_synth_case_recip_synth_case_known_tac ()))
  (_ by (LP.make_dsum_synth_case_recip_synth_case_unknown_tac ()))
  (_ by (LP.synth_case_synth_case_recip_tac ()))

noextract let parse_newSessionTicketExtension_cases (x:LP.dsum_known_key newSessionTicketExtension_sum)
  : k:LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType x) =
  match x with
  | Key_share -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Key_share)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Signature_algorithms_cert -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Signature_algorithms_cert)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Post_handshake_auth -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Post_handshake_auth)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Oid_filters -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Oid_filters)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Certificate_authorities -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Certificate_authorities)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Psk_key_exchange_modes -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Psk_key_exchange_modes)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Cookie -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Cookie)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Supported_versions -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Supported_versions)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Early_data -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Early_data)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Pre_shared_key -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Pre_shared_key)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Session_ticket -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Session_ticket)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Extended_master_secret -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Extended_master_secret)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Encrypt_then_mac -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Encrypt_then_mac)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Padding -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Padding)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Server_certificate_type -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Server_certificate_type)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Client_certificate_type -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Client_certificate_type)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Signed_certificate_timestamp -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Signed_certificate_timestamp)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Application_layer_protocol_negotiation -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Application_layer_protocol_negotiation)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Heartbeat -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Heartbeat)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Use_srtp -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Use_srtp)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Signature_algorithms -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Signature_algorithms)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Ec_point_formats -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Ec_point_formats)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Supported_groups -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Supported_groups)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Status_request -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Status_request)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Max_fragment_length -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Max_fragment_length)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | Server_name -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (newSessionTicketExtension_case_of_extensionType Server_name)) = (| _, newSessionTicketExtension_e_default_parser |) in u
  | _ -> (| _, LP.parse_false |)

noextract let serialize_newSessionTicketExtension_cases (x:LP.dsum_known_key newSessionTicketExtension_sum)
  : LP.serializer (dsnd (parse_newSessionTicketExtension_cases x)) =
  match x with
  | Key_share -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Key_share)) = newSessionTicketExtension_e_default_serializer in u
  | Signature_algorithms_cert -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Signature_algorithms_cert)) = newSessionTicketExtension_e_default_serializer in u
  | Post_handshake_auth -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Post_handshake_auth)) = newSessionTicketExtension_e_default_serializer in u
  | Oid_filters -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Oid_filters)) = newSessionTicketExtension_e_default_serializer in u
  | Certificate_authorities -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Certificate_authorities)) = newSessionTicketExtension_e_default_serializer in u
  | Psk_key_exchange_modes -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Psk_key_exchange_modes)) = newSessionTicketExtension_e_default_serializer in u
  | Cookie -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Cookie)) = newSessionTicketExtension_e_default_serializer in u
  | Supported_versions -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Supported_versions)) = newSessionTicketExtension_e_default_serializer in u
  | Early_data -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Early_data)) = newSessionTicketExtension_e_default_serializer in u
  | Pre_shared_key -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Pre_shared_key)) = newSessionTicketExtension_e_default_serializer in u
  | Session_ticket -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Session_ticket)) = newSessionTicketExtension_e_default_serializer in u
  | Extended_master_secret -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Extended_master_secret)) = newSessionTicketExtension_e_default_serializer in u
  | Encrypt_then_mac -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Encrypt_then_mac)) = newSessionTicketExtension_e_default_serializer in u
  | Padding -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Padding)) = newSessionTicketExtension_e_default_serializer in u
  | Server_certificate_type -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Server_certificate_type)) = newSessionTicketExtension_e_default_serializer in u
  | Client_certificate_type -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Client_certificate_type)) = newSessionTicketExtension_e_default_serializer in u
  | Signed_certificate_timestamp -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Signed_certificate_timestamp)) = newSessionTicketExtension_e_default_serializer in u
  | Application_layer_protocol_negotiation -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Application_layer_protocol_negotiation)) = newSessionTicketExtension_e_default_serializer in u
  | Heartbeat -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Heartbeat)) = newSessionTicketExtension_e_default_serializer in u
  | Use_srtp -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Use_srtp)) = newSessionTicketExtension_e_default_serializer in u
  | Signature_algorithms -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Signature_algorithms)) = newSessionTicketExtension_e_default_serializer in u
  | Ec_point_formats -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Ec_point_formats)) = newSessionTicketExtension_e_default_serializer in u
  | Supported_groups -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Supported_groups)) = newSessionTicketExtension_e_default_serializer in u
  | Status_request -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Status_request)) = newSessionTicketExtension_e_default_serializer in u
  | Max_fragment_length -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Max_fragment_length)) = newSessionTicketExtension_e_default_serializer in u
  | Server_name -> [@inline_let] let u : LP.serializer (dsnd (parse_newSessionTicketExtension_cases Server_name)) = newSessionTicketExtension_e_default_serializer in u
  | _ -> LP.serialize_false

inline_for_extraction noextract let parse32_newSessionTicketExtension_cases (x:LP.dsum_known_key newSessionTicketExtension_sum)
  : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases x)) =
  match x with
  | Key_share -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Key_share)) = newSessionTicketExtension_e_default_parser32 in u
  | Signature_algorithms_cert -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Signature_algorithms_cert)) = newSessionTicketExtension_e_default_parser32 in u
  | Post_handshake_auth -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Post_handshake_auth)) = newSessionTicketExtension_e_default_parser32 in u
  | Oid_filters -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Oid_filters)) = newSessionTicketExtension_e_default_parser32 in u
  | Certificate_authorities -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Certificate_authorities)) = newSessionTicketExtension_e_default_parser32 in u
  | Psk_key_exchange_modes -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Psk_key_exchange_modes)) = newSessionTicketExtension_e_default_parser32 in u
  | Cookie -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Cookie)) = newSessionTicketExtension_e_default_parser32 in u
  | Supported_versions -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Supported_versions)) = newSessionTicketExtension_e_default_parser32 in u
  | Early_data -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Early_data)) = newSessionTicketExtension_e_default_parser32 in u
  | Pre_shared_key -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Pre_shared_key)) = newSessionTicketExtension_e_default_parser32 in u
  | Session_ticket -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Session_ticket)) = newSessionTicketExtension_e_default_parser32 in u
  | Extended_master_secret -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Extended_master_secret)) = newSessionTicketExtension_e_default_parser32 in u
  | Encrypt_then_mac -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Encrypt_then_mac)) = newSessionTicketExtension_e_default_parser32 in u
  | Padding -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Padding)) = newSessionTicketExtension_e_default_parser32 in u
  | Server_certificate_type -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Server_certificate_type)) = newSessionTicketExtension_e_default_parser32 in u
  | Client_certificate_type -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Client_certificate_type)) = newSessionTicketExtension_e_default_parser32 in u
  | Signed_certificate_timestamp -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Signed_certificate_timestamp)) = newSessionTicketExtension_e_default_parser32 in u
  | Application_layer_protocol_negotiation -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Application_layer_protocol_negotiation)) = newSessionTicketExtension_e_default_parser32 in u
  | Heartbeat -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Heartbeat)) = newSessionTicketExtension_e_default_parser32 in u
  | Use_srtp -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Use_srtp)) = newSessionTicketExtension_e_default_parser32 in u
  | Signature_algorithms -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Signature_algorithms)) = newSessionTicketExtension_e_default_parser32 in u
  | Ec_point_formats -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Ec_point_formats)) = newSessionTicketExtension_e_default_parser32 in u
  | Supported_groups -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Supported_groups)) = newSessionTicketExtension_e_default_parser32 in u
  | Status_request -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Status_request)) = newSessionTicketExtension_e_default_parser32 in u
  | Max_fragment_length -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Max_fragment_length)) = newSessionTicketExtension_e_default_parser32 in u
  | Server_name -> [@inline_let] let u : LS.parser32 (dsnd (parse_newSessionTicketExtension_cases Server_name)) = newSessionTicketExtension_e_default_parser32 in u
  | _ -> LS.parse32_false

inline_for_extraction noextract let serialize32_newSessionTicketExtension_cases (x:LP.dsum_known_key newSessionTicketExtension_sum)
  : LS.serializer32 (serialize_newSessionTicketExtension_cases x) =
  match x with
  | Key_share -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Key_share) = newSessionTicketExtension_e_default_serializer32 in u
  | Signature_algorithms_cert -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Signature_algorithms_cert) = newSessionTicketExtension_e_default_serializer32 in u
  | Post_handshake_auth -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Post_handshake_auth) = newSessionTicketExtension_e_default_serializer32 in u
  | Oid_filters -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Oid_filters) = newSessionTicketExtension_e_default_serializer32 in u
  | Certificate_authorities -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Certificate_authorities) = newSessionTicketExtension_e_default_serializer32 in u
  | Psk_key_exchange_modes -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Psk_key_exchange_modes) = newSessionTicketExtension_e_default_serializer32 in u
  | Cookie -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Cookie) = newSessionTicketExtension_e_default_serializer32 in u
  | Supported_versions -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Supported_versions) = newSessionTicketExtension_e_default_serializer32 in u
  | Early_data -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Early_data) = newSessionTicketExtension_e_default_serializer32 in u
  | Pre_shared_key -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Pre_shared_key) = newSessionTicketExtension_e_default_serializer32 in u
  | Session_ticket -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Session_ticket) = newSessionTicketExtension_e_default_serializer32 in u
  | Extended_master_secret -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Extended_master_secret) = newSessionTicketExtension_e_default_serializer32 in u
  | Encrypt_then_mac -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Encrypt_then_mac) = newSessionTicketExtension_e_default_serializer32 in u
  | Padding -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Padding) = newSessionTicketExtension_e_default_serializer32 in u
  | Server_certificate_type -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Server_certificate_type) = newSessionTicketExtension_e_default_serializer32 in u
  | Client_certificate_type -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Client_certificate_type) = newSessionTicketExtension_e_default_serializer32 in u
  | Signed_certificate_timestamp -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Signed_certificate_timestamp) = newSessionTicketExtension_e_default_serializer32 in u
  | Application_layer_protocol_negotiation -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Application_layer_protocol_negotiation) = newSessionTicketExtension_e_default_serializer32 in u
  | Heartbeat -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Heartbeat) = newSessionTicketExtension_e_default_serializer32 in u
  | Use_srtp -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Use_srtp) = newSessionTicketExtension_e_default_serializer32 in u
  | Signature_algorithms -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Signature_algorithms) = newSessionTicketExtension_e_default_serializer32 in u
  | Ec_point_formats -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Ec_point_formats) = newSessionTicketExtension_e_default_serializer32 in u
  | Supported_groups -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Supported_groups) = newSessionTicketExtension_e_default_serializer32 in u
  | Status_request -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Status_request) = newSessionTicketExtension_e_default_serializer32 in u
  | Max_fragment_length -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Max_fragment_length) = newSessionTicketExtension_e_default_serializer32 in u
  | Server_name -> [@inline_let] let u : LS.serializer32 (serialize_newSessionTicketExtension_cases Server_name) = newSessionTicketExtension_e_default_serializer32 in u
  | _ -> LS.serialize32_false

inline_for_extraction noextract let size32_newSessionTicketExtension_cases (x:LP.dsum_known_key newSessionTicketExtension_sum)
  : LSZ.size32 (serialize_newSessionTicketExtension_cases x) =
  match x with
  | Key_share -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Key_share) = newSessionTicketExtension_e_default_size32 in u
  | Signature_algorithms_cert -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Signature_algorithms_cert) = newSessionTicketExtension_e_default_size32 in u
  | Post_handshake_auth -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Post_handshake_auth) = newSessionTicketExtension_e_default_size32 in u
  | Oid_filters -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Oid_filters) = newSessionTicketExtension_e_default_size32 in u
  | Certificate_authorities -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Certificate_authorities) = newSessionTicketExtension_e_default_size32 in u
  | Psk_key_exchange_modes -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Psk_key_exchange_modes) = newSessionTicketExtension_e_default_size32 in u
  | Cookie -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Cookie) = newSessionTicketExtension_e_default_size32 in u
  | Supported_versions -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Supported_versions) = newSessionTicketExtension_e_default_size32 in u
  | Early_data -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Early_data) = newSessionTicketExtension_e_default_size32 in u
  | Pre_shared_key -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Pre_shared_key) = newSessionTicketExtension_e_default_size32 in u
  | Session_ticket -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Session_ticket) = newSessionTicketExtension_e_default_size32 in u
  | Extended_master_secret -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Extended_master_secret) = newSessionTicketExtension_e_default_size32 in u
  | Encrypt_then_mac -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Encrypt_then_mac) = newSessionTicketExtension_e_default_size32 in u
  | Padding -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Padding) = newSessionTicketExtension_e_default_size32 in u
  | Server_certificate_type -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Server_certificate_type) = newSessionTicketExtension_e_default_size32 in u
  | Client_certificate_type -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Client_certificate_type) = newSessionTicketExtension_e_default_size32 in u
  | Signed_certificate_timestamp -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Signed_certificate_timestamp) = newSessionTicketExtension_e_default_size32 in u
  | Application_layer_protocol_negotiation -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Application_layer_protocol_negotiation) = newSessionTicketExtension_e_default_size32 in u
  | Heartbeat -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Heartbeat) = newSessionTicketExtension_e_default_size32 in u
  | Use_srtp -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Use_srtp) = newSessionTicketExtension_e_default_size32 in u
  | Signature_algorithms -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Signature_algorithms) = newSessionTicketExtension_e_default_size32 in u
  | Ec_point_formats -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Ec_point_formats) = newSessionTicketExtension_e_default_size32 in u
  | Supported_groups -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Supported_groups) = newSessionTicketExtension_e_default_size32 in u
  | Status_request -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Status_request) = newSessionTicketExtension_e_default_size32 in u
  | Max_fragment_length -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Max_fragment_length) = newSessionTicketExtension_e_default_size32 in u
  | Server_name -> [@inline_let] let u : LSZ.size32 (serialize_newSessionTicketExtension_cases Server_name) = newSessionTicketExtension_e_default_size32 in u
  | _ -> LSZ.size32_false

inline_for_extraction noextract let validate_newSessionTicketExtension_cases (x:LP.dsum_known_key newSessionTicketExtension_sum)
  : LL.validator (dsnd (parse_newSessionTicketExtension_cases x)) =
  match x with
  | Key_share -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Key_share)) = newSessionTicketExtension_e_default_validator in u
  | Signature_algorithms_cert -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Signature_algorithms_cert)) = newSessionTicketExtension_e_default_validator in u
  | Post_handshake_auth -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Post_handshake_auth)) = newSessionTicketExtension_e_default_validator in u
  | Oid_filters -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Oid_filters)) = newSessionTicketExtension_e_default_validator in u
  | Certificate_authorities -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Certificate_authorities)) = newSessionTicketExtension_e_default_validator in u
  | Psk_key_exchange_modes -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Psk_key_exchange_modes)) = newSessionTicketExtension_e_default_validator in u
  | Cookie -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Cookie)) = newSessionTicketExtension_e_default_validator in u
  | Supported_versions -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Supported_versions)) = newSessionTicketExtension_e_default_validator in u
  | Early_data -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Early_data)) = newSessionTicketExtension_e_default_validator in u
  | Pre_shared_key -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Pre_shared_key)) = newSessionTicketExtension_e_default_validator in u
  | Session_ticket -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Session_ticket)) = newSessionTicketExtension_e_default_validator in u
  | Extended_master_secret -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Extended_master_secret)) = newSessionTicketExtension_e_default_validator in u
  | Encrypt_then_mac -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Encrypt_then_mac)) = newSessionTicketExtension_e_default_validator in u
  | Padding -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Padding)) = newSessionTicketExtension_e_default_validator in u
  | Server_certificate_type -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Server_certificate_type)) = newSessionTicketExtension_e_default_validator in u
  | Client_certificate_type -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Client_certificate_type)) = newSessionTicketExtension_e_default_validator in u
  | Signed_certificate_timestamp -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Signed_certificate_timestamp)) = newSessionTicketExtension_e_default_validator in u
  | Application_layer_protocol_negotiation -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Application_layer_protocol_negotiation)) = newSessionTicketExtension_e_default_validator in u
  | Heartbeat -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Heartbeat)) = newSessionTicketExtension_e_default_validator in u
  | Use_srtp -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Use_srtp)) = newSessionTicketExtension_e_default_validator in u
  | Signature_algorithms -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Signature_algorithms)) = newSessionTicketExtension_e_default_validator in u
  | Ec_point_formats -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Ec_point_formats)) = newSessionTicketExtension_e_default_validator in u
  | Supported_groups -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Supported_groups)) = newSessionTicketExtension_e_default_validator in u
  | Status_request -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Status_request)) = newSessionTicketExtension_e_default_validator in u
  | Max_fragment_length -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Max_fragment_length)) = newSessionTicketExtension_e_default_validator in u
  | Server_name -> [@inline_let] let u : LL.validator (dsnd (parse_newSessionTicketExtension_cases Server_name)) = newSessionTicketExtension_e_default_validator in u
  | _ -> LL.validate_false ()

inline_for_extraction noextract let jump_newSessionTicketExtension_cases (x:LP.dsum_known_key newSessionTicketExtension_sum)
  : LL.jumper (dsnd (parse_newSessionTicketExtension_cases x)) =
  match x with
  | Key_share -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Key_share)) = newSessionTicketExtension_e_default_jumper in u
  | Signature_algorithms_cert -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Signature_algorithms_cert)) = newSessionTicketExtension_e_default_jumper in u
  | Post_handshake_auth -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Post_handshake_auth)) = newSessionTicketExtension_e_default_jumper in u
  | Oid_filters -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Oid_filters)) = newSessionTicketExtension_e_default_jumper in u
  | Certificate_authorities -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Certificate_authorities)) = newSessionTicketExtension_e_default_jumper in u
  | Psk_key_exchange_modes -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Psk_key_exchange_modes)) = newSessionTicketExtension_e_default_jumper in u
  | Cookie -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Cookie)) = newSessionTicketExtension_e_default_jumper in u
  | Supported_versions -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Supported_versions)) = newSessionTicketExtension_e_default_jumper in u
  | Early_data -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Early_data)) = newSessionTicketExtension_e_default_jumper in u
  | Pre_shared_key -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Pre_shared_key)) = newSessionTicketExtension_e_default_jumper in u
  | Session_ticket -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Session_ticket)) = newSessionTicketExtension_e_default_jumper in u
  | Extended_master_secret -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Extended_master_secret)) = newSessionTicketExtension_e_default_jumper in u
  | Encrypt_then_mac -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Encrypt_then_mac)) = newSessionTicketExtension_e_default_jumper in u
  | Padding -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Padding)) = newSessionTicketExtension_e_default_jumper in u
  | Server_certificate_type -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Server_certificate_type)) = newSessionTicketExtension_e_default_jumper in u
  | Client_certificate_type -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Client_certificate_type)) = newSessionTicketExtension_e_default_jumper in u
  | Signed_certificate_timestamp -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Signed_certificate_timestamp)) = newSessionTicketExtension_e_default_jumper in u
  | Application_layer_protocol_negotiation -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Application_layer_protocol_negotiation)) = newSessionTicketExtension_e_default_jumper in u
  | Heartbeat -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Heartbeat)) = newSessionTicketExtension_e_default_jumper in u
  | Use_srtp -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Use_srtp)) = newSessionTicketExtension_e_default_jumper in u
  | Signature_algorithms -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Signature_algorithms)) = newSessionTicketExtension_e_default_jumper in u
  | Ec_point_formats -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Ec_point_formats)) = newSessionTicketExtension_e_default_jumper in u
  | Supported_groups -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Supported_groups)) = newSessionTicketExtension_e_default_jumper in u
  | Status_request -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Status_request)) = newSessionTicketExtension_e_default_jumper in u
  | Max_fragment_length -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Max_fragment_length)) = newSessionTicketExtension_e_default_jumper in u
  | Server_name -> [@inline_let] let u : LL.jumper (dsnd (parse_newSessionTicketExtension_cases Server_name)) = newSessionTicketExtension_e_default_jumper in u
  | _ -> LL.jump_false

let newSessionTicketExtension_parser =
  assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);
  LP.parse_dsum newSessionTicketExtension_sum extensionType_repr_parser parse_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser

let newSessionTicketExtension_serializer =
  assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);
  LP.serialize_dsum newSessionTicketExtension_sum extensionType_repr_serializer _ serialize_newSessionTicketExtension_cases _ newSessionTicketExtension_e_default_serializer

let newSessionTicketExtension_bytesize (x:newSessionTicketExtension) : GTot nat = Seq.length (newSessionTicketExtension_serializer x)

let newSessionTicketExtension_bytesize_eq x = ()

let newSessionTicketExtension_parser32 =
  assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);
  LS.parse32_dsum newSessionTicketExtension_sum extensionType_repr_parser32
    _ parse32_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser32 (_ by (LP.maybe_enum_destr_t_tac ()))

let newSessionTicketExtension_serializer32 =
  assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);
  assert_norm (LS.serializer32_sum_gen_precond (LP.get_parser_kind extensionType_repr_parser) (LP.weaken_parse_dsum_cases_kind newSessionTicketExtension_sum parse_newSessionTicketExtension_cases newSessionTicketExtension_parser_kind));
  LS.serialize32_dsum newSessionTicketExtension_sum extensionType_repr_serializer (_ by (LS.serialize32_maybe_enum_key_tac extensionType_repr_serializer32 extensionType_enum ()))    _ _ serialize32_newSessionTicketExtension_cases newSessionTicketExtension_e_default_serializer32 (_ by (LP.dep_enum_destr_tac ())) ()

let newSessionTicketExtension_size32 =
  assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);
  assert_norm (LSZ.size32_sum_gen_precond (LP.get_parser_kind extensionType_repr_parser) (LP.weaken_parse_dsum_cases_kind newSessionTicketExtension_sum parse_newSessionTicketExtension_cases newSessionTicketExtension_parser_kind));
  LSZ.size32_dsum newSessionTicketExtension_sum _ (_ by (LSZ.size32_maybe_enum_key_tac extensionType_repr_size32 extensionType_enum ()))
    _ _ size32_newSessionTicketExtension_cases newSessionTicketExtension_e_default_size32 (_ by (LP.dep_enum_destr_tac ())) ()

let newSessionTicketExtension_validator =
  assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);
  LL.validate_dsum newSessionTicketExtension_sum extensionType_repr_validator extensionType_repr_reader parse_newSessionTicketExtension_cases validate_newSessionTicketExtension_cases newSessionTicketExtension_e_default_validator (_ by (LP.dep_maybe_enum_destr_t_tac ()))

let newSessionTicketExtension_jumper =
  assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);
  LL.jump_dsum newSessionTicketExtension_sum extensionType_repr_jumper extensionType_repr_reader parse_newSessionTicketExtension_cases jump_newSessionTicketExtension_cases newSessionTicketExtension_e_default_jumper (_ by (LP.dep_maybe_enum_destr_t_tac ()))

let lemma_valid_newSessionTicketExtension_valid_extensionType #_ #_ s pos h =
  assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);
  LL.valid_dsum_elim_tag h newSessionTicketExtension_sum extensionType_repr_parser parse_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser s pos;
  lemma_synth_extensionType_inj ();
  LL.valid_synth h parse_maybe_extensionType_key synth_extensionType s pos

let newSessionTicketExtension_gaccessor_tag =
  assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);
  lemma_synth_extensionType_inj ();
  lemma_synth_extensionType_inv ();
  LL.gaccessor_ext
    (LL.gaccessor_compose
      (LL.gaccessor_dsum_tag newSessionTicketExtension_sum extensionType_repr_parser parse_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser)
      (LL.gaccessor_synth_inv parse_maybe_extensionType_key synth_extensionType synth_extensionType_inv ())
    )
    newSessionTicketExtension_clens_tag
    ()

let newSessionTicketExtension_accessor_tag =
  assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);
  lemma_synth_extensionType_inj ();
  lemma_synth_extensionType_inv ();
  LL.accessor_ext
    (LL.accessor_compose
      (LL.accessor_dsum_tag newSessionTicketExtension_sum extensionType_repr_parser parse_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser)
      (LL.accessor_synth_inv parse_maybe_extensionType_key synth_extensionType synth_extensionType_inv ())
      ()
    )
    newSessionTicketExtension_clens_tag
    ()

let newSessionTicketExtension_bytesize_eqn_key_share  x =
    assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);

  LP.serialize_dsum_eq newSessionTicketExtension_sum extensionType_repr_serializer parse_newSessionTicketExtension_cases serialize_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser newSessionTicketExtension_e_default_serializer (E_key_share  x) ;
  let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_key_share  x) in
  assert_norm (tg == LP.Known (known_extensionType_as_enum_key Key_share));
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _ extensionType_repr_serializer (LP.dsum_enum newSessionTicketExtension_sum)) tg) in assert (2 <= ln /\ ln <= 2));
  (newSessionTicketExtension_e_default_bytesize_eq (x))

let newSessionTicketExtension_bytesize_eqn_signature_algorithms_cert  x =
    assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);

  LP.serialize_dsum_eq newSessionTicketExtension_sum extensionType_repr_serializer parse_newSessionTicketExtension_cases serialize_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser newSessionTicketExtension_e_default_serializer (E_signature_algorithms_cert  x) ;
  let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_signature_algorithms_cert  x) in
  assert_norm (tg == LP.Known (known_extensionType_as_enum_key Signature_algorithms_cert));
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _ extensionType_repr_serializer (LP.dsum_enum newSessionTicketExtension_sum)) tg) in assert (2 <= ln /\ ln <= 2));
  (newSessionTicketExtension_e_default_bytesize_eq (x))

let newSessionTicketExtension_bytesize_eqn_post_handshake_auth  x =
    assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);

  LP.serialize_dsum_eq newSessionTicketExtension_sum extensionType_repr_serializer parse_newSessionTicketExtension_cases serialize_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser newSessionTicketExtension_e_default_serializer (E_post_handshake_auth  x) ;
  let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_post_handshake_auth  x) in
  assert_norm (tg == LP.Known (known_extensionType_as_enum_key Post_handshake_auth));
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _ extensionType_repr_serializer (LP.dsum_enum newSessionTicketExtension_sum)) tg) in assert (2 <= ln /\ ln <= 2));
  (newSessionTicketExtension_e_default_bytesize_eq (x))

let newSessionTicketExtension_bytesize_eqn_oid_filters  x =
    assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);

  LP.serialize_dsum_eq newSessionTicketExtension_sum extensionType_repr_serializer parse_newSessionTicketExtension_cases serialize_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser newSessionTicketExtension_e_default_serializer (E_oid_filters  x) ;
  let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_oid_filters  x) in
  assert_norm (tg == LP.Known (known_extensionType_as_enum_key Oid_filters));
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _ extensionType_repr_serializer (LP.dsum_enum newSessionTicketExtension_sum)) tg) in assert (2 <= ln /\ ln <= 2));
  (newSessionTicketExtension_e_default_bytesize_eq (x))

let newSessionTicketExtension_bytesize_eqn_certificate_authorities  x =
    assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);

  LP.serialize_dsum_eq newSessionTicketExtension_sum extensionType_repr_serializer parse_newSessionTicketExtension_cases serialize_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser newSessionTicketExtension_e_default_serializer (E_certificate_authorities  x) ;
  let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_certificate_authorities  x) in
  assert_norm (tg == LP.Known (known_extensionType_as_enum_key Certificate_authorities));
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _ extensionType_repr_serializer (LP.dsum_enum newSessionTicketExtension_sum)) tg) in assert (2 <= ln /\ ln <= 2));
  (newSessionTicketExtension_e_default_bytesize_eq (x))

let newSessionTicketExtension_bytesize_eqn_psk_key_exchange_modes  x =
    assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);

  LP.serialize_dsum_eq newSessionTicketExtension_sum extensionType_repr_serializer parse_newSessionTicketExtension_cases serialize_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser newSessionTicketExtension_e_default_serializer (E_psk_key_exchange_modes  x) ;
  let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_psk_key_exchange_modes  x) in
  assert_norm (tg == LP.Known (known_extensionType_as_enum_key Psk_key_exchange_modes));
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _ extensionType_repr_serializer (LP.dsum_enum newSessionTicketExtension_sum)) tg) in assert (2 <= ln /\ ln <= 2));
  (newSessionTicketExtension_e_default_bytesize_eq (x))

let newSessionTicketExtension_bytesize_eqn_cookie  x =
    assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);

  LP.serialize_dsum_eq newSessionTicketExtension_sum extensionType_repr_serializer parse_newSessionTicketExtension_cases serialize_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser newSessionTicketExtension_e_default_serializer (E_cookie  x) ;
  let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_cookie  x) in
  assert_norm (tg == LP.Known (known_extensionType_as_enum_key Cookie));
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _ extensionType_repr_serializer (LP.dsum_enum newSessionTicketExtension_sum)) tg) in assert (2 <= ln /\ ln <= 2));
  (newSessionTicketExtension_e_default_bytesize_eq (x))

let newSessionTicketExtension_bytesize_eqn_supported_versions  x =
    assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);

  LP.serialize_dsum_eq newSessionTicketExtension_sum extensionType_repr_serializer parse_newSessionTicketExtension_cases serialize_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser newSessionTicketExtension_e_default_serializer (E_supported_versions  x) ;
  let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_supported_versions  x) in
  assert_norm (tg == LP.Known (known_extensionType_as_enum_key Supported_versions));
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _ extensionType_repr_serializer (LP.dsum_enum newSessionTicketExtension_sum)) tg) in assert (2 <= ln /\ ln <= 2));
  (newSessionTicketExtension_e_default_bytesize_eq (x))

let newSessionTicketExtension_bytesize_eqn_early_data  x =
    assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);

  LP.serialize_dsum_eq newSessionTicketExtension_sum extensionType_repr_serializer parse_newSessionTicketExtension_cases serialize_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser newSessionTicketExtension_e_default_serializer (E_early_data  x) ;
  let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_early_data  x) in
  assert_norm (tg == LP.Known (known_extensionType_as_enum_key Early_data));
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _ extensionType_repr_serializer (LP.dsum_enum newSessionTicketExtension_sum)) tg) in assert (2 <= ln /\ ln <= 2));
  (newSessionTicketExtension_e_default_bytesize_eq (x))

let newSessionTicketExtension_bytesize_eqn_pre_shared_key  x =
    assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);

  LP.serialize_dsum_eq newSessionTicketExtension_sum extensionType_repr_serializer parse_newSessionTicketExtension_cases serialize_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser newSessionTicketExtension_e_default_serializer (E_pre_shared_key  x) ;
  let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_pre_shared_key  x) in
  assert_norm (tg == LP.Known (known_extensionType_as_enum_key Pre_shared_key));
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _ extensionType_repr_serializer (LP.dsum_enum newSessionTicketExtension_sum)) tg) in assert (2 <= ln /\ ln <= 2));
  (newSessionTicketExtension_e_default_bytesize_eq (x))

let newSessionTicketExtension_bytesize_eqn_session_ticket  x =
    assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);

  LP.serialize_dsum_eq newSessionTicketExtension_sum extensionType_repr_serializer parse_newSessionTicketExtension_cases serialize_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser newSessionTicketExtension_e_default_serializer (E_session_ticket  x) ;
  let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_session_ticket  x) in
  assert_norm (tg == LP.Known (known_extensionType_as_enum_key Session_ticket));
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _ extensionType_repr_serializer (LP.dsum_enum newSessionTicketExtension_sum)) tg) in assert (2 <= ln /\ ln <= 2));
  (newSessionTicketExtension_e_default_bytesize_eq (x))

let newSessionTicketExtension_bytesize_eqn_extended_master_secret  x =
    assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);

  LP.serialize_dsum_eq newSessionTicketExtension_sum extensionType_repr_serializer parse_newSessionTicketExtension_cases serialize_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser newSessionTicketExtension_e_default_serializer (E_extended_master_secret  x) ;
  let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_extended_master_secret  x) in
  assert_norm (tg == LP.Known (known_extensionType_as_enum_key Extended_master_secret));
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _ extensionType_repr_serializer (LP.dsum_enum newSessionTicketExtension_sum)) tg) in assert (2 <= ln /\ ln <= 2));
  (newSessionTicketExtension_e_default_bytesize_eq (x))

let newSessionTicketExtension_bytesize_eqn_encrypt_then_mac  x =
    assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser) newSessionTicketExtension_sum parse_newSessionTicketExtension_cases (LP.get_parser_kind newSessionTicketExtension_e_default_parser) == newSessionTicketExtension_parser_kind);

  LP.serialize_dsum_eq newSessionTicketExtension_sum extensionType_repr_serializer parse_newSessionTicketExtension_cases serialize_newSessionTicketExtension_cases newSessionTicketExtension_e_default_parser newSessionTicketExtension_e_default_serializer (E_encrypt_then_mac  x) ;
  let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_encrypt_then_mac  x) in
  assert_norm (tg == LP.Known (known_extensionType_as_enum_key Encrypt_then_mac));
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _ extensionType_repr_serializer (LP.dsum_enum newSessionTicketExtension_sum)) tg) in assert (2 <= ln /\ ln <= 2));
  (newSessionTicketExtension_e_default_bytesize_eq (x))
/
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.NewSessionTicketExtension.fst
x: MiTLS.Parsers.NewSessionTicketExtension_e_default.newSessionTicketExtension_e_default
  -> FStar.Pervasives.Lemma
      (ensures
        MiTLS.Parsers.NewSessionTicketExtension.newSessionTicketExtension_bytesize (MiTLS.Parsers.NewSessionTicketExtension.E_padding
            x) ==
        2 +
        MiTLS.Parsers.NewSessionTicketExtension_e_default.newSessionTicketExtension_e_default_bytesize
          x)
      [
        SMTPat (MiTLS.Parsers.NewSessionTicketExtension.newSessionTicketExtension_bytesize (MiTLS.Parsers.NewSessionTicketExtension.E_padding
                x))
      ]
MiTLS.Parsers.NewSessionTicketExtension_e_default.newSessionTicketExtension_e_default MiTLS.Parsers.NewSessionTicketExtension_e_default.newSessionTicketExtension_e_default_bytesize_eq Prims.unit Prims._assert Prims.l_and Prims.b2t Prims.op_LessThanOrEqual Prims.nat FStar.Seq.Base.length LowParse.Bytes.byte LowParse.Spec.Base.serialize LowParse.Spec.Int.parse_u16_kind LowParse.Spec.Enum.maybe_enum_key LowParse.Spec.Sum.dsum_key_type MiTLS.Parsers.NewSessionTicketExtension.newSessionTicketExtension_sum FStar.UInt16.t LowParse.Spec.Sum.dsum_enum LowParse.Spec.Enum.parse_maybe_enum_key LowParse.Spec.Int.parse_u16 LowParse.Spec.Enum.serialize_maybe_enum_key MiTLS.Parsers.ExtensionType.extensionType_repr_serializer FStar.Pervasives.assert_norm Prims.eq2 MiTLS.Parsers.ExtensionType.extensionType MiTLS.Parsers.ExtensionType.extensionType_enum LowParse.Spec.Enum.Known MiTLS.Parsers.NewSessionTicketExtension.known_extensionType_as_enum_key MiTLS.Parsers.ExtensionType.Padding LowParse.Spec.Sum.dsum_key LowParse.Spec.Sum.dsum_tag_of_data MiTLS.Parsers.NewSessionTicketExtension.E_padding LowParse.Spec.Sum.serialize_dsum_eq MiTLS.Parsers.NewSessionTicketExtension.parse_newSessionTicketExtension_cases MiTLS.Parsers.NewSessionTicketExtension.serialize_newSessionTicketExtension_cases MiTLS.Parsers.NewSessionTicketExtension_e_default.newSessionTicketExtension_e_default_parser_kind MiTLS.Parsers.NewSessionTicketExtension_e_default.newSessionTicketExtension_e_default_parser MiTLS.Parsers.NewSessionTicketExtension_e_default.newSessionTicketExtension_e_default_serializer LowParse.Spec.Base.parser_kind LowParse.Spec.Sum.parse_dsum_kind LowParse.Spec.Base.get_parser_kind MiTLS.Parsers.ExtensionType.extensionType_repr_parser MiTLS.Parsers.NewSessionTicketExtension.newSessionTicketExtension_parser_kind
let newSessionTicketExtension_bytesize_eqn_padding x =
  
assert_norm (LP.parse_dsum_kind (LP.get_parser_kind extensionType_repr_parser)
      newSessionTicketExtension_sum
      parse_newSessionTicketExtension_cases
      (LP.get_parser_kind newSessionTicketExtension_e_default_parser) ==
    newSessionTicketExtension_parser_kind);
LP.serialize_dsum_eq newSessionTicketExtension_sum
  extensionType_repr_serializer
  parse_newSessionTicketExtension_cases
  serialize_newSessionTicketExtension_cases
  newSessionTicketExtension_e_default_parser
  newSessionTicketExtension_e_default_serializer
  (E_padding x);
let tg = LP.dsum_tag_of_data newSessionTicketExtension_sum (E_padding x) in
assert_norm (tg == LP.Known (known_extensionType_as_enum_key Padding));
(let ln =
    FStar.Seq.length (LP.serialize (LP.serialize_maybe_enum_key _
              extensionType_repr_serializer
              (LP.dsum_enum newSessionTicketExtension_sum))
          tg)
  in
  assert (2 <= ln /\ ln <= 2));
(newSessionTicketExtension_e_default_bytesize_eq (x))