Skip to main content

TE_CSTRING_BUFFER

#include <teagent_c.h>

A caller-owned byte buffer described by its length AND its capacity.

One descriptor per string, for both directions. The caller sets data, input_len and capacity; the call sets output_len and never reads it on entry.

  • data storage owned by the caller. Never freed or reallocated by the SDK.
  • input_len how many bytes at data may be READ, EXCLUDING any terminator. On a pure output descriptor this is zero.
  • capacity how many bytes at data may be WRITTEN, including the room for the NUL the SDK always writes. Zero is never valid.

input_len and capacity are INDEPENDENT extents, and neither has to bound the other: decryption reads a ciphertext that is always longer than the plaintext it writes back. A caller making the ordinary in-place call sets capacity to the real size of the buffer and input_len to the bytes already in it.

  • output_len on success, the bytes written excluding the NUL. On TE_INSUFFICIENT_BUFFER_SIZE, the capacity that WOULD have been required, including the NUL — so a caller can size a retry from it.

© Pi Soft, 2018-2026 · Tricryption Engine 8.1

Public Attributes

TypeNameDescription
unsigned char *data
uint32_tinput_len
uint32_tcapacity
uint32_toutput_len

Examples