val keyUpdateRequest_bytesize_eqn (x: keyUpdateRequest) : Lemma (keyUpdateRequest_bytesize x == 1) [SMTPat (keyUpdateRequest_bytesize x)]
val keyUpdateRequest_bytesize_eqn (x: keyUpdateRequest) : Lemma (keyUpdateRequest_bytesize x == 1) [SMTPat (keyUpdateRequest_bytesize x)]
let keyUpdateRequest_bytesize_eqn x = keyUpdateRequest_bytesize_eq x; assert (FStar.Seq.length (LP.serialize keyUpdateRequest_serializer x) <= 1); assert (1 <= FStar.Seq.length (LP.serialize keyUpdateRequest_serializer x))
module MiTLS.Parsers.KeyUpdateRequest

(* 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 keyUpdateRequest_enum : LP.enum keyUpdateRequest U8.t =
  [@inline_let] let e = [
    Update_not_requested, 0z;
    Update_requested, 1z;
  ] 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 keyUpdateRequest_repr_parser = LPI.parse_u8

noextract let keyUpdateRequest_repr_serializer = LPI.serialize_u8

inline_for_extraction noextract let keyUpdateRequest_repr_parser32 = LS.parse32_u8

inline_for_extraction noextract let keyUpdateRequest_repr_serializer32 = LS.serialize32_u8

inline_for_extraction noextract let keyUpdateRequest_repr_size32 = LSZ.size32_u8

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

inline_for_extraction noextract let keyUpdateRequest_repr_jumper = LL.jump_u8

inline_for_extraction noextract let keyUpdateRequest_repr_reader = LL.read_u8

inline_for_extraction noextract let keyUpdateRequest_repr_writer = LL.write_u8

inline_for_extraction let synth_keyUpdateRequest (x: LP.enum_key keyUpdateRequest_enum) : Tot keyUpdateRequest = x

inline_for_extraction let synth_keyUpdateRequest_inv (x: keyUpdateRequest) : Tot (LP.enum_key keyUpdateRequest_enum) =
  [@inline_let] let _ : squash (LP.list_mem x (LP.list_map fst keyUpdateRequest_enum)) =
    _ by (LP.synth_maybe_enum_key_inv_unknown_tac x)
  in
  x

let lemma_synth_keyUpdateRequest_inj () : Lemma
  (LP.synth_injective synth_keyUpdateRequest) = ()

let lemma_synth_keyUpdateRequest_inv () : Lemma
  (LP.synth_inverse synth_keyUpdateRequest synth_keyUpdateRequest_inv) = ()

noextract let parse_keyUpdateRequest_key : LP.parser _ (LP.enum_key keyUpdateRequest_enum) =
  LP.parse_enum_key keyUpdateRequest_repr_parser keyUpdateRequest_enum

noextract let serialize_keyUpdateRequest_key : LP.serializer parse_keyUpdateRequest_key =
  LP.serialize_enum_key keyUpdateRequest_repr_parser keyUpdateRequest_repr_serializer keyUpdateRequest_enum

noextract let keyUpdateRequest_parser : LP.parser _ keyUpdateRequest =
  lemma_synth_keyUpdateRequest_inj ();
  parse_keyUpdateRequest_key `LP.parse_synth` synth_keyUpdateRequest

noextract let keyUpdateRequest_serializer : LP.serializer keyUpdateRequest_parser =
  lemma_synth_keyUpdateRequest_inj ();
  lemma_synth_keyUpdateRequest_inv ();
  LP.serialize_synth _ synth_keyUpdateRequest serialize_keyUpdateRequest_key synth_keyUpdateRequest_inv ()

let keyUpdateRequest_bytesize (x:keyUpdateRequest) : GTot nat = Seq.length (keyUpdateRequest_serializer x)

let keyUpdateRequest_bytesize_eq x = ()

let parse32_keyUpdateRequest_key : LS.parser32 parse_keyUpdateRequest_key =
  FStar.Tactics.synth_by_tactic (LS.parse32_enum_key_tac keyUpdateRequest_repr_parser32 keyUpdateRequest_enum)

let keyUpdateRequest_parser32 : LS.parser32 keyUpdateRequest_parser =
  lemma_synth_keyUpdateRequest_inj ();
  LS.parse32_synth _ synth_keyUpdateRequest (fun x->synth_keyUpdateRequest x) parse32_keyUpdateRequest_key ()

let serialize32_keyUpdateRequest_key : LS.serializer32 serialize_keyUpdateRequest_key =
  FStar.Tactics.synth_by_tactic (LS.serialize32_enum_key_gen_tac
    keyUpdateRequest_repr_serializer32 keyUpdateRequest_enum)

let keyUpdateRequest_serializer32 : LS.serializer32 keyUpdateRequest_serializer =
  lemma_synth_keyUpdateRequest_inj ();
  lemma_synth_keyUpdateRequest_inv ();
  LS.serialize32_synth _ synth_keyUpdateRequest _ serialize32_keyUpdateRequest_key synth_keyUpdateRequest_inv (fun x->synth_keyUpdateRequest_inv x) ()

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

[@@ (LT.postprocess_with LT.pp_norm_tac)]
inline_for_extraction let validate_keyUpdateRequest_key : LL.validator parse_keyUpdateRequest_key =
    LL.mk_validate_enum_key keyUpdateRequest_repr_validator keyUpdateRequest_repr_reader keyUpdateRequest_enum

let keyUpdateRequest_validator =
  lemma_synth_keyUpdateRequest_inj ();
  LL.validate_synth validate_keyUpdateRequest_key synth_keyUpdateRequest ()

[@@ (LT.postprocess_with LT.pp_norm_tac) ]
inline_for_extraction let read_keyUpdateRequest_key : LL.leaf_reader parse_keyUpdateRequest_key =
  LL.mk_read_enum_key keyUpdateRequest_repr_reader keyUpdateRequest_enum

let keyUpdateRequest_reader =
 [@inline_let] let _ = lemma_synth_keyUpdateRequest_inj () in
 LL.read_synth' parse_keyUpdateRequest_key synth_keyUpdateRequest read_keyUpdateRequest_key ()

inline_for_extraction let write_keyUpdateRequest_key : LL.leaf_writer_strong serialize_keyUpdateRequest_key =
  LL.write_enum_key keyUpdateRequest_repr_writer keyUpdateRequest_enum (_ by (LP.enum_repr_of_key_tac keyUpdateRequest_enum))

inline_for_extraction let lserialize_keyUpdateRequest_key : LL.serializer32 serialize_keyUpdateRequest_key =
  LL.serializer32_of_leaf_writer_strong_constant_size write_keyUpdateRequest_key 1ul ()

let keyUpdateRequest_writer =
  [@inline_let] let _ = lemma_synth_keyUpdateRequest_inj (); lemma_synth_keyUpdateRequest_inv () in
  LL.write_synth write_keyUpdateRequest_key synth_keyUpdateRequest synth_keyUpdateRequest_inv (fun x -> synth_keyUpdateRequest_inv x) ()

let keyUpdateRequest_lserializer = LL.serializer32_of_leaf_writer_strong_constant_size keyUpdateRequest_writer 1ul ()
/
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.KeyUpdateRequest.fst
x: MiTLS.Parsers.KeyUpdateRequest.keyUpdateRequest
  -> FStar.Pervasives.Lemma
      (ensures MiTLS.Parsers.KeyUpdateRequest.keyUpdateRequest_bytesize x == 1)
      [SMTPat (MiTLS.Parsers.KeyUpdateRequest.keyUpdateRequest_bytesize x)]
MiTLS.Parsers.KeyUpdateRequest.keyUpdateRequest Prims._assert Prims.b2t Prims.op_LessThanOrEqual FStar.Seq.Base.length LowParse.Bytes.byte LowParse.Spec.Base.serialize MiTLS.Parsers.KeyUpdateRequest.keyUpdateRequest_parser_kind MiTLS.Parsers.KeyUpdateRequest.keyUpdateRequest_parser MiTLS.Parsers.KeyUpdateRequest.keyUpdateRequest_serializer Prims.unit MiTLS.Parsers.KeyUpdateRequest.keyUpdateRequest_bytesize_eq
let keyUpdateRequest_bytesize_eqn x =
  
keyUpdateRequest_bytesize_eq x;
assert (FStar.Seq.length (LP.serialize keyUpdateRequest_serializer x) <= 1);
assert (1 <= FStar.Seq.length (LP.serialize keyUpdateRequest_serializer x))