val accessor'_explicitChar2ECParams_curve:LL.accessor gaccessor'_explicitChar2ECParams_curve
val accessor'_explicitChar2ECParams_curve:LL.accessor gaccessor'_explicitChar2ECParams_curve
let accessor'_explicitChar2ECParams_curve : LL.accessor gaccessor'_explicitChar2ECParams_curve = (LL.accessor_then_fst (LL.accessor_then_snd (LL.accessor_then_fst (LL.accessor_id explicitChar2ECParams'_parser)) (LL.jump_u16 `LL.jump_nondep_then` char2Representation_jumper)))
module MiTLS.Parsers.ExplicitChar2ECParams

(* 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 order*)
open MiTLS.Parsers.ExplicitChar2ECParams_order

(* Type of field cofactor*)
open MiTLS.Parsers.ExplicitChar2ECParams_cofactor

type explicitChar2ECParams' = (((U16.t & char2Representation) & (eCCurve & eCPoint)) & (explicitChar2ECParams_order & explicitChar2ECParams_cofactor))

inline_for_extraction let synth_explicitChar2ECParams (x: explicitChar2ECParams') : explicitChar2ECParams =
  match x with (((m,repr),(curve,base)),(order,cofactor)) -> {
    m = m;
    repr = repr;
    curve = curve;
    base = base;
    order = order;
    cofactor = cofactor;
  }

inline_for_extraction let synth_explicitChar2ECParams_recip (x: explicitChar2ECParams) : explicitChar2ECParams' = (((x.m,x.repr),(x.curve,x.base)),(x.order,x.cofactor))

let synth_explicitChar2ECParams_recip_inverse () : Lemma (LP.synth_inverse synth_explicitChar2ECParams_recip synth_explicitChar2ECParams) = ()

let synth_explicitChar2ECParams_injective () : Lemma (LP.synth_injective synth_explicitChar2ECParams) =
  LP.synth_inverse_synth_injective synth_explicitChar2ECParams_recip synth_explicitChar2ECParams;
  synth_explicitChar2ECParams_recip_inverse ()

let synth_explicitChar2ECParams_inverse () : Lemma (LP.synth_inverse synth_explicitChar2ECParams synth_explicitChar2ECParams_recip) =
  assert_norm (LP.synth_inverse synth_explicitChar2ECParams synth_explicitChar2ECParams_recip)

let synth_explicitChar2ECParams_recip_injective () : Lemma (LP.synth_injective synth_explicitChar2ECParams_recip) =
  synth_explicitChar2ECParams_recip_inverse ();
  LP.synth_inverse_synth_injective synth_explicitChar2ECParams synth_explicitChar2ECParams_recip

noextract let explicitChar2ECParams'_parser : LP.parser _ explicitChar2ECParams' = (((LPI.parse_u16 `LP.nondep_then` char2Representation_parser) `LP.nondep_then` (eCCurve_parser `LP.nondep_then` eCPoint_parser)) `LP.nondep_then` (explicitChar2ECParams_order_parser `LP.nondep_then` explicitChar2ECParams_cofactor_parser))

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

let explicitChar2ECParams_parser =
  synth_explicitChar2ECParams_injective ();
  assert_norm (explicitChar2ECParams_parser_kind == explicitChar2ECParams'_parser_kind);
  explicitChar2ECParams'_parser `LP.parse_synth` synth_explicitChar2ECParams

noextract let explicitChar2ECParams'_serializer : LP.serializer explicitChar2ECParams'_parser = (((LPI.serialize_u16 `LP.serialize_nondep_then` char2Representation_serializer) `LP.serialize_nondep_then` (eCCurve_serializer `LP.serialize_nondep_then` eCPoint_serializer)) `LP.serialize_nondep_then` (explicitChar2ECParams_order_serializer `LP.serialize_nondep_then` explicitChar2ECParams_cofactor_serializer))

let explicitChar2ECParams_serializer =
  [@inline_let] let _ = synth_explicitChar2ECParams_injective () in
  [@inline_let] let _ = synth_explicitChar2ECParams_inverse () in
  [@inline_let] let _ = assert_norm (explicitChar2ECParams_parser_kind == explicitChar2ECParams'_parser_kind) in
  LP.serialize_synth _ synth_explicitChar2ECParams explicitChar2ECParams'_serializer synth_explicitChar2ECParams_recip ()

let explicitChar2ECParams_bytesize (x:explicitChar2ECParams) : GTot nat = Seq.length (explicitChar2ECParams_serializer x)

let explicitChar2ECParams_bytesize_eq x = ()

inline_for_extraction let explicitChar2ECParams'_parser32 : LS.parser32 explicitChar2ECParams'_parser = (((LS.parse32_u16 `LS.parse32_nondep_then` char2Representation_parser32) `LS.parse32_nondep_then` (eCCurve_parser32 `LS.parse32_nondep_then` eCPoint_parser32)) `LS.parse32_nondep_then` (explicitChar2ECParams_order_parser32 `LS.parse32_nondep_then` explicitChar2ECParams_cofactor_parser32))

let explicitChar2ECParams_parser32 =
  [@inline_let] let _ = synth_explicitChar2ECParams_injective () in
  [@inline_let] let _ = assert_norm (explicitChar2ECParams_parser_kind == explicitChar2ECParams'_parser_kind) in
  LS.parse32_synth _ synth_explicitChar2ECParams (fun x -> synth_explicitChar2ECParams x) explicitChar2ECParams'_parser32 ()

inline_for_extraction let explicitChar2ECParams'_serializer32 : LS.serializer32 explicitChar2ECParams'_serializer = (((LS.serialize32_u16 `LS.serialize32_nondep_then` char2Representation_serializer32) `LS.serialize32_nondep_then` (eCCurve_serializer32 `LS.serialize32_nondep_then` eCPoint_serializer32)) `LS.serialize32_nondep_then` (explicitChar2ECParams_order_serializer32 `LS.serialize32_nondep_then` explicitChar2ECParams_cofactor_serializer32))

let explicitChar2ECParams_serializer32 =
  [@inline_let] let _ = synth_explicitChar2ECParams_injective () in
  [@inline_let] let _ = synth_explicitChar2ECParams_inverse () in
  [@inline_let] let _ = assert_norm (explicitChar2ECParams_parser_kind == explicitChar2ECParams'_parser_kind) in
  LS.serialize32_synth _ synth_explicitChar2ECParams _ explicitChar2ECParams'_serializer32 synth_explicitChar2ECParams_recip (fun x -> synth_explicitChar2ECParams_recip x) ()

inline_for_extraction let explicitChar2ECParams'_size32 : LSZ.size32 explicitChar2ECParams'_serializer = (((LSZ.size32_u16 `LSZ.size32_nondep_then` char2Representation_size32) `LSZ.size32_nondep_then` (eCCurve_size32 `LSZ.size32_nondep_then` eCPoint_size32)) `LSZ.size32_nondep_then` (explicitChar2ECParams_order_size32 `LSZ.size32_nondep_then` explicitChar2ECParams_cofactor_size32))

let explicitChar2ECParams_size32 =
  [@inline_let] let _ = synth_explicitChar2ECParams_injective () in
  [@inline_let] let _ = synth_explicitChar2ECParams_inverse () in
  [@inline_let] let _ = assert_norm (explicitChar2ECParams_parser_kind == explicitChar2ECParams'_parser_kind) in
  LSZ.size32_synth _ synth_explicitChar2ECParams _ explicitChar2ECParams'_size32 synth_explicitChar2ECParams_recip (fun x -> synth_explicitChar2ECParams_recip x) ()

inline_for_extraction let explicitChar2ECParams'_validator : LL.validator explicitChar2ECParams'_parser = ((((LL.validate_u16 ()) `LL.validate_nondep_then` char2Representation_validator) `LL.validate_nondep_then` (eCCurve_validator `LL.validate_nondep_then` eCPoint_validator)) `LL.validate_nondep_then` (explicitChar2ECParams_order_validator `LL.validate_nondep_then` explicitChar2ECParams_cofactor_validator))

let explicitChar2ECParams_validator =
  [@inline_let] let _ = synth_explicitChar2ECParams_injective () in
  [@inline_let] let _ = assert_norm (explicitChar2ECParams_parser_kind == explicitChar2ECParams'_parser_kind) in
  LL.validate_synth explicitChar2ECParams'_validator synth_explicitChar2ECParams ()

inline_for_extraction let explicitChar2ECParams'_jumper : LL.jumper explicitChar2ECParams'_parser = (((LL.jump_u16 `LL.jump_nondep_then` char2Representation_jumper) `LL.jump_nondep_then` (eCCurve_jumper `LL.jump_nondep_then` eCPoint_jumper)) `LL.jump_nondep_then` (explicitChar2ECParams_order_jumper `LL.jump_nondep_then` explicitChar2ECParams_cofactor_jumper))

let explicitChar2ECParams_jumper =
  [@inline_let] let _ = synth_explicitChar2ECParams_injective () in
  [@inline_let] let _ = assert_norm (explicitChar2ECParams_parser_kind == explicitChar2ECParams'_parser_kind) in
  LL.jump_synth explicitChar2ECParams'_jumper synth_explicitChar2ECParams ()

let explicitChar2ECParams_bytesize_eqn x =
  [@inline_let] let _ = synth_explicitChar2ECParams_injective () in
  [@inline_let] let _ = synth_explicitChar2ECParams_inverse () in
  [@inline_let] let _ = assert_norm (explicitChar2ECParams_parser_kind == explicitChar2ECParams'_parser_kind) in
  LP.serialize_synth_eq _ synth_explicitChar2ECParams explicitChar2ECParams'_serializer synth_explicitChar2ECParams_recip () x;
LP.length_serialize_nondep_then LPI.serialize_u16 char2Representation_serializer x.m x.repr;
LP.length_serialize_nondep_then eCCurve_serializer eCPoint_serializer x.curve x.base;
LP.length_serialize_nondep_then (LPI.serialize_u16 `LP.serialize_nondep_then` char2Representation_serializer) (eCCurve_serializer `LP.serialize_nondep_then` eCPoint_serializer) (x.m, x.repr) (x.curve, x.base);
LP.length_serialize_nondep_then explicitChar2ECParams_order_serializer explicitChar2ECParams_cofactor_serializer x.order x.cofactor;
LP.length_serialize_nondep_then ((LPI.serialize_u16 `LP.serialize_nondep_then` char2Representation_serializer) `LP.serialize_nondep_then` (eCCurve_serializer `LP.serialize_nondep_then` eCPoint_serializer)) (explicitChar2ECParams_order_serializer `LP.serialize_nondep_then` explicitChar2ECParams_cofactor_serializer) ((x.m, x.repr), (x.curve, x.base)) (x.order, x.cofactor);
  (assert (FStar.Seq.length (LP.serialize LP.serialize_u16 (x.m)) == 2));
  (char2Representation_bytesize_eq (x.repr));
  (eCCurve_bytesize_eq (x.curve));
  (eCPoint_bytesize_eq (x.base));
  (explicitChar2ECParams_order_bytesize_eq (x.order));
  (explicitChar2ECParams_cofactor_bytesize_eq (x.cofactor));
  assert(explicitChar2ECParams_bytesize x == Seq.length (LP.serialize LPI.serialize_u16 x.m) + Seq.length (LP.serialize char2Representation_serializer x.repr) + Seq.length (LP.serialize eCCurve_serializer x.curve) + Seq.length (LP.serialize eCPoint_serializer x.base) + Seq.length (LP.serialize explicitChar2ECParams_order_serializer x.order) + Seq.length (LP.serialize explicitChar2ECParams_cofactor_serializer x.cofactor))

let gaccessor'_explicitChar2ECParams_m : LL.gaccessor explicitChar2ECParams'_parser LPI.parse_u16 _ = (LL.gaccessor_then_fst (LL.gaccessor_then_fst (LL.gaccessor_then_fst (LL.gaccessor_id explicitChar2ECParams'_parser))))

let gaccessor'_explicitChar2ECParams_repr : LL.gaccessor explicitChar2ECParams'_parser char2Representation_parser _ = (LL.gaccessor_then_snd (LL.gaccessor_then_fst (LL.gaccessor_then_fst (LL.gaccessor_id explicitChar2ECParams'_parser))))

let gaccessor'_explicitChar2ECParams_curve : LL.gaccessor explicitChar2ECParams'_parser eCCurve_parser _ = (LL.gaccessor_then_fst (LL.gaccessor_then_snd (LL.gaccessor_then_fst (LL.gaccessor_id explicitChar2ECParams'_parser))))

let gaccessor'_explicitChar2ECParams_base : LL.gaccessor explicitChar2ECParams'_parser eCPoint_parser _ = (LL.gaccessor_then_snd (LL.gaccessor_then_snd (LL.gaccessor_then_fst (LL.gaccessor_id explicitChar2ECParams'_parser))))

let gaccessor'_explicitChar2ECParams_order : LL.gaccessor explicitChar2ECParams'_parser explicitChar2ECParams_order_parser _ = (LL.gaccessor_then_fst (LL.gaccessor_then_snd (LL.gaccessor_id explicitChar2ECParams'_parser)))

let gaccessor'_explicitChar2ECParams_cofactor : LL.gaccessor explicitChar2ECParams'_parser explicitChar2ECParams_cofactor_parser _ = (LL.gaccessor_then_snd (LL.gaccessor_then_snd (LL.gaccessor_id explicitChar2ECParams'_parser)))

inline_for_extraction noextract let accessor'_explicitChar2ECParams_m : LL.accessor gaccessor'_explicitChar2ECParams_m = (LL.accessor_then_fst (LL.accessor_then_fst (LL.accessor_then_fst (LL.accessor_id explicitChar2ECParams'_parser))))

inline_for_extraction noextract let accessor'_explicitChar2ECParams_repr : LL.accessor gaccessor'_explicitChar2ECParams_repr = (LL.accessor_then_snd (LL.accessor_then_fst (LL.accessor_then_fst (LL.accessor_id explicitChar2ECParams'_parser))) LL.jump_u16)
/
prims.fst.checked MiTLS.Parsers.ExplicitChar2ECParams_order.fsti.checked MiTLS.Parsers.ExplicitChar2ECParams_cofactor.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.ExplicitChar2ECParams.fst
LowParse.Low.Base.accessor MiTLS.Parsers.ExplicitChar2ECParams.gaccessor'_explicitChar2ECParams_curve

LowParse.Low.Combinators.accessor_then_fst LowParse.Spec.Combinators.and_then_kind LowParse.Spec.Int.parse_u16_kind MiTLS.Parsers.Char2Representation.char2Representation_parser_kind MiTLS.Parsers.ECCurve.eCCurve_parser_kind MiTLS.Parsers.ECPoint.eCPoint_parser_kind MiTLS.Parsers.ExplicitChar2ECParams_order.explicitChar2ECParams_order_parser_kind MiTLS.Parsers.ExplicitChar2ECParams_cofactor.explicitChar2ECParams_cofactor_parser_kind MiTLS.Parsers.ExplicitChar2ECParams.explicitChar2ECParams' MiTLS.Parsers.ExplicitChar2ECParams.explicitChar2ECParams'_parser MiTLS.Parsers.ECCurve.eCCurve MiTLS.Parsers.ECCurve.eCCurve_parser MiTLS.Parsers.ECPoint.eCPoint MiTLS.Parsers.ECPoint.eCPoint_parser LowParse.Low.Base.Spec.clens_compose FStar.Pervasives.Native.tuple2 FStar.UInt16.t MiTLS.Parsers.Char2Representation.char2Representation MiTLS.Parsers.ExplicitChar2ECParams_order.explicitChar2ECParams_order MiTLS.Parsers.ExplicitChar2ECParams_cofactor.explicitChar2ECParams_cofactor LowParse.Low.Base.Spec.clens_id LowParse.Low.Combinators.clens_fst LowParse.Low.Combinators.clens_snd LowParse.Low.Combinators.gaccessor_then_snd LowParse.Spec.Combinators.nondep_then LowParse.Spec.Int.parse_u16 MiTLS.Parsers.Char2Representation.char2Representation_parser LowParse.Low.Combinators.gaccessor_then_fst MiTLS.Parsers.ExplicitChar2ECParams_order.explicitChar2ECParams_order_parser MiTLS.Parsers.ExplicitChar2ECParams_cofactor.explicitChar2ECParams_cofactor_parser LowParse.Low.Base.Spec.gaccessor_id LowParse.Low.Combinators.accessor_then_snd LowParse.Low.Base.accessor_id LowParse.Low.Combinators.jump_nondep_then LowParse.Low.Int.jump_u16 MiTLS.Parsers.Char2Representation.char2Representation_jumper
let accessor'_explicitChar2ECParams_curve:LL.accessor gaccessor'_explicitChar2ECParams_curve =
  
(LL.accessor_then_fst (LL.accessor_then_snd (LL.accessor_then_fst (LL.accessor_id explicitChar2ECParams'_parser
              ))
        (LL.jump_u16 `LL.jump_nondep_then` char2Representation_jumper)))