val to_clientKeyExchange_case_of_keyExchangeAlgorithm
      (x #x': keyExchangeAlgorithm)
      (y: clientKeyExchange_case_of_keyExchangeAlgorithm x')
    : Pure
      (norm [delta_only [(`%clientKeyExchange_case_of_keyExchangeAlgorithm)]; iota]
          (clientKeyExchange_case_of_keyExchangeAlgorithm x))
      (requires (x == x'))
      (ensures (fun y' -> y' == y))
val to_clientKeyExchange_case_of_keyExchangeAlgorithm
      (x #x': keyExchangeAlgorithm)
      (y: clientKeyExchange_case_of_keyExchangeAlgorithm x')
    : Pure
      (norm [delta_only [(`%clientKeyExchange_case_of_keyExchangeAlgorithm)]; iota]
          (clientKeyExchange_case_of_keyExchangeAlgorithm x))
      (requires (x == x'))
      (ensures (fun y' -> y' == y))
let to_clientKeyExchange_case_of_keyExchangeAlgorithm (x:keyExchangeAlgorithm) (#x':keyExchangeAlgorithm) (y:clientKeyExchange_case_of_keyExchangeAlgorithm x')  : Pure (norm [delta_only [(`%clientKeyExchange_case_of_keyExchangeAlgorithm)]; iota] (clientKeyExchange_case_of_keyExchangeAlgorithm x))
  (requires (x == x')) (ensures (fun y' -> y' == y)) =
  [@inline_let] let _ = norm_spec [delta_only [(`%clientKeyExchange_case_of_keyExchangeAlgorithm)] ; iota] (clientKeyExchange_case_of_keyExchangeAlgorithm x) in y
module MiTLS.Parsers.ClientKeyExchange

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

friend MiTLS.Parsers.KeyExchangeAlgorithm

// Need high Z3 limits for large sum types
#set-options "--z3rlimit 240"

inline_for_extraction unfold let keyExchangeAlgorithm_as_enum_key (x:keyExchangeAlgorithm) : Pure (LP.enum_key keyExchangeAlgorithm_enum)
  (requires norm [delta; zeta; iota; primops] (LP.list_mem x (LP.list_map fst keyExchangeAlgorithm_enum)) == true) (ensures fun _ -> True) =
  [@inline_let] let _ = norm_spec [delta; zeta; iota; primops] (LP.list_mem x (LP.list_map fst keyExchangeAlgorithm_enum)) in x

inline_for_extraction let key_of_clientKeyExchange (x:clientKeyExchange') : LP.enum_key keyExchangeAlgorithm_enum =
  match x with
  | Cke_rsa _ -> keyExchangeAlgorithm_as_enum_key Rsa
  | Cke_dhe _ -> keyExchangeAlgorithm_as_enum_key Dhe
  | Cke_ecdhe _ -> keyExchangeAlgorithm_as_enum_key Ecdhe
  | Cke_dh_anon _ -> keyExchangeAlgorithm_as_enum_key Dh_anon

inline_for_extraction let clientKeyExchange_case_of_keyExchangeAlgorithm (x:keyExchangeAlgorithm) : Type0 =
  match x with
  | Rsa -> encryptedPreMasterSecret
  | Dhe -> clientDiffieHellmanPublic
  | Ecdhe -> clientECDiffieHellmanPublic
  | Dh_anon -> clientDiffieHellmanPublic
/
prims.fst.checked MiTLS.Parsers.KeyExchangeAlgorithm.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.Tactics.Effect.fsti.checked FStar.Tactics.fst.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.ClientKeyExchange.fst

    x: MiTLS.Parsers.KeyExchangeAlgorithm.keyExchangeAlgorithm ->
    y: MiTLS.Parsers.ClientKeyExchange.clientKeyExchange_case_of_keyExchangeAlgorithm x'
  -> Prims.Pure
    (FStar.Pervasives.norm [
          FStar.Pervasives.delta_only [
              "MiTLS.Parsers.ClientKeyExchange.clientKeyExchange_case_of_keyExchangeAlgorithm"
            ];
          FStar.Pervasives.iota
        ]
        (MiTLS.Parsers.ClientKeyExchange.clientKeyExchange_case_of_keyExchangeAlgorithm x))
MiTLS.Parsers.KeyExchangeAlgorithm.keyExchangeAlgorithm MiTLS.Parsers.ClientKeyExchange.clientKeyExchange_case_of_keyExchangeAlgorithm Prims.unit FStar.Pervasives.norm_spec Prims.Cons FStar.Pervasives.norm_step FStar.Pervasives.delta_only Prims.string Prims.Nil FStar.Pervasives.iota FStar.Pervasives.norm Prims.eq2 MiTLS.Parsers.EncryptedPreMasterSecret.encryptedPreMasterSecret MiTLS.Parsers.ClientDiffieHellmanPublic.clientDiffieHellmanPublic MiTLS.Parsers.ClientECDiffieHellmanPublic.clientECDiffieHellmanPublic
let to_clientKeyExchange_case_of_keyExchangeAlgorithm
      (x #x': keyExchangeAlgorithm)
      (y: clientKeyExchange_case_of_keyExchangeAlgorithm x')
    : Pure
      (norm [delta_only [(`%clientKeyExchange_case_of_keyExchangeAlgorithm)]; iota]
          (clientKeyExchange_case_of_keyExchangeAlgorithm x))
      (requires (x == x'))
      (ensures (fun y' -> y' == y)) =
  
[@@ inline_let ]let _ =
  norm_spec [delta_only [(`%clientKeyExchange_case_of_keyExchangeAlgorithm)]; iota]
    (clientKeyExchange_case_of_keyExchangeAlgorithm x)
in
y