|
UDIF: Universal Digital Identification Framework 1.0.0.0a (A1)
A quantum-secure cryptographic identification
|
UDIF object registry management. More...
Go to the source code of this file.
Data Structures | |
| struct | udif_merkle_node |
| Merkle proof node structure. More... | |
| struct | udif_registry_state |
| User Agent object registry. More... | |
Macros | |
| #define | UDIF_REGISTRY_DEFAULT_CAPACITY 1024U |
| Default registry capacity. | |
| #define | UDIF_REGISTRY_MAX_CAPACITY 1048576U |
| Maximum registry capacity. | |
Typedefs | |
| typedef UDIF_EXPORT_API struct udif_merkle_node | udif_merkle_node |
| typedef UDIF_EXPORT_API struct udif_registry_state | udif_registry_state |
UDIF object registry management.
This module implements Merkle tree-based registries for User Agents. Each User Agent maintains a registry of owned objects as a Merkle tree, allowing efficient membership proofs and tamper-evident commits.
Registry Operations:
The registry uses SHA3-256 for Merkle tree hashing with domain separation to prevent cross-context attacks.
| UDIF_EXPORT_API udif_errors udif_registry_add_object | ( | udif_registry_state * | reg, |
| const udif_object * | obj ) |
Add an object to the registry.
Adds an object's digest to the registry Merkle tree.
| reg | The registry state structure |
| obj | [const] The object to add |
| UDIF_EXPORT_API void udif_registry_clear | ( | udif_registry_state * | reg | ) |
Clear registry.
Removes all objects from the registry without freeing resources.
| reg | The registry state structure |
| UDIF_EXPORT_API udif_errors udif_registry_compute_root | ( | uint8_t * | root, |
| const udif_registry_state * | reg ) |
Compute registry Merkle root.
Computes the Merkle root of all objects in the registry.
| root | The output Merkle root (32 bytes) |
| reg | [const] The registry state structure |
| UDIF_EXPORT_API void udif_registry_dispose | ( | udif_registry_state * | reg | ) |
Dispose registry.
Frees all resources and clears the registry.
| reg | The registry state structure |
| UDIF_EXPORT_API bool udif_registry_find_object | ( | const udif_registry_state * | reg, |
| const uint8_t * | serial, | ||
| size_t * | index ) |
Find object in registry.
Searches for an object by serial number.
| reg | [const] The registry state structure |
| serial | [const] The object serial (16 bytes) |
| index | Pointer to receive the object index |
| UDIF_EXPORT_API udif_errors udif_registry_generate_proof | ( | uint8_t * | proof, |
| size_t * | prooflen, | ||
| const udif_registry_state * | reg, | ||
| const uint8_t * | serial ) |
Generate membership proof.
Generates a Merkle inclusion proof for an object in the registry.
| proof | The output proof buffer |
| prooflen | Pointer to proof length (in: buffer size, out: bytes written) |
| reg | [const] The registry state structure |
| serial | [const] The object serial (16 bytes) |
| UDIF_EXPORT_API size_t udif_registry_get_capacity | ( | const udif_registry_state * | reg | ) |
Get registry capacity.
Returns the current capacity of the registry.
| reg | [const] The registry state structure |
| UDIF_EXPORT_API size_t udif_registry_get_count | ( | const udif_registry_state * | reg | ) |
Get object count.
Returns the number of objects in the registry.
| reg | [const] The registry state structure |
| UDIF_EXPORT_API udif_errors udif_registry_get_digest_at | ( | uint8_t * | digest, |
| const udif_registry_state * | reg, | ||
| size_t | index ) |
Get object digest at index.
Retrieves the digest of an object at a specific index.
| digest | The output digest (32 bytes) |
| reg | [const] The registry state structure |
| index | The object index |
| UDIF_EXPORT_API udif_errors udif_registry_initialize | ( | udif_registry_state * | reg, |
| const uint8_t * | ownerser, | ||
| size_t | capacity ) |
Initialize a registry.
Creates an empty registry for a User Agent.
| reg | The registry state structure |
| ownerser | [const] The owner's serial number (16 bytes) |
| incapacity | The initial capacity (number of objects) |
| UDIF_EXPORT_API bool udif_registry_is_full | ( | const udif_registry_state * | reg | ) |
Check if registry is full.
Tests if the registry has reached capacity.
| reg | [const] The registry state structure |
| UDIF_EXPORT_API udif_errors udif_registry_remove_object | ( | udif_registry_state * | reg, |
| const uint8_t * | serial ) |
Remove an object from the registry.
Removes an object's digest from the registry.
| reg | The registry state structure |
| serial | [const] The object serial |
| UDIF_EXPORT_API udif_errors udif_registry_resize | ( | udif_registry_state * | reg, |
| size_t | newcapacity ) |
Resize registry.
Increases the registry capacity.
| reg | The registry state structure |
| newcapacity | The new capacity |
| UDIF_EXPORT_API udif_errors udif_registry_update_object | ( | udif_registry_state * | reg, |
| const udif_object * | obj ) |
Update an object in the registry.
Updates an object's digest in the registry.
| reg | The registry state structure |
| obj | [const] The updated object |
| UDIF_EXPORT_API bool udif_registry_verify_proof | ( | const uint8_t * | proof, |
| size_t | prooflen, | ||
| const uint8_t * | root, | ||
| const uint8_t * | objdigest ) |
Verify membership proof.
Verifies a Merkle inclusion proof against a registry root.
| proof | [const] The proof data |
| prooflen | The proof length |
| root | [const] The registry Merkle root (32 bytes) |
| object_digest | [const] The object digest (32 bytes) |