package ascon

  1. Overview
  2. Docs

Module Ascon.Xof128Source

The Ascon-XOF128 extendable-output function.

Sourcetype absorbing

An immutable state that accepts more message bytes.

Sourcetype squeezing

An immutable state that can only produce output.

Sourcetype length_error = [
  1. | `Invalid_length
]

Error returned when a requested byte length is invalid.

Sourceval init : unit -> absorbing

init () starts a new XOF computation.

Sourceval absorb : absorbing -> bytes -> absorbing

absorb state input returns a state containing input.

Sourceval start_squeezing : absorbing -> squeezing

Finalizes absorption. Its result cannot be passed to absorb.

Sourceval squeeze : squeezing -> length:int -> (squeezing * bytes, length_error) result

squeeze state ~length emits the next length bytes. Repeated calls concatenate to the same output as one longer call.

Sourceval digest : bytes -> length:int -> (bytes, length_error) result

One-shot XOF output. length must be positive, as required by SP 800-232.