val gaccessor_raw_key_raw_key_significant_digits : LL.gaccessor raw_key_parser significant_digits_t_parser clens_raw_key_raw_key_significant_digits
val gaccessor_raw_key_raw_key_significant_digits : LL.gaccessor raw_key_parser significant_digits_t_parser clens_raw_key_raw_key_significant_digits
let gaccessor_raw_key_raw_key_significant_digits = LL.gaccessor_ext (gaccessor_raw_key_raw_key' `LL.gaccessor_compose` gaccessor'_raw_key_raw_key_significant_digits) clens_raw_key_raw_key_significant_digits ()
module Zeta.Formats.Aux.Raw_key

(* 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 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 raw_key' = (u256 & significant_digits_t)

inline_for_extraction let synth_raw_key (x: raw_key') : raw_key =
  match x with (raw_key_k,raw_key_significant_digits) -> {
    raw_key_k = raw_key_k;
    raw_key_significant_digits = raw_key_significant_digits;
  }

inline_for_extraction let synth_raw_key_recip (x: raw_key) : raw_key' = (x.raw_key_k,x.raw_key_significant_digits)

let synth_raw_key_recip_inverse () : Lemma (LP.synth_inverse synth_raw_key_recip synth_raw_key) = ()

let synth_raw_key_injective () : Lemma (LP.synth_injective synth_raw_key) =
  LP.synth_inverse_synth_injective synth_raw_key_recip synth_raw_key;
  synth_raw_key_recip_inverse ()

let synth_raw_key_inverse () : Lemma (LP.synth_inverse synth_raw_key synth_raw_key_recip) =
  assert_norm (LP.synth_inverse synth_raw_key synth_raw_key_recip)

let synth_raw_key_recip_injective () : Lemma (LP.synth_injective synth_raw_key_recip) =
  synth_raw_key_recip_inverse ();
  LP.synth_inverse_synth_injective synth_raw_key synth_raw_key_recip

noextract let raw_key'_parser : LP.parser _ raw_key' = (u256_parser `LP.nondep_then` significant_digits_t_parser)

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

let raw_key_parser =
  synth_raw_key_injective ();
  assert_norm (raw_key_parser_kind == raw_key'_parser_kind);
  raw_key'_parser `LP.parse_synth` synth_raw_key

noextract let raw_key'_serializer : LP.serializer raw_key'_parser = (u256_serializer `LP.serialize_nondep_then` significant_digits_t_serializer)

let raw_key_serializer =
  [@inline_let] let _ = synth_raw_key_injective () in
  [@inline_let] let _ = synth_raw_key_inverse () in
  [@inline_let] let _ = assert_norm (raw_key_parser_kind == raw_key'_parser_kind) in
  LP.serialize_synth _ synth_raw_key raw_key'_serializer synth_raw_key_recip ()

let raw_key_bytesize (x:raw_key) : GTot nat = Seq.length (raw_key_serializer x)

let raw_key_bytesize_eq x = ()

inline_for_extraction let raw_key'_size32 : LSZ.size32 raw_key'_serializer = (u256_size32 `LSZ.size32_nondep_then` significant_digits_t_size32)

let raw_key_size32 =
  [@inline_let] let _ = synth_raw_key_injective () in
  [@inline_let] let _ = synth_raw_key_inverse () in
  [@inline_let] let _ = assert_norm (raw_key_parser_kind == raw_key'_parser_kind) in
  LSZ.size32_synth _ synth_raw_key _ raw_key'_size32 synth_raw_key_recip (fun x -> synth_raw_key_recip x) ()

inline_for_extraction let raw_key'_validator : LL.validator raw_key'_parser = (u256_validator `LL.validate_nondep_then` significant_digits_t_validator)

let raw_key_validator =
  [@inline_let] let _ = synth_raw_key_injective () in
  [@inline_let] let _ = assert_norm (raw_key_parser_kind == raw_key'_parser_kind) in
  LL.validate_synth raw_key'_validator synth_raw_key ()

inline_for_extraction let raw_key'_reader : LL.leaf_reader raw_key'_parser = (LL.read_nondep_then u256_jumper u256_reader significant_digits_t_reader)

let raw_key_reader =
  [@inline_let] let _ = synth_raw_key_injective () in
  [@inline_let] let _ = assert_norm (raw_key_parser_kind == raw_key'_parser_kind) in
  LL.read_synth _ synth_raw_key (fun x -> synth_raw_key x) raw_key'_reader ()

inline_for_extraction let raw_key'_lserializer : LL.serializer32 raw_key'_serializer = (u256_lserializer `LL.serialize32_nondep_then` significant_digits_t_lserializer)

let raw_key_lserializer =
  [@inline_let] let _ = synth_raw_key_injective () in
  [@inline_let] let _ = synth_raw_key_inverse () in
  [@inline_let] let _ = assert_norm (raw_key_parser_kind == raw_key'_parser_kind) in
  LL.serialize32_synth raw_key'_lserializer synth_raw_key synth_raw_key_recip (fun x -> synth_raw_key_recip x) ()

let raw_key_bytesize_eqn x =
  [@inline_let] let _ = synth_raw_key_injective () in
  [@inline_let] let _ = synth_raw_key_inverse () in
  [@inline_let] let _ = assert_norm (raw_key_parser_kind == raw_key'_parser_kind) in
  LP.serialize_synth_eq _ synth_raw_key raw_key'_serializer synth_raw_key_recip () x;
LP.length_serialize_nondep_then u256_serializer significant_digits_t_serializer x.raw_key_k x.raw_key_significant_digits;
  (u256_bytesize_eq (x.raw_key_k));
  (significant_digits_t_bytesize_eq (x.raw_key_significant_digits));
  assert(raw_key_bytesize x == Seq.length (LP.serialize u256_serializer x.raw_key_k) + Seq.length (LP.serialize significant_digits_t_serializer x.raw_key_significant_digits))

let gaccessor'_raw_key_raw_key_k : LL.gaccessor raw_key'_parser u256_parser _ = (LL.gaccessor_then_fst (LL.gaccessor_id raw_key'_parser))

let gaccessor'_raw_key_raw_key_significant_digits : LL.gaccessor raw_key'_parser significant_digits_t_parser _ = (LL.gaccessor_then_snd (LL.gaccessor_id raw_key'_parser))

inline_for_extraction noextract let accessor'_raw_key_raw_key_k : LL.accessor gaccessor'_raw_key_raw_key_k = (LL.accessor_then_fst (LL.accessor_id raw_key'_parser))

inline_for_extraction noextract let accessor'_raw_key_raw_key_significant_digits : LL.accessor gaccessor'_raw_key_raw_key_significant_digits = (LL.accessor_then_snd (LL.accessor_id raw_key'_parser) u256_jumper)

noextract let clens_raw_key_raw_key' : LL.clens raw_key raw_key' = synth_raw_key_recip_inverse (); synth_raw_key_recip_injective (); LL.clens_synth synth_raw_key_recip synth_raw_key

let gaccessor_raw_key_raw_key' : LL.gaccessor raw_key_parser raw_key'_parser clens_raw_key_raw_key' = synth_raw_key_inverse (); synth_raw_key_injective (); synth_raw_key_recip_inverse (); LL.gaccessor_synth raw_key'_parser synth_raw_key synth_raw_key_recip ()

inline_for_extraction noextract let accessor_raw_key_raw_key' : LL.accessor gaccessor_raw_key_raw_key' = synth_raw_key_inverse (); synth_raw_key_injective (); synth_raw_key_recip_inverse (); LL.accessor_synth raw_key'_parser synth_raw_key synth_raw_key_recip ()

let gaccessor_raw_key_raw_key_k = LL.gaccessor_ext (gaccessor_raw_key_raw_key' `LL.gaccessor_compose` gaccessor'_raw_key_raw_key_k) clens_raw_key_raw_key_k ()

let accessor_raw_key_raw_key_k = LL.accessor_ext (LL.accessor_compose accessor_raw_key_raw_key' accessor'_raw_key_raw_key_k ()) clens_raw_key_raw_key_k ()
/
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.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
Zeta.Formats.Aux.Raw_key.fst
LowParse.Low.Base.Spec.gaccessor Zeta.Formats.Aux.Raw_key.raw_key_parser
  Zeta.Formats.Aux.Significant_digits_t.significant_digits_t_parser
  Zeta.Formats.Aux.Raw_key.clens_raw_key_raw_key_significant_digits
LowParse.Low.Base.Spec.gaccessor_ext Zeta.Formats.Aux.Raw_key.raw_key_parser_kind Zeta.Formats.Aux.Raw_key.raw_key Zeta.Formats.Aux.Raw_key.raw_key_parser Zeta.Formats.Aux.Significant_digits_t.significant_digits_t_parser_kind Zeta.Formats.Aux.Significant_digits_t.significant_digits_t Zeta.Formats.Aux.Significant_digits_t.significant_digits_t_parser LowParse.Low.Base.Spec.clens_compose Zeta.Formats.Aux.Raw_key.raw_key' Zeta.Formats.Aux.Raw_key.clens_raw_key_raw_key' FStar.Pervasives.Native.tuple2 Zeta.Formats.Aux.U256.u256 LowParse.Low.Base.Spec.clens_id LowParse.Low.Combinators.clens_snd LowParse.Low.Base.Spec.gaccessor_compose LowParse.Spec.Combinators.and_then_kind Zeta.Formats.Aux.U256.u256_parser_kind Zeta.Formats.Aux.Raw_key.raw_key'_parser Zeta.Formats.Aux.Raw_key.gaccessor_raw_key_raw_key' Zeta.Formats.Aux.Raw_key.gaccessor'_raw_key_raw_key_significant_digits Zeta.Formats.Aux.Raw_key.clens_raw_key_raw_key_significant_digits
let gaccessor_raw_key_raw_key_significant_digits =
  
LL.gaccessor_ext (gaccessor_raw_key_raw_key'
    `LL.gaccessor_compose`
    gaccessor'_raw_key_raw_key_significant_digits)
  clens_raw_key_raw_key_significant_digits
  ()