val wkey: #i:unsafe_id -> w:aead_writer i -> Tot (Spec.kv (wgetinfo w).alg)
let wkey #i w =
  snd (w <: unsafe_writer i)
val wkey: #i:unsafe_id -> w:aead_writer i -> Tot (Spec.kv (wgetinfo w).alg)
let wkey #i w =
snd (w <: unsafe_writer i)
Model.AEAD.fst.checked
Spec.Agile.AEAD.fsti.checked QUIC.Spec.fsti.checked prims.fst.checked Model.Indexing.fsti.checked Model.Helpers.fsti.checked Mem.fst.checked LowStar.BufferOps.fst.checked LowStar.Buffer.fst.checked FStar.UInt32.fsti.checked FStar.UInt128.fsti.checked FStar.Seq.fst.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked FStar.HyperStack.fst.checked
Model.AEAD.fst
Model.AEAD.unsafe_id Model.AEAD.aead_writer FStar.Pervasives.Native.snd Model.AEAD.info Spec.Agile.AEAD.kv Model.Indexing.ae_id_ginfo Model.AEAD.unsafe_writer Model.AEAD.__proj__Mkinfo'__item__alg Model.AEAD.wgetinfo
module Model.AEAD

module HS = FStar.HyperStack
module I = Model.Indexing
module U32 = FStar.UInt32
module U128 = FStar.UInt128
module B = LowStar.Buffer
module Spec = Spec.Agile.AEAD

#set-options "--fuel 0 --ifuel 0"

open Mem
open LowStar.BufferOps
open Model.Helpers

let log #i (u: info i): Type0 =
  Seq.seq (entry i u)

let model_writer i: Type u#1 =
  u:info i & B.pointer (log #i u)

let unsafe_writer i =
  info i & Spec.kv (I.ae_id_ginfo i)

let aead_writer (i: id): Type u#1 =
  if is_safe i then
    model_writer i
  else
    unsafe_writer i

let aead_reader #i (w: aead_writer i) =
  w':aead_writer i { w' == w }

let wgetinfo #i (u: aead_writer i) =
  if is_safe i then
    dfst (u <: model_writer i)
  else
    fst (u <: unsafe_writer i)

let rgetinfo #_ #w _ =
  wgetinfo w

let wlog #i w h =
  B.deref h (dsnd (w <: model_writer i))
val wkey: #i:unsafe_id -> w:aead_writer i -> Tot (Spec.kv (wgetinfo w).alg)
w: Model.AEAD.aead_writer i -> Spec.Agile.AEAD.kv (Mkinfo'?.alg (Model.AEAD.wgetinfo w))