val finalize_certificateAuthoritiesExtension (#rrel: _) (#rel: _) (sl: LL.slice rrel rel) (pos pos' : U32.t) : HST.Stack unit
(requires (fun h ->
  U32.v pos + 2 < 4294967296 /\
  LL.writable sl.LL.base (U32.v pos) (U32.v pos + 2) h /\
  LL.valid_list distinguishedName_parser h sl (pos `U32.add` 2ul) pos' /\ (
  let len = U32.v pos' - (U32.v pos + 2) in
  let len_ser = certificateAuthoritiesExtension_list_bytesize (LL.contents_list distinguishedName_parser h sl (pos `U32.add` 2ul) pos') in
  ((3 <= len /\ len <= 65535) \/ (3 <= len_ser /\ len_ser <= 65535))
)))
(ensures (fun h _ h' ->
  B.modifies (LL.loc_slice_from_to sl pos (pos `U32.add` 2ul)) h h' /\ (
  let l = LL.contents_list distinguishedName_parser h sl (pos `U32.add` 2ul) pos' in
  certificateAuthoritiesExtension_list_bytesize l == U32.v pos' - (U32.v pos + 2) /\
  LL.valid_content_pos certificateAuthoritiesExtension_parser h' sl pos l pos'
)))
val finalize_certificateAuthoritiesExtension (#rrel: _) (#rel: _) (sl: LL.slice rrel rel) (pos pos' : U32.t) : HST.Stack unit
(requires (fun h ->
  U32.v pos + 2 < 4294967296 /\
  LL.writable sl.LL.base (U32.v pos) (U32.v pos + 2) h /\
  LL.valid_list distinguishedName_parser h sl (pos `U32.add` 2ul) pos' /\ (
  let len = U32.v pos' - (U32.v pos + 2) in
  let len_ser = certificateAuthoritiesExtension_list_bytesize (LL.contents_list distinguishedName_parser h sl (pos `U32.add` 2ul) pos') in
  ((3 <= len /\ len <= 65535) \/ (3 <= len_ser /\ len_ser <= 65535))
)))
(ensures (fun h _ h' ->
  B.modifies (LL.loc_slice_from_to sl pos (pos `U32.add` 2ul)) h h' /\ (
  let l = LL.contents_list distinguishedName_parser h sl (pos `U32.add` 2ul) pos' in
  certificateAuthoritiesExtension_list_bytesize l == U32.v pos' - (U32.v pos + 2) /\
  LL.valid_content_pos certificateAuthoritiesExtension_parser h' sl pos l pos'
)))
let finalize_certificateAuthoritiesExtension #_ #_ sl pos pos' =
  LL.finalize_bounded_vldata_strong_list 3 65535 distinguishedName_serializer sl pos pos';
  let h = HST.get () in
  LL.valid_synth h certificateAuthoritiesExtension'_parser synth_certificateAuthoritiesExtension sl pos
module MiTLS.Parsers.CertificateAuthoritiesExtension

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

let certificateAuthoritiesExtension_list_bytesize x = Seq.length (LP.serialize (LP.serialize_list _ distinguishedName_serializer) x)

let certificateAuthoritiesExtension_list_bytesize_nil = LP.serialize_list_nil distinguishedName_parser distinguishedName_serializer

let certificateAuthoritiesExtension_list_bytesize_cons x y = LP.serialize_list_cons distinguishedName_parser distinguishedName_serializer x y; (distinguishedName_bytesize_eq (x))

let certificateAuthoritiesExtension_list_bytesize_eq l = LL.serialized_list_length_eq_length_serialize_list distinguishedName_serializer l

let check_certificateAuthoritiesExtension_list_bytesize l =
  let x = LSZ.size32_list distinguishedName_size32 () l in
  3ul `U32.lte` x && x `U32.lte` 65535ul

type certificateAuthoritiesExtension' = LP.parse_bounded_vldata_strong_t 3 65535 (LP.serialize_list _ distinguishedName_serializer)

inline_for_extraction let synth_certificateAuthoritiesExtension (x: certificateAuthoritiesExtension') : Tot certificateAuthoritiesExtension = x

inline_for_extraction let synth_certificateAuthoritiesExtension_recip (x: certificateAuthoritiesExtension) : Tot certificateAuthoritiesExtension' = x

noextract let certificateAuthoritiesExtension'_parser : LP.parser _ certificateAuthoritiesExtension' =
  LP.parse_bounded_vldata_strong 3 65535 (LP.serialize_list _ distinguishedName_serializer)

let certificateAuthoritiesExtension_parser = certificateAuthoritiesExtension'_parser `LP.parse_synth` synth_certificateAuthoritiesExtension 

noextract let certificateAuthoritiesExtension'_serializer : LP.serializer certificateAuthoritiesExtension'_parser =
  LP.serialize_bounded_vldata_strong 3 65535 (LP.serialize_list _ distinguishedName_serializer)

let certificateAuthoritiesExtension_serializer = LP.serialize_synth _ synth_certificateAuthoritiesExtension certificateAuthoritiesExtension'_serializer synth_certificateAuthoritiesExtension_recip ()

let certificateAuthoritiesExtension_bytesize (x:certificateAuthoritiesExtension) : GTot nat = Seq.length (certificateAuthoritiesExtension_serializer x)

let certificateAuthoritiesExtension_bytesize_eq x = ()

inline_for_extraction noextract let certificateAuthoritiesExtension'_parser32 : LS.parser32 certificateAuthoritiesExtension'_parser =
  LS.parse32_bounded_vldata_strong 3 3ul 65535 65535ul (LP.serialize_list _ distinguishedName_serializer) (LS.parse32_list distinguishedName_parser32)

let certificateAuthoritiesExtension_parser32 = LS.parse32_synth' _ synth_certificateAuthoritiesExtension certificateAuthoritiesExtension'_parser32 ()

inline_for_extraction noextract let certificateAuthoritiesExtension'_serializer32 : LS.serializer32 certificateAuthoritiesExtension'_serializer =
  LS.serialize32_bounded_vldata_strong 3 65535 (LS.partial_serialize32_list _ distinguishedName_serializer distinguishedName_serializer32 ())

let certificateAuthoritiesExtension_serializer32 = LS.serialize32_synth' _ synth_certificateAuthoritiesExtension _ certificateAuthoritiesExtension'_serializer32 synth_certificateAuthoritiesExtension_recip ()

inline_for_extraction noextract let certificateAuthoritiesExtension'_size32 : LSZ.size32 certificateAuthoritiesExtension'_serializer =
  LSZ.size32_bounded_vldata_strong 3 65535 (LSZ.size32_list distinguishedName_size32 ()) 2ul

let certificateAuthoritiesExtension_size32 = LSZ.size32_synth' _ synth_certificateAuthoritiesExtension _ certificateAuthoritiesExtension'_size32 synth_certificateAuthoritiesExtension_recip ()

inline_for_extraction let certificateAuthoritiesExtension'_validator : LL.validator certificateAuthoritiesExtension'_parser =
  LL.validate_bounded_vldata_strong 3 65535 (LP.serialize_list _ distinguishedName_serializer) (LL.validate_list distinguishedName_validator ()) ()

let certificateAuthoritiesExtension_validator = LL.validate_synth certificateAuthoritiesExtension'_validator synth_certificateAuthoritiesExtension ()

inline_for_extraction let certificateAuthoritiesExtension'_jumper : LL.jumper certificateAuthoritiesExtension'_parser =
  LL.jump_bounded_vldata_strong 3 65535 (LP.serialize_list _ distinguishedName_serializer) ()

let certificateAuthoritiesExtension_jumper = LL.jump_synth certificateAuthoritiesExtension'_jumper synth_certificateAuthoritiesExtension ()
/
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.Seq.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.CertificateAuthoritiesExtension.fst
sl: LowParse.Slice.slice rrel rel -> pos: FStar.UInt32.t -> pos': FStar.UInt32.t
  -> FStar.HyperStack.ST.Stack Prims.unit
LowParse.Slice.srel LowParse.Bytes.byte LowParse.Slice.slice FStar.UInt32.t LowParse.Low.Combinators.valid_synth LowParse.Spec.VLData.parse_bounded_vldata_strong_kind LowParse.Spec.BoundedInt.log256' LowParse.Spec.List.parse_list_kind MiTLS.Parsers.CertificateAuthoritiesExtension.certificateAuthoritiesExtension' MiTLS.Parsers.CertificateAuthoritiesExtension.certificateAuthoritiesExtension MiTLS.Parsers.CertificateAuthoritiesExtension.certificateAuthoritiesExtension'_parser MiTLS.Parsers.CertificateAuthoritiesExtension.synth_certificateAuthoritiesExtension Prims.unit FStar.Monotonic.HyperStack.mem FStar.HyperStack.ST.get LowParse.Low.Array.finalize_bounded_vldata_strong_list MiTLS.Parsers.DistinguishedName.distinguishedName_parser_kind MiTLS.Parsers.DistinguishedName.distinguishedName MiTLS.Parsers.DistinguishedName.distinguishedName_parser MiTLS.Parsers.DistinguishedName.distinguishedName_serializer
let finalize_certificateAuthoritiesExtension #_ #_ sl pos pos' =
  
LL.finalize_bounded_vldata_strong_list 3 65535 distinguishedName_serializer sl pos pos';
let h = HST.get () in
LL.valid_synth h
  certificateAuthoritiesExtension'_parser
  synth_certificateAuthoritiesExtension
  sl
  pos