package noise

  1. Overview
  2. Docs

Module Noise.ErrorSource

Errors returned across all Noise API boundaries.

No Noise operation raises exceptions for protocol-level failures; every failure path returns an ('a, t) result.

Sourcetype t =
  1. | Decrypt_failed
    (*

    AEAD authentication tag did not match; the ciphertext is corrupt or the wrong key was used.

    *)
  2. | Nonce_exhausted
    (*

    The per-direction nonce counter has reached its maximum value (2^64 - 1).

    *)
  3. | Invalid_state of string
    (*

    An operation was called in the wrong phase, such as write_message after the handshake is complete, or transport before it has finished.

    *)
  4. | Bad_message_length of {
    1. max : int;
    2. got : int;
    }
    (*

    A message exceeds 65535 bytes.

    *)
  5. | Bad_psk of string
    (*

    The pre-shared keys do not match the pattern's PSK tokens, or one is not 32 bytes.

    *)
  6. | Unsupported_primitive of string
    (*

    The protocol name references an unimplemented DH function, cipher, or hash.

    *)
  7. | DH_error of string
    (*

    A Diffie-Hellman operation failed.

    *)
Sourceval pp : Format.formatter -> t -> unit

Pretty-printer, suitable for Format.printf "%a" Error.pp e.