IBlockModeOneShot - HMBSbige/CryptoBase GitHub Wiki

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.

  • void Dispose()

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.
⚠️ **GitHub.com Fallback** ⚠️