Skip to content

IBlockModeOneShot

Bruce Wayne edited this page Oct 29, 2025 · 1 revision

Members

Property

  • BlockSize
    Block size in bytes.

Methods

  • int GetMaxByteCount(int inputLength)
    Returns the maximum number of bytes required in the output buffer for a given input length.

  • void Encrypt(in ReadOnlySpan<byte> iv, in ReadOnlySpan<byte> input, in Span<byte> output)
    Perform one-shot encryption using the supplied IV. The result is written into output. Callers must ensure output is large enough (use GetMaxByteCount to estimate).

  • void Decrypt(in ReadOnlySpan<byte> iv, in ReadOnlySpan<byte> input, in Span<byte> output)
    Perform one-shot decryption using the supplied IV. The result is written into output. Callers must ensure output is large enough.

Usage notes

  1. Verify BlockSize and iv length match the implementation requirements before calling.
  2. Use GetMaxByteCount to estimate the required output buffer size to avoid overflows.
  3. This interface is intended for single-call processing of complete data, e.g., XtsMode.

Data format extensions

KDF

Symmetric crypto

Clone this wiki locally