val clientCertificateType_parser: LP.parser clientCertificateType_parser_kind clientCertificateType
val clientCertificateType_parser: LP.parser clientCertificateType_parser_kind clientCertificateType
let clientCertificateType_parser : LP.parser _ clientCertificateType =
  lemma_synth_clientCertificateType_inj ();
  parse_maybe_clientCertificateType_key `LP.parse_synth` synth_clientCertificateType
module MiTLS.Parsers.ClientCertificateType

(* 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"

[@LT.Norm] inline_for_extraction let clientCertificateType_enum : LP.enum clientCertificateType U8.t =
  [@inline_let] let e = [
    Rsa_sign, 1z;
    Dss_sign, 2z;
    Rsa_fixed_dh, 3z;
    Dss_fixed_dh, 4z;
    Rsa_ephemeral_dh_RESERVED, 5z;
    Dss_ephemeral_dh_RESERVED, 6z;
    Fortezza_dms_RESERVED, 20z;
  ] in
  [@inline_let] let _ =
    assert_norm (L.noRepeats (LP.list_map fst e))
  in
  [@inline_let] let _ = 
    assert_norm (L.noRepeats (LP.list_map snd e))
  in e

noextract let clientCertificateType_repr_parser = LPI.parse_u8

noextract let clientCertificateType_repr_serializer = LPI.serialize_u8

inline_for_extraction noextract let clientCertificateType_repr_parser32 = LS.parse32_u8

inline_for_extraction noextract let clientCertificateType_repr_serializer32 = LS.serialize32_u8

inline_for_extraction noextract let clientCertificateType_repr_size32 = LSZ.size32_u8

inline_for_extraction noextract let clientCertificateType_repr_validator = (LL.validate_u8 ())

inline_for_extraction noextract let clientCertificateType_repr_jumper = LL.jump_u8

inline_for_extraction noextract let clientCertificateType_repr_reader = LL.read_u8

inline_for_extraction noextract let clientCertificateType_repr_writer = LL.write_u8

inline_for_extraction let synth_clientCertificateType (x:LP.maybe_enum_key clientCertificateType_enum) : clientCertificateType = 
  match x with
  | LP.Known k -> k
  | LP.Unknown y ->
    [@inline_let] let v : U8.t = y in
    [@inline_let] let _ = assert_norm (LP.list_mem v (LP.list_map snd clientCertificateType_enum) == known_clientCertificateType_repr v) in
    Unknown_clientCertificateType v

inline_for_extraction let synth_clientCertificateType_inv (x:clientCertificateType) : LP.maybe_enum_key clientCertificateType_enum = 
  match x with
  | Unknown_clientCertificateType y ->
    [@inline_let] let v : U8.t = y in
    [@inline_let] let _ = assert_norm (LP.list_mem v (LP.list_map snd clientCertificateType_enum) == known_clientCertificateType_repr v) in
    LP.Unknown v
  | x ->
    [@inline_let] let x1 : clientCertificateType = x in
    [@inline_let] let _ : squash(not (Unknown_clientCertificateType? x1) ==> LP.list_mem x1 (LP.list_map fst clientCertificateType_enum)) =
      _ by (LP.synth_maybe_enum_key_inv_unknown_tac x1)
    in
    LP.Known (x1 <: LP.enum_key clientCertificateType_enum)

let lemma_synth_clientCertificateType_inv' () : Lemma
  (LP.synth_inverse synth_clientCertificateType_inv synth_clientCertificateType)
= LP.forall_maybe_enum_key clientCertificateType_enum (fun x -> synth_clientCertificateType_inv (synth_clientCertificateType x) == x)
    (_ by (LP.forall_maybe_enum_key_known_tac ()))
    (_ by (LP.forall_maybe_enum_key_unknown_tac ()))

let lemma_synth_clientCertificateType_inj () : Lemma
  (LP.synth_injective synth_clientCertificateType) = 
  lemma_synth_clientCertificateType_inv' ();
  LP.synth_inverse_synth_injective synth_clientCertificateType synth_clientCertificateType_inv

#push-options "--max_ifuel 0 --initial_ifuel 0 --max_fuel 0 --max_ifuel 0"
let lemma_synth_clientCertificateType_inv () : Lemma
  (LP.synth_inverse synth_clientCertificateType synth_clientCertificateType_inv) = allow_inversion clientCertificateType; ()

#pop-options
noextract let parse_maybe_clientCertificateType_key : LP.parser _ (LP.maybe_enum_key clientCertificateType_enum) =
  LP.parse_maybe_enum_key clientCertificateType_repr_parser clientCertificateType_enum

noextract let serialize_maybe_clientCertificateType_key : LP.serializer parse_maybe_clientCertificateType_key =
  LP.serialize_maybe_enum_key clientCertificateType_repr_parser clientCertificateType_repr_serializer clientCertificateType_enum
/
prims.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.Tactics.fst.checked FStar.Seq.fst.checked FStar.Pervasives.Native.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.ClientCertificateType.fst
LowParse.Spec.Base.parser MiTLS.Parsers.ClientCertificateType.clientCertificateType_parser_kind
  MiTLS.Parsers.ClientCertificateType.clientCertificateType
LowParse.Spec.Combinators.parse_synth LowParse.Spec.Int.parse_u8_kind LowParse.Spec.Enum.maybe_enum_key MiTLS.Parsers.ClientCertificateType.clientCertificateType FStar.UInt8.t MiTLS.Parsers.ClientCertificateType.clientCertificateType_enum MiTLS.Parsers.ClientCertificateType.parse_maybe_clientCertificateType_key MiTLS.Parsers.ClientCertificateType.synth_clientCertificateType Prims.unit MiTLS.Parsers.ClientCertificateType.lemma_synth_clientCertificateType_inj LowParse.Spec.Base.parser
let clientCertificateType_parser:LP.parser _ clientCertificateType =
  
lemma_synth_clientCertificateType_inj ();
parse_maybe_clientCertificateType_key `LP.parse_synth` synth_clientCertificateType