val lserialize_alertDescription_key:LL.serializer32 serialize_alertDescription_key
let lserialize_alertDescription_key : LL.serializer32 serialize_alertDescription_key =
  LL.serializer32_of_leaf_writer_strong_constant_size write_alertDescription_key 1ul ()
val lserialize_alertDescription_key:LL.serializer32 serialize_alertDescription_key
let lserialize_alertDescription_key:LL.serializer32 serialize_alertDescription_key =
LL.serializer32_of_leaf_writer_strong_constant_size write_alertDescription_key 1ul ()
Parsers.AlertDescription.fst.checked
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
Parsers.AlertDescription.fst
LowParse.Low.Base.serializer32_of_leaf_writer_strong_constant_size LowParse.Spec.Combinators.parse_filter_kind LowParse.Spec.Int.parse_u8_kind LowParse.Spec.Enum.enum_key Parsers.AlertDescription.alertDescription FStar.UInt8.t Parsers.AlertDescription.alertDescription_enum Parsers.AlertDescription.parse_alertDescription_key Parsers.AlertDescription.serialize_alertDescription_key Parsers.AlertDescription.write_alertDescription_key FStar.UInt32.__uint_to_t
module Parsers.AlertDescription

(* 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 alertDescription_enum : LP.enum alertDescription U8.t =
  [@inline_let] let e = [
    Close_notify, 0z;
    Unexpected_message, 10z;
    Bad_record_mac, 20z;
    Record_overflow, 22z;
    Handshake_failure, 40z;
    Bad_certificate, 42z;
    Unsupported_certificate, 43z;
    Certificate_revoked, 44z;
    Certificate_expired, 45z;
    Certificate_unknown, 46z;
    Illegal_parameter, 47z;
    Unknown_ca, 48z;
    Access_denied, 49z;
    Decode_error, 50z;
    Decrypt_error, 51z;
    Protocol_version, 70z;
    Insufficient_security, 71z;
    Internal_error, 80z;
    Inappropriate_fallback, 86z;
    User_canceled, 90z;
    Missing_extension, 109z;
    Unsupported_extension, 110z;
    Unrecognized_name, 112z;
    Bad_certificate_status_response, 113z;
    Unknown_psk_identity, 115z;
    Certificate_required, 116z;
    No_application_protocol, 120z;
  ] 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 alertDescription_repr_parser = LPI.parse_u8

noextract let alertDescription_repr_serializer = LPI.serialize_u8

inline_for_extraction noextract let alertDescription_repr_parser32 = LS.parse32_u8

inline_for_extraction noextract let alertDescription_repr_serializer32 = LS.serialize32_u8

inline_for_extraction noextract let alertDescription_repr_size32 = LSZ.size32_u8

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

inline_for_extraction noextract let alertDescription_repr_jumper = LL.jump_u8

inline_for_extraction noextract let alertDescription_repr_reader = LL.read_u8

inline_for_extraction noextract let alertDescription_repr_writer = LL.write_u8

inline_for_extraction let synth_alertDescription (x: LP.enum_key alertDescription_enum) : Tot alertDescription = x

inline_for_extraction let synth_alertDescription_inv (x: alertDescription) : Tot (LP.enum_key alertDescription_enum) =
  [@inline_let] let _ : squash (LP.list_mem x (LP.list_map fst alertDescription_enum)) =
    _ by (LP.synth_maybe_enum_key_inv_unknown_tac x)
  in
  x

let lemma_synth_alertDescription_inj () : Lemma
  (LP.synth_injective synth_alertDescription) = ()

let lemma_synth_alertDescription_inv () : Lemma
  (LP.synth_inverse synth_alertDescription synth_alertDescription_inv) = ()

noextract let parse_alertDescription_key : LP.parser _ (LP.enum_key alertDescription_enum) =
  LP.parse_enum_key alertDescription_repr_parser alertDescription_enum

noextract let serialize_alertDescription_key : LP.serializer parse_alertDescription_key =
  LP.serialize_enum_key alertDescription_repr_parser alertDescription_repr_serializer alertDescription_enum

noextract let alertDescription_parser : LP.parser _ alertDescription =
  lemma_synth_alertDescription_inj ();
  parse_alertDescription_key `LP.parse_synth` synth_alertDescription

noextract let alertDescription_serializer : LP.serializer alertDescription_parser =
  lemma_synth_alertDescription_inj ();
  lemma_synth_alertDescription_inv ();
  LP.serialize_synth _ synth_alertDescription serialize_alertDescription_key synth_alertDescription_inv ()

let alertDescription_bytesize (x:alertDescription) : GTot nat = Seq.length (alertDescription_serializer x)

let alertDescription_bytesize_eq x = ()

let parse32_alertDescription_key : LS.parser32 parse_alertDescription_key =
  FStar.Tactics.synth_by_tactic (LS.parse32_enum_key_tac alertDescription_repr_parser32 alertDescription_enum)

let alertDescription_parser32 : LS.parser32 alertDescription_parser =
  lemma_synth_alertDescription_inj ();
  LS.parse32_synth _ synth_alertDescription (fun x->synth_alertDescription x) parse32_alertDescription_key ()

let serialize32_alertDescription_key : LS.serializer32 serialize_alertDescription_key =
  FStar.Tactics.synth_by_tactic (LS.serialize32_enum_key_gen_tac
    alertDescription_repr_serializer32 alertDescription_enum)

let alertDescription_serializer32 : LS.serializer32 alertDescription_serializer =
  lemma_synth_alertDescription_inj ();
  lemma_synth_alertDescription_inv ();
  LS.serialize32_synth _ synth_alertDescription _ serialize32_alertDescription_key synth_alertDescription_inv (fun x->synth_alertDescription_inv x) ()

let alertDescription_size32 =
  [@inline_let] let _ = assert_norm (LSZ.size32_constant_precond alertDescription_serializer 1ul) in
  LSZ.size32_constant alertDescription_serializer 1ul ()

[@@ (LT.postprocess_with LT.pp_norm_tac)]
inline_for_extraction let validate_alertDescription_key : LL.validator parse_alertDescription_key =
    LL.mk_validate_enum_key alertDescription_repr_validator alertDescription_repr_reader alertDescription_enum

let alertDescription_validator =
  lemma_synth_alertDescription_inj ();
  LL.validate_synth validate_alertDescription_key synth_alertDescription ()

[@@ (LT.postprocess_with LT.pp_norm_tac) ]
inline_for_extraction let read_alertDescription_key : LL.leaf_reader parse_alertDescription_key =
  LL.mk_read_enum_key alertDescription_repr_reader alertDescription_enum

let alertDescription_reader =
 [@inline_let] let _ = lemma_synth_alertDescription_inj () in
 LL.read_synth' parse_alertDescription_key synth_alertDescription read_alertDescription_key ()

inline_for_extraction let write_alertDescription_key : LL.leaf_writer_strong serialize_alertDescription_key =
  LL.write_enum_key alertDescription_repr_writer alertDescription_enum (_ by (LP.enum_repr_of_key_tac alertDescription_enum))
val lserialize_alertDescription_key:LL.serializer32 serialize_alertDescription_key
LowParse.Low.Base.serializer32 Parsers.AlertDescription.serialize_alertDescription_key