![]() |
Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
|
DEMO |
Classes | |
| struct | TlvField |
| Parsed TLV (tag-length-value) field from serialized metadata. More... | |
Functions | |
| void | write_le32 (uint8_t *dst, uint32_t val) |
| Write a 4-byte little-endian uint32 to dst. | |
| uint32_t | read_le32 (const uint8_t *src) |
| Read a 4-byte little-endian uint32 from src. | |
| void | append_tlv (std::vector< uint8_t > &buf, uint32_t tag, const uint8_t *data, uint32_t len) |
| Append a TLV field: [4-byte LE tag] [4-byte LE length] [data]. | |
| void | append_tlv_i32 (std::vector< uint8_t > &buf, uint32_t tag, int32_t val) |
| Append a TLV field containing a single int32_t (little-endian). | |
| void | append_tlv_u8 (std::vector< uint8_t > &buf, uint32_t tag, uint8_t val) |
| Append a TLV field containing a single byte. | |
| void | append_tlv_str (std::vector< uint8_t > &buf, uint32_t tag, const std::string &s) |
| Append a TLV field containing a string. | |
| void | append_tlv_blob (std::vector< uint8_t > &buf, uint32_t tag, const std::vector< uint8_t > &blob) |
| Append a TLV field containing a blob. | |
| bool | read_tlv (const uint8_t *buf, size_t buf_size, size_t &offset, TlvField &field) |
| Parse the next TLV field from a buffer. | |
| bool | tlv_to_i32 (const TlvField &field, int32_t &out) |
| Read an int32 from a TLV field's data (must be exactly 4 bytes). | |
| bool | tlv_to_u8 (const TlvField &field, uint8_t &out) |
| Read a uint8 from a TLV field's data (must be exactly 1 byte). | |
| std::string | tlv_to_str (const TlvField &field) |
| Read a string from a TLV field's data. | |
| std::vector< uint8_t > | tlv_to_blob (const TlvField &field) |
| Read a blob from a TLV field's data. | |
Variables | |
| constexpr uint32_t | MAX_TLV_LENGTH = 64u * 1024u * 1024u |
| Maximum TLV field length (64 MB cap to prevent memory exhaustion from malformed data). | |
| constexpr size_t | MAX_METADATA_SIZE = 1024 * 1024 |
| Maximum total metadata size (1 MB cap to prevent memory exhaustion from crafted payloads, CWE-770). | |
TLV tag constants for key metadata serialization. | |
| constexpr uint32_t | TAG_KEY_MODE = 0x0001 |
| Tag: key mode (4 bytes, int32_t LE). | |
| constexpr uint32_t | TAG_KEY_MATERIAL = 0x0002 |
| Tag: raw key material (variable blob). | |
| constexpr uint32_t | TAG_KEY_ID = 0x0003 |
| Tag: KMS key identifier (variable UTF-8). | |
| constexpr uint32_t | TAG_ALGORITHM = 0x0010 |
| Tag: encryption algorithm (4 bytes, int32_t LE). | |
| constexpr uint32_t | TAG_FOOTER_ENCRYPTED = 0x0011 |
| Tag: footer-encrypted flag (1 byte, 0/1). | |
| constexpr uint32_t | TAG_AAD_PREFIX = 0x0012 |
| Tag: AAD prefix string (variable UTF-8). | |
|
inline |
Append a TLV field: [4-byte LE tag] [4-byte LE length] [data].
Definition at line 261 of file key_metadata.hpp.
|
inline |
Append a TLV field containing a blob.
Definition at line 299 of file key_metadata.hpp.
|
inline |
Append a TLV field containing a single int32_t (little-endian).
Definition at line 274 of file key_metadata.hpp.
|
inline |
Append a TLV field containing a string.
Definition at line 288 of file key_metadata.hpp.
|
inline |
Append a TLV field containing a single byte.
Definition at line 282 of file key_metadata.hpp.
|
inline |
Read a 4-byte little-endian uint32 from src.
Definition at line 247 of file key_metadata.hpp.
|
inline |
Parse the next TLV field from a buffer.
On success, advances offset past the field and populates field.
| buf | Pointer to the serialized buffer. |
| buf_size | Total buffer size in bytes. |
| offset | Current read offset (updated on success). |
| field | Output field (populated on success). |
Definition at line 323 of file key_metadata.hpp.
|
inline |
Read a blob from a TLV field's data.
Definition at line 358 of file key_metadata.hpp.
|
inline |
Read an int32 from a TLV field's data (must be exactly 4 bytes).
Definition at line 339 of file key_metadata.hpp.
|
inline |
Read a string from a TLV field's data.
Definition at line 353 of file key_metadata.hpp.
|
inline |
Read a uint8 from a TLV field's data (must be exactly 1 byte).
Definition at line 346 of file key_metadata.hpp.
|
inline |
Write a 4-byte little-endian uint32 to dst.
Definition at line 239 of file key_metadata.hpp.
|
inlineconstexpr |
Maximum total metadata size (1 MB cap to prevent memory exhaustion from crafted payloads, CWE-770).
Definition at line 258 of file key_metadata.hpp.
|
inlineconstexpr |
Maximum TLV field length (64 MB cap to prevent memory exhaustion from malformed data).
Definition at line 255 of file key_metadata.hpp.
|
inlineconstexpr |
Tag: AAD prefix string (variable UTF-8).
Definition at line 369 of file key_metadata.hpp.
|
inlineconstexpr |
Tag: encryption algorithm (4 bytes, int32_t LE).
Definition at line 367 of file key_metadata.hpp.
|
inlineconstexpr |
Tag: footer-encrypted flag (1 byte, 0/1).
Definition at line 368 of file key_metadata.hpp.
|
inlineconstexpr |
Tag: KMS key identifier (variable UTF-8).
Definition at line 366 of file key_metadata.hpp.
|
inlineconstexpr |
Tag: raw key material (variable blob).
Definition at line 365 of file key_metadata.hpp.
|
inlineconstexpr |
Tag: key mode (4 bytes, int32_t LE).
Definition at line 364 of file key_metadata.hpp.