let footprint (#a:alg) (m: HS.mem) (s: state a) =
  B.(loc_union (loc_addr_of_buffer s) (footprint_s (B.deref m s)))
let footprint (#a: alg) (m: HS.mem) (s: state a) =
let open B in loc_union (loc_addr_of_buffer s) (footprint_s (B.deref m s))
NotEverCrypt.CTR.fsti.checked
Spec.Loops.fst.checked Spec.Agile.CTR.fst.checked prims.fst.checked LowStar.Buffer.fst.checked Lib.IntTypes.fsti.checked FStar.UInt32.fsti.checked FStar.Pervasives.fsti.checked FStar.HyperStack.ST.fsti.checked FStar.HyperStack.fst.checked FStar.Ghost.fsti.checked EverCrypt.Error.fsti.checked
NotEverCrypt.CTR.fsti
NotEverCrypt.CTR.alg FStar.Monotonic.HyperStack.mem NotEverCrypt.CTR.state LowStar.Monotonic.Buffer.loc_union LowStar.Monotonic.Buffer.loc_addr_of_buffer NotEverCrypt.CTR.state_s LowStar.Buffer.trivial_preorder NotEverCrypt.CTR.footprint_s LowStar.Monotonic.Buffer.deref LowStar.Monotonic.Buffer.loc
module NotEverCrypt.CTR

module ST = FStar.HyperStack.ST
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost

module Spec = Spec.Agile.CTR

open FStar.HyperStack.ST
open EverCrypt.Error

unfold noextract
let alg = Spec.cipher_alg

/// Classic boilerplate
/// -------------------

[@CAbstractStruct]
val state_s: alg -> Type0

let state alg = B.pointer (state_s alg)

inline_for_extraction noextract
val freeable_s: #(a: alg) -> state_s a -> Type0

inline_for_extraction noextract
let freeable (#a: alg) (h: HS.mem) (p: state a) =
  B.freeable p /\ freeable_s (B.deref h p)

inline_for_extraction noextract
let preserves_freeable #a (s: state a) (h0 h1: HS.mem): Type0 =
  freeable h0 s ==> freeable h1 s

val footprint_s: #a:alg -> state_s a -> GTot B.loc
val footprint : m: FStar.Monotonic.HyperStack.mem -> s: NotEverCrypt.CTR.state a
  -> Prims.GTot LowStar.Monotonic.Buffer.loc
m: FStar.Monotonic.HyperStack.mem -> s: NotEverCrypt.CTR.state a
  -> Prims.GTot LowStar.Monotonic.Buffer.loc