Swim.Crypto

swim · API reference

val nonce_size : int
val tag_size : int
val version_size : int
val encryption_version : int
val key_size : int
val overhead : int
type key = Mirage_crypto.AES.GCM.key
val init_key : 
  string ->
  (Mirage_crypto.AES.GCM.key, [> `Invalid_key_length ]) result
val generate_nonce : [> Eio.Flow.source_ty ] Eio.Flow.source -> string
val encrypt : 
  key:Mirage_crypto.AES.GCM.key ->
  random:[> Eio.Flow.source_ty ] Eio.Flow.source ->
  Cstruct.t ->
  Cstruct.t
val pkcs7_unpad : string -> int -> string
val decrypt : 
  key:Mirage_crypto.AES.GCM.key ->
  Cstruct.t ->
  (Cstruct.t, [> `Decryption_failed | `Too_short | `Unsupported_version ])
    result