val serverDHParams_valid (h:HS.mem) (#rrel: _) (#rel: _) (input:LL.slice rrel rel) (pos0:U32.t) : Lemma
  (requires (
  LL.valid serverDHParams_dh_p_parser h input pos0 /\ (
  let pos1 = LL.get_valid_pos serverDHParams_dh_p_parser h input pos0 in
  LL.valid serverDHParams_dh_g_parser h input pos1 /\ (
  let pos2 = LL.get_valid_pos serverDHParams_dh_g_parser h input pos1 in
  LL.valid serverDHParams_dh_Ys_parser h input pos2 /\ (
  let pos3 = LL.get_valid_pos serverDHParams_dh_Ys_parser h input pos2 in
  True
  )))))
  (ensures (
  let dh_p = LL.contents serverDHParams_dh_p_parser h input pos0 in
  let pos1 = LL.get_valid_pos serverDHParams_dh_p_parser h input pos0 in
  let dh_g = LL.contents serverDHParams_dh_g_parser h input pos1 in
  let pos2 = LL.get_valid_pos serverDHParams_dh_g_parser h input pos1 in
  let dh_Ys = LL.contents serverDHParams_dh_Ys_parser h input pos2 in
  let pos3 = LL.get_valid_pos serverDHParams_dh_Ys_parser h input pos2 in
  LL.valid_content_pos serverDHParams_parser h input pos0 ({
      dh_p = dh_p;
      dh_g = dh_g;
      dh_Ys = dh_Ys;
    }) pos3))
val serverDHParams_valid (h:HS.mem) (#rrel: _) (#rel: _) (input:LL.slice rrel rel) (pos0:U32.t) : Lemma
  (requires (
  LL.valid serverDHParams_dh_p_parser h input pos0 /\ (
  let pos1 = LL.get_valid_pos serverDHParams_dh_p_parser h input pos0 in
  LL.valid serverDHParams_dh_g_parser h input pos1 /\ (
  let pos2 = LL.get_valid_pos serverDHParams_dh_g_parser h input pos1 in
  LL.valid serverDHParams_dh_Ys_parser h input pos2 /\ (
  let pos3 = LL.get_valid_pos serverDHParams_dh_Ys_parser h input pos2 in
  True
  )))))
  (ensures (
  let dh_p = LL.contents serverDHParams_dh_p_parser h input pos0 in
  let pos1 = LL.get_valid_pos serverDHParams_dh_p_parser h input pos0 in
  let dh_g = LL.contents serverDHParams_dh_g_parser h input pos1 in
  let pos2 = LL.get_valid_pos serverDHParams_dh_g_parser h input pos1 in
  let dh_Ys = LL.contents serverDHParams_dh_Ys_parser h input pos2 in
  let pos3 = LL.get_valid_pos serverDHParams_dh_Ys_parser h input pos2 in
  LL.valid_content_pos serverDHParams_parser h input pos0 ({
      dh_p = dh_p;
      dh_g = dh_g;
      dh_Ys = dh_Ys;
    }) pos3))
let serverDHParams_valid h #_ #_ input pos0 =
  let dh_p = LL.contents serverDHParams_dh_p_parser h input pos0 in
  let pos1 = LL.get_valid_pos serverDHParams_dh_p_parser h input pos0 in
  let dh_g = LL.contents serverDHParams_dh_g_parser h input pos1 in
  let pos2 = LL.get_valid_pos serverDHParams_dh_g_parser h input pos1 in
  let dh_Ys = LL.contents serverDHParams_dh_Ys_parser h input pos2 in
  let pos3 = LL.get_valid_pos serverDHParams_dh_Ys_parser h input pos2 in
  LL.valid_nondep_then_intro h serverDHParams_dh_p_parser serverDHParams_dh_g_parser input pos0;
  LL.valid_nondep_then_intro h (serverDHParams_dh_p_parser `LP.nondep_then` serverDHParams_dh_g_parser) serverDHParams_dh_Ys_parser input pos0;
  assert_norm (serverDHParams' == LP.get_parser_type serverDHParams'_parser);
  assert_norm (serverDHParams_parser_kind == serverDHParams'_parser_kind);
  synth_serverDHParams_injective ();
  LL.valid_synth_intro h serverDHParams'_parser synth_serverDHParams input pos0
module MiTLS.Parsers.ServerDHParams

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

(* Type of field dh_p*)
open MiTLS.Parsers.ServerDHParams_dh_p

(* Type of field dh_g*)
open MiTLS.Parsers.ServerDHParams_dh_g

(* Type of field dh_Ys*)
open MiTLS.Parsers.ServerDHParams_dh_Ys

type serverDHParams' = ((serverDHParams_dh_p & serverDHParams_dh_g) & serverDHParams_dh_Ys)

inline_for_extraction let synth_serverDHParams (x: serverDHParams') : serverDHParams =
  match x with ((dh_p,dh_g),dh_Ys) -> {
    dh_p = dh_p;
    dh_g = dh_g;
    dh_Ys = dh_Ys;
  }

inline_for_extraction let synth_serverDHParams_recip (x: serverDHParams) : serverDHParams' = ((x.dh_p,x.dh_g),x.dh_Ys)

let synth_serverDHParams_recip_inverse () : Lemma (LP.synth_inverse synth_serverDHParams_recip synth_serverDHParams) = ()

let synth_serverDHParams_injective () : Lemma (LP.synth_injective synth_serverDHParams) =
  LP.synth_inverse_synth_injective synth_serverDHParams_recip synth_serverDHParams;
  synth_serverDHParams_recip_inverse ()

let synth_serverDHParams_inverse () : Lemma (LP.synth_inverse synth_serverDHParams synth_serverDHParams_recip) =
  assert_norm (LP.synth_inverse synth_serverDHParams synth_serverDHParams_recip)

let synth_serverDHParams_recip_injective () : Lemma (LP.synth_injective synth_serverDHParams_recip) =
  synth_serverDHParams_recip_inverse ();
  LP.synth_inverse_synth_injective synth_serverDHParams synth_serverDHParams_recip

noextract let serverDHParams'_parser : LP.parser _ serverDHParams' = ((serverDHParams_dh_p_parser `LP.nondep_then` serverDHParams_dh_g_parser) `LP.nondep_then` serverDHParams_dh_Ys_parser)

noextract let serverDHParams'_parser_kind = LP.get_parser_kind serverDHParams'_parser

let serverDHParams_parser =
  synth_serverDHParams_injective ();
  assert_norm (serverDHParams_parser_kind == serverDHParams'_parser_kind);
  serverDHParams'_parser `LP.parse_synth` synth_serverDHParams

noextract let serverDHParams'_serializer : LP.serializer serverDHParams'_parser = ((serverDHParams_dh_p_serializer `LP.serialize_nondep_then` serverDHParams_dh_g_serializer) `LP.serialize_nondep_then` serverDHParams_dh_Ys_serializer)

let serverDHParams_serializer =
  [@inline_let] let _ = synth_serverDHParams_injective () in
  [@inline_let] let _ = synth_serverDHParams_inverse () in
  [@inline_let] let _ = assert_norm (serverDHParams_parser_kind == serverDHParams'_parser_kind) in
  LP.serialize_synth _ synth_serverDHParams serverDHParams'_serializer synth_serverDHParams_recip ()

let serverDHParams_bytesize (x:serverDHParams) : GTot nat = Seq.length (serverDHParams_serializer x)

let serverDHParams_bytesize_eq x = ()

inline_for_extraction let serverDHParams'_parser32 : LS.parser32 serverDHParams'_parser = ((serverDHParams_dh_p_parser32 `LS.parse32_nondep_then` serverDHParams_dh_g_parser32) `LS.parse32_nondep_then` serverDHParams_dh_Ys_parser32)

let serverDHParams_parser32 =
  [@inline_let] let _ = synth_serverDHParams_injective () in
  [@inline_let] let _ = assert_norm (serverDHParams_parser_kind == serverDHParams'_parser_kind) in
  LS.parse32_synth _ synth_serverDHParams (fun x -> synth_serverDHParams x) serverDHParams'_parser32 ()

inline_for_extraction let serverDHParams'_serializer32 : LS.serializer32 serverDHParams'_serializer = ((serverDHParams_dh_p_serializer32 `LS.serialize32_nondep_then` serverDHParams_dh_g_serializer32) `LS.serialize32_nondep_then` serverDHParams_dh_Ys_serializer32)

let serverDHParams_serializer32 =
  [@inline_let] let _ = synth_serverDHParams_injective () in
  [@inline_let] let _ = synth_serverDHParams_inverse () in
  [@inline_let] let _ = assert_norm (serverDHParams_parser_kind == serverDHParams'_parser_kind) in
  LS.serialize32_synth _ synth_serverDHParams _ serverDHParams'_serializer32 synth_serverDHParams_recip (fun x -> synth_serverDHParams_recip x) ()

inline_for_extraction let serverDHParams'_size32 : LSZ.size32 serverDHParams'_serializer = ((serverDHParams_dh_p_size32 `LSZ.size32_nondep_then` serverDHParams_dh_g_size32) `LSZ.size32_nondep_then` serverDHParams_dh_Ys_size32)

let serverDHParams_size32 =
  [@inline_let] let _ = synth_serverDHParams_injective () in
  [@inline_let] let _ = synth_serverDHParams_inverse () in
  [@inline_let] let _ = assert_norm (serverDHParams_parser_kind == serverDHParams'_parser_kind) in
  LSZ.size32_synth _ synth_serverDHParams _ serverDHParams'_size32 synth_serverDHParams_recip (fun x -> synth_serverDHParams_recip x) ()

inline_for_extraction let serverDHParams'_validator : LL.validator serverDHParams'_parser = ((serverDHParams_dh_p_validator `LL.validate_nondep_then` serverDHParams_dh_g_validator) `LL.validate_nondep_then` serverDHParams_dh_Ys_validator)

let serverDHParams_validator =
  [@inline_let] let _ = synth_serverDHParams_injective () in
  [@inline_let] let _ = assert_norm (serverDHParams_parser_kind == serverDHParams'_parser_kind) in
  LL.validate_synth serverDHParams'_validator synth_serverDHParams ()

inline_for_extraction let serverDHParams'_jumper : LL.jumper serverDHParams'_parser = ((serverDHParams_dh_p_jumper `LL.jump_nondep_then` serverDHParams_dh_g_jumper) `LL.jump_nondep_then` serverDHParams_dh_Ys_jumper)

let serverDHParams_jumper =
  [@inline_let] let _ = synth_serverDHParams_injective () in
  [@inline_let] let _ = assert_norm (serverDHParams_parser_kind == serverDHParams'_parser_kind) in
  LL.jump_synth serverDHParams'_jumper synth_serverDHParams ()

let serverDHParams_bytesize_eqn x =
  [@inline_let] let _ = synth_serverDHParams_injective () in
  [@inline_let] let _ = synth_serverDHParams_inverse () in
  [@inline_let] let _ = assert_norm (serverDHParams_parser_kind == serverDHParams'_parser_kind) in
  LP.serialize_synth_eq _ synth_serverDHParams serverDHParams'_serializer synth_serverDHParams_recip () x;
LP.length_serialize_nondep_then serverDHParams_dh_p_serializer serverDHParams_dh_g_serializer x.dh_p x.dh_g;
LP.length_serialize_nondep_then (serverDHParams_dh_p_serializer `LP.serialize_nondep_then` serverDHParams_dh_g_serializer) serverDHParams_dh_Ys_serializer (x.dh_p, x.dh_g) x.dh_Ys;
  (serverDHParams_dh_p_bytesize_eq (x.dh_p));
  (serverDHParams_dh_g_bytesize_eq (x.dh_g));
  (serverDHParams_dh_Ys_bytesize_eq (x.dh_Ys));
  assert(serverDHParams_bytesize x == Seq.length (LP.serialize serverDHParams_dh_p_serializer x.dh_p) + Seq.length (LP.serialize serverDHParams_dh_g_serializer x.dh_g) + Seq.length (LP.serialize serverDHParams_dh_Ys_serializer x.dh_Ys))

let gaccessor'_serverDHParams_dh_p : LL.gaccessor serverDHParams'_parser serverDHParams_dh_p_parser _ = (LL.gaccessor_then_fst (LL.gaccessor_then_fst (LL.gaccessor_id serverDHParams'_parser)))

let gaccessor'_serverDHParams_dh_g : LL.gaccessor serverDHParams'_parser serverDHParams_dh_g_parser _ = (LL.gaccessor_then_snd (LL.gaccessor_then_fst (LL.gaccessor_id serverDHParams'_parser)))

let gaccessor'_serverDHParams_dh_Ys : LL.gaccessor serverDHParams'_parser serverDHParams_dh_Ys_parser _ = (LL.gaccessor_then_snd (LL.gaccessor_id serverDHParams'_parser))

inline_for_extraction noextract let accessor'_serverDHParams_dh_p : LL.accessor gaccessor'_serverDHParams_dh_p = (LL.accessor_then_fst (LL.accessor_then_fst (LL.accessor_id serverDHParams'_parser)))

inline_for_extraction noextract let accessor'_serverDHParams_dh_g : LL.accessor gaccessor'_serverDHParams_dh_g = (LL.accessor_then_snd (LL.accessor_then_fst (LL.accessor_id serverDHParams'_parser)) serverDHParams_dh_p_jumper)

inline_for_extraction noextract let accessor'_serverDHParams_dh_Ys : LL.accessor gaccessor'_serverDHParams_dh_Ys = (LL.accessor_then_snd (LL.accessor_id serverDHParams'_parser) (serverDHParams_dh_p_jumper `LL.jump_nondep_then` serverDHParams_dh_g_jumper))

noextract let clens_serverDHParams_serverDHParams' : LL.clens serverDHParams serverDHParams' = synth_serverDHParams_recip_inverse (); synth_serverDHParams_recip_injective (); LL.clens_synth synth_serverDHParams_recip synth_serverDHParams

let gaccessor_serverDHParams_serverDHParams' : LL.gaccessor serverDHParams_parser serverDHParams'_parser clens_serverDHParams_serverDHParams' = synth_serverDHParams_inverse (); synth_serverDHParams_injective (); synth_serverDHParams_recip_inverse (); LL.gaccessor_synth serverDHParams'_parser synth_serverDHParams synth_serverDHParams_recip ()

inline_for_extraction noextract let accessor_serverDHParams_serverDHParams' : LL.accessor gaccessor_serverDHParams_serverDHParams' = synth_serverDHParams_inverse (); synth_serverDHParams_injective (); synth_serverDHParams_recip_inverse (); LL.accessor_synth serverDHParams'_parser synth_serverDHParams synth_serverDHParams_recip ()

let gaccessor_serverDHParams_dh_p = LL.gaccessor_ext (gaccessor_serverDHParams_serverDHParams' `LL.gaccessor_compose` gaccessor'_serverDHParams_dh_p) clens_serverDHParams_dh_p ()

let accessor_serverDHParams_dh_p = LL.accessor_ext (LL.accessor_compose accessor_serverDHParams_serverDHParams' accessor'_serverDHParams_dh_p ()) clens_serverDHParams_dh_p ()

let gaccessor_serverDHParams_dh_g = LL.gaccessor_ext (gaccessor_serverDHParams_serverDHParams' `LL.gaccessor_compose` gaccessor'_serverDHParams_dh_g) clens_serverDHParams_dh_g ()

let accessor_serverDHParams_dh_g = LL.accessor_ext (LL.accessor_compose accessor_serverDHParams_serverDHParams' accessor'_serverDHParams_dh_g ()) clens_serverDHParams_dh_g ()

let gaccessor_serverDHParams_dh_Ys = LL.gaccessor_ext (gaccessor_serverDHParams_serverDHParams' `LL.gaccessor_compose` gaccessor'_serverDHParams_dh_Ys) clens_serverDHParams_dh_Ys ()

let accessor_serverDHParams_dh_Ys = LL.accessor_ext (LL.accessor_compose accessor_serverDHParams_serverDHParams' accessor'_serverDHParams_dh_Ys ()) clens_serverDHParams_dh_Ys ()
/
prims.fst.checked MiTLS.Parsers.ServerDHParams_dh_Ys.fsti.checked MiTLS.Parsers.ServerDHParams_dh_p.fsti.checked MiTLS.Parsers.ServerDHParams_dh_g.fsti.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.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.ServerDHParams.fst
h: FStar.Monotonic.HyperStack.mem -> input: LowParse.Slice.slice rrel rel -> pos0: FStar.UInt32.t
  -> FStar.Pervasives.Lemma
      (requires
        LowParse.Low.Base.Spec.valid MiTLS.Parsers.ServerDHParams_dh_p.serverDHParams_dh_p_parser
          h
          input
          pos0 /\
        (let pos1 =
            LowParse.Low.Base.Spec.get_valid_pos MiTLS.Parsers.ServerDHParams_dh_p.serverDHParams_dh_p_parser
              h
              input
              pos0
          in
          LowParse.Low.Base.Spec.valid MiTLS.Parsers.ServerDHParams_dh_g.serverDHParams_dh_g_parser
            h
            input
            pos1 /\
          (let pos2 =
              LowParse.Low.Base.Spec.get_valid_pos MiTLS.Parsers.ServerDHParams_dh_g.serverDHParams_dh_g_parser
                h
                input
                pos1
            in
            LowParse.Low.Base.Spec.valid MiTLS.Parsers.ServerDHParams_dh_Ys.serverDHParams_dh_Ys_parser
              h
              input
              pos2 /\
            (let pos3 =
                LowParse.Low.Base.Spec.get_valid_pos MiTLS.Parsers.ServerDHParams_dh_Ys.serverDHParams_dh_Ys_parser
                  h
                  input
                  pos2
              in
              Prims.l_True))))
      (ensures
        (let dh_p =
            LowParse.Low.Base.Spec.contents MiTLS.Parsers.ServerDHParams_dh_p.serverDHParams_dh_p_parser
              h
              input
              pos0
          in
          let pos1 =
            LowParse.Low.Base.Spec.get_valid_pos MiTLS.Parsers.ServerDHParams_dh_p.serverDHParams_dh_p_parser
              h
              input
              pos0
          in
          let dh_g =
            LowParse.Low.Base.Spec.contents MiTLS.Parsers.ServerDHParams_dh_g.serverDHParams_dh_g_parser
              h
              input
              pos1
          in
          let pos2 =
            LowParse.Low.Base.Spec.get_valid_pos MiTLS.Parsers.ServerDHParams_dh_g.serverDHParams_dh_g_parser
              h
              input
              pos1
          in
          let dh_Ys =
            LowParse.Low.Base.Spec.contents MiTLS.Parsers.ServerDHParams_dh_Ys.serverDHParams_dh_Ys_parser
              h
              input
              pos2
          in
          let pos3 =
            LowParse.Low.Base.Spec.get_valid_pos MiTLS.Parsers.ServerDHParams_dh_Ys.serverDHParams_dh_Ys_parser
              h
              input
              pos2
          in
          LowParse.Low.Base.Spec.valid_content_pos MiTLS.Parsers.ServerDHParams.serverDHParams_parser
            h
            input
            pos0
            (MiTLS.Parsers.ServerDHParams.MkserverDHParams dh_p dh_g dh_Ys)
            pos3))
FStar.Monotonic.HyperStack.mem LowParse.Slice.srel LowParse.Bytes.byte LowParse.Slice.slice FStar.UInt32.t LowParse.Low.Combinators.valid_synth_intro LowParse.Spec.Combinators.and_then_kind MiTLS.Parsers.ServerDHParams_dh_p.serverDHParams_dh_p_parser_kind MiTLS.Parsers.ServerDHParams_dh_g.serverDHParams_dh_g_parser_kind MiTLS.Parsers.ServerDHParams_dh_Ys.serverDHParams_dh_Ys_parser_kind MiTLS.Parsers.ServerDHParams.serverDHParams' MiTLS.Parsers.ServerDHParams.serverDHParams MiTLS.Parsers.ServerDHParams.serverDHParams'_parser MiTLS.Parsers.ServerDHParams.synth_serverDHParams Prims.unit MiTLS.Parsers.ServerDHParams.synth_serverDHParams_injective FStar.Pervasives.assert_norm Prims.eq2 LowParse.Spec.Base.parser_kind MiTLS.Parsers.ServerDHParams.serverDHParams_parser_kind MiTLS.Parsers.ServerDHParams.serverDHParams'_parser_kind LowParse.Spec.Base.get_parser_type LowParse.Low.Combinators.valid_nondep_then_intro FStar.Pervasives.Native.tuple2 MiTLS.Parsers.ServerDHParams_dh_p.serverDHParams_dh_p MiTLS.Parsers.ServerDHParams_dh_g.serverDHParams_dh_g LowParse.Spec.Combinators.nondep_then MiTLS.Parsers.ServerDHParams_dh_p.serverDHParams_dh_p_parser MiTLS.Parsers.ServerDHParams_dh_g.serverDHParams_dh_g_parser MiTLS.Parsers.ServerDHParams_dh_Ys.serverDHParams_dh_Ys MiTLS.Parsers.ServerDHParams_dh_Ys.serverDHParams_dh_Ys_parser LowParse.Low.Base.Spec.get_valid_pos LowParse.Low.Base.Spec.contents
let serverDHParams_valid h #_ #_ input pos0 =
  
let dh_p = LL.contents serverDHParams_dh_p_parser h input pos0 in
let pos1 = LL.get_valid_pos serverDHParams_dh_p_parser h input pos0 in
let dh_g = LL.contents serverDHParams_dh_g_parser h input pos1 in
let pos2 = LL.get_valid_pos serverDHParams_dh_g_parser h input pos1 in
let dh_Ys = LL.contents serverDHParams_dh_Ys_parser h input pos2 in
let pos3 = LL.get_valid_pos serverDHParams_dh_Ys_parser h input pos2 in
LL.valid_nondep_then_intro h serverDHParams_dh_p_parser serverDHParams_dh_g_parser input pos0;
LL.valid_nondep_then_intro h
  (serverDHParams_dh_p_parser `LP.nondep_then` serverDHParams_dh_g_parser)
  serverDHParams_dh_Ys_parser
  input
  pos0;
assert_norm (serverDHParams' == LP.get_parser_type serverDHParams'_parser);
assert_norm (serverDHParams_parser_kind == serverDHParams'_parser_kind);
synth_serverDHParams_injective ();
LL.valid_synth_intro h serverDHParams'_parser synth_serverDHParams input pos0