val eCCurve_bytesize_eqn (x: eCCurve) : Lemma (eCCurve_bytesize x == (eCCurve_a_bytesize (x.a)) + (eCCurve_b_bytesize (x.b))) [SMTPat (eCCurve_bytesize x)]
val eCCurve_bytesize_eqn (x: eCCurve) : Lemma (eCCurve_bytesize x == (eCCurve_a_bytesize (x.a)) + (eCCurve_b_bytesize (x.b))) [SMTPat (eCCurve_bytesize x)]
let eCCurve_bytesize_eqn x =
  [@inline_let] let _ = synth_eCCurve_injective () in
  [@inline_let] let _ = synth_eCCurve_inverse () in
  [@inline_let] let _ = assert_norm (eCCurve_parser_kind == eCCurve'_parser_kind) in
  LP.serialize_synth_eq _ synth_eCCurve eCCurve'_serializer synth_eCCurve_recip () x;
LP.length_serialize_nondep_then eCCurve_a_serializer eCCurve_b_serializer x.a x.b;
  (eCCurve_a_bytesize_eq (x.a));
  (eCCurve_b_bytesize_eq (x.b));
  assert(eCCurve_bytesize x == Seq.length (LP.serialize eCCurve_a_serializer x.a) + Seq.length (LP.serialize eCCurve_b_serializer x.b))
module MiTLS.Parsers.ECCurve

(* 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 a*)
open MiTLS.Parsers.ECCurve_a

(* Type of field b*)
open MiTLS.Parsers.ECCurve_b

type eCCurve' = (eCCurve_a & eCCurve_b)

inline_for_extraction let synth_eCCurve (x: eCCurve') : eCCurve =
  match x with (a,b) -> {
    a = a;
    b = b;
  }

inline_for_extraction let synth_eCCurve_recip (x: eCCurve) : eCCurve' = (x.a,x.b)

let synth_eCCurve_recip_inverse () : Lemma (LP.synth_inverse synth_eCCurve_recip synth_eCCurve) = ()

let synth_eCCurve_injective () : Lemma (LP.synth_injective synth_eCCurve) =
  LP.synth_inverse_synth_injective synth_eCCurve_recip synth_eCCurve;
  synth_eCCurve_recip_inverse ()

let synth_eCCurve_inverse () : Lemma (LP.synth_inverse synth_eCCurve synth_eCCurve_recip) =
  assert_norm (LP.synth_inverse synth_eCCurve synth_eCCurve_recip)

let synth_eCCurve_recip_injective () : Lemma (LP.synth_injective synth_eCCurve_recip) =
  synth_eCCurve_recip_inverse ();
  LP.synth_inverse_synth_injective synth_eCCurve synth_eCCurve_recip

noextract let eCCurve'_parser : LP.parser _ eCCurve' = (eCCurve_a_parser `LP.nondep_then` eCCurve_b_parser)

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

let eCCurve_parser =
  synth_eCCurve_injective ();
  assert_norm (eCCurve_parser_kind == eCCurve'_parser_kind);
  eCCurve'_parser `LP.parse_synth` synth_eCCurve

noextract let eCCurve'_serializer : LP.serializer eCCurve'_parser = (eCCurve_a_serializer `LP.serialize_nondep_then` eCCurve_b_serializer)

let eCCurve_serializer =
  [@inline_let] let _ = synth_eCCurve_injective () in
  [@inline_let] let _ = synth_eCCurve_inverse () in
  [@inline_let] let _ = assert_norm (eCCurve_parser_kind == eCCurve'_parser_kind) in
  LP.serialize_synth _ synth_eCCurve eCCurve'_serializer synth_eCCurve_recip ()

let eCCurve_bytesize (x:eCCurve) : GTot nat = Seq.length (eCCurve_serializer x)

let eCCurve_bytesize_eq x = ()

inline_for_extraction let eCCurve'_parser32 : LS.parser32 eCCurve'_parser = (eCCurve_a_parser32 `LS.parse32_nondep_then` eCCurve_b_parser32)

let eCCurve_parser32 =
  [@inline_let] let _ = synth_eCCurve_injective () in
  [@inline_let] let _ = assert_norm (eCCurve_parser_kind == eCCurve'_parser_kind) in
  LS.parse32_synth _ synth_eCCurve (fun x -> synth_eCCurve x) eCCurve'_parser32 ()

inline_for_extraction let eCCurve'_serializer32 : LS.serializer32 eCCurve'_serializer = (eCCurve_a_serializer32 `LS.serialize32_nondep_then` eCCurve_b_serializer32)

let eCCurve_serializer32 =
  [@inline_let] let _ = synth_eCCurve_injective () in
  [@inline_let] let _ = synth_eCCurve_inverse () in
  [@inline_let] let _ = assert_norm (eCCurve_parser_kind == eCCurve'_parser_kind) in
  LS.serialize32_synth _ synth_eCCurve _ eCCurve'_serializer32 synth_eCCurve_recip (fun x -> synth_eCCurve_recip x) ()

inline_for_extraction let eCCurve'_size32 : LSZ.size32 eCCurve'_serializer = (eCCurve_a_size32 `LSZ.size32_nondep_then` eCCurve_b_size32)

let eCCurve_size32 =
  [@inline_let] let _ = synth_eCCurve_injective () in
  [@inline_let] let _ = synth_eCCurve_inverse () in
  [@inline_let] let _ = assert_norm (eCCurve_parser_kind == eCCurve'_parser_kind) in
  LSZ.size32_synth _ synth_eCCurve _ eCCurve'_size32 synth_eCCurve_recip (fun x -> synth_eCCurve_recip x) ()

inline_for_extraction let eCCurve'_validator : LL.validator eCCurve'_parser = (eCCurve_a_validator `LL.validate_nondep_then` eCCurve_b_validator)

let eCCurve_validator =
  [@inline_let] let _ = synth_eCCurve_injective () in
  [@inline_let] let _ = assert_norm (eCCurve_parser_kind == eCCurve'_parser_kind) in
  LL.validate_synth eCCurve'_validator synth_eCCurve ()

inline_for_extraction let eCCurve'_jumper : LL.jumper eCCurve'_parser = (eCCurve_a_jumper `LL.jump_nondep_then` eCCurve_b_jumper)

let eCCurve_jumper =
  [@inline_let] let _ = synth_eCCurve_injective () in
  [@inline_let] let _ = assert_norm (eCCurve_parser_kind == eCCurve'_parser_kind) in
  LL.jump_synth eCCurve'_jumper synth_eCCurve ()
/
prims.fst.checked MiTLS.Parsers.ECCurve_b.fsti.checked MiTLS.Parsers.ECCurve_a.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.ECCurve.fst
x: MiTLS.Parsers.ECCurve.eCCurve
  -> FStar.Pervasives.Lemma
      (ensures
        MiTLS.Parsers.ECCurve.eCCurve_bytesize x ==
        MiTLS.Parsers.ECCurve_a.eCCurve_a_bytesize (MkeCCurve?.a x) +
        MiTLS.Parsers.ECCurve_b.eCCurve_b_bytesize (MkeCCurve?.b x))
      [SMTPat (MiTLS.Parsers.ECCurve.eCCurve_bytesize x)]
MiTLS.Parsers.ECCurve.eCCurve Prims._assert Prims.eq2 Prims.int MiTLS.Parsers.ECCurve.eCCurve_bytesize Prims.op_Addition FStar.Seq.Base.length LowParse.Bytes.byte LowParse.Spec.Base.serialize MiTLS.Parsers.ECCurve_a.eCCurve_a_parser_kind MiTLS.Parsers.ECCurve_a.eCCurve_a MiTLS.Parsers.ECCurve_a.eCCurve_a_parser MiTLS.Parsers.ECCurve_a.eCCurve_a_serializer MiTLS.Parsers.ECCurve.__proj__MkeCCurve__item__a MiTLS.Parsers.ECCurve_b.eCCurve_b_parser_kind MiTLS.Parsers.ECCurve_b.eCCurve_b MiTLS.Parsers.ECCurve_b.eCCurve_b_parser MiTLS.Parsers.ECCurve_b.eCCurve_b_serializer MiTLS.Parsers.ECCurve.__proj__MkeCCurve__item__b Prims.unit MiTLS.Parsers.ECCurve_b.eCCurve_b_bytesize_eq MiTLS.Parsers.ECCurve_a.eCCurve_a_bytesize_eq LowParse.Spec.Combinators.length_serialize_nondep_then LowParse.Spec.Combinators.serialize_synth_eq LowParse.Spec.Combinators.and_then_kind MiTLS.Parsers.ECCurve.eCCurve' MiTLS.Parsers.ECCurve.eCCurve'_parser MiTLS.Parsers.ECCurve.synth_eCCurve MiTLS.Parsers.ECCurve.eCCurve'_serializer MiTLS.Parsers.ECCurve.synth_eCCurve_recip FStar.Pervasives.assert_norm LowParse.Spec.Base.parser_kind MiTLS.Parsers.ECCurve.eCCurve_parser_kind MiTLS.Parsers.ECCurve.eCCurve'_parser_kind MiTLS.Parsers.ECCurve.synth_eCCurve_inverse MiTLS.Parsers.ECCurve.synth_eCCurve_injective
let eCCurve_bytesize_eqn x =
  
[@@ inline_let ]let _ = synth_eCCurve_injective () in
[@@ inline_let ]let _ = synth_eCCurve_inverse () in
[@@ inline_let ]let _ = assert_norm (eCCurve_parser_kind == eCCurve'_parser_kind) in
LP.serialize_synth_eq _ synth_eCCurve eCCurve'_serializer synth_eCCurve_recip () x;
LP.length_serialize_nondep_then eCCurve_a_serializer eCCurve_b_serializer x.a x.b;
(eCCurve_a_bytesize_eq (x.a));
(eCCurve_b_bytesize_eq (x.b));
assert (eCCurve_bytesize x ==
    Seq.length (LP.serialize eCCurve_a_serializer x.a) +
    Seq.length (LP.serialize eCCurve_b_serializer x.b))