Decibel.NonceError exception (decibel v1.0.1)

Copy Markdown View Source

Raised when a cipher nonce is exhausted, a caller supplies an invalid nonce, or an outbound nonce would move backwards.

The :reason field distinguishes an exhausted CipherState, an out-of-range value, and an outbound rewind. The :nonce field contains the offending value. For a rewind, :current_nonce contains the unchanged outbound nonce; it is nil for other reasons.

Summary

Types

The reason a nonce operation failed.

t()

Types

reason()

@type reason() :: :exhausted | :out_of_range | :rewind

The reason a nonce operation failed.

t()

@type t() :: %Decibel.NonceError{
  __exception__: true,
  current_nonce: non_neg_integer() | nil,
  message: String.t(),
  nonce: term(),
  reason: reason()
}