|
UDIF: Universal Digital Identification Framework 1.0.0.0a (A1)
A quantum-secure cryptographic identification
|
UDIF Common Definitions and Protocol Configuration. More...
#include "udifcommon.h"#include "sha3.h"#include "socketbase.h"#include "dilithium.h"#include "kyber.h"#include "rcs.h"Go to the source code of this file.
Data Structures | |
| struct | udif_capability_mask |
| Fixed-size capability bitset (issuer-/role-scoped). Capability bits; bit positions map to udif_capability_id. More... | |
| struct | udif_claim |
| A typed claim with deterministic canonical encoding. More... | |
| struct | udif_claim_anchor |
| Anchor (e.g., Merkle root) binding a claim set to an identity. Anchor/merkle root over canonical claim set. More... | |
| struct | udif_claim_set |
| A collection of claims bound to an identity by an anchor. More... | |
| struct | udif_encoded_blob |
| Generic encoded object buffer (for decode/encode APIs). More... | |
| struct | udif_identity_id |
| Subject identity identifier (opaque, canonicalized). Subject identifier bytes. More... | |
| struct | udif_issuer_domain_code |
| Issuer domain/controller identifier. Issuer domain code (ASCII or compact code) More... | |
| struct | udif_kem_keypair |
| KEM key pair. More... | |
| struct | udif_namespace_code |
| Namespace partition identifier. Namespace code (ASCII or compact code) More... | |
| struct | udif_permission_mask |
| Fixed-size permission bitset (subject-/resource-scoped). Permission bits; bit positions map to udif_permission_class. More... | |
| struct | udif_policy_hash |
| Policy identifier (hash of canonical policy). SHA3/SHAKE hash of policy document. More... | |
| struct | udif_signature_keypair |
| The UDIF asymmetric signature scheme key container. More... | |
| struct | udif_time_window |
| A validity interval expressed in UTC seconds. More... | |
| struct | udif_token_header |
| Common header for UDIF tokens (capability/attestation/session). More... | |
| struct | udif_token |
| Serialized token container with optional envelope protection. More... | |
| struct | udif_valid_time |
| The certificate expiration time structure. More... | |
| struct | udif_identity_record |
| Core identity record bound to a namespace and issuer. More... | |
Macros | |
| #define | UDIF_CONFIG_DILITHIUM_KYBER |
| #define | UDIF_USE_RCS_ENCRYPTION |
| If the RCS encryption option is chosen SKDP uses the more modern RCS stream cipher with KMAC/QMAC authentication. The default symmetric cipher/authenticator is AES-256/GCM (GMAC Counter Mode) NIST standardized per SP800-38a. | |
| #define | udif_cipher_state qsc_rcs_state |
| #define | udif_cipher_dispose qsc_rcs_dispose |
| #define | udif_cipher_initialize qsc_rcs_initialize |
| #define | udif_cipher_keyparams qsc_rcs_keyparams |
| #define | udif_cipher_set_associated qsc_rcs_set_associated |
| #define | udif_cipher_transform qsc_rcs_transform |
| #define | udif_cipher_generate_keypair qsc_kyber_generate_keypair |
| UDIF function mapping macros. | |
| #define | udif_cipher_decapsulate qsc_kyber_decapsulate |
| Decapsulate a shared-secret with the asymmetric cipher. | |
| #define | udif_cipher_encapsulate qsc_kyber_encapsulate |
| Encapsulate a shared-secret with the asymmetric cipher. | |
| #define | udif_signature_generate_keypair qsc_dilithium_generate_keypair |
| Generate an asymmetric signature key-pair. | |
| #define | udif_signature_sign qsc_dilithium_sign |
| Sign a message with the asymmetric signature scheme. | |
| #define | udif_signature_verify qsc_dilithium_verify |
| Verify a message with the asymmetric signature scheme. | |
| #define | UDIF_ASYMMETRIC_CIPHERTEXT_SIZE (QSC_KYBER_CIPHERTEXT_SIZE) |
| The byte size of the asymmetric cipher-text array. | |
| #define | UDIF_ASYMMETRIC_PRIVATE_KEY_SIZE (QSC_KYBER_PRIVATEKEY_SIZE) |
| The byte size of the asymmetric cipher private-key array. | |
| #define | UDIF_ASYMMETRIC_PUBLIC_KEY_SIZE (QSC_KYBER_PUBLICKEY_SIZE) |
| The byte size of the asymmetric cipher public-key array. | |
| #define | UDIF_ASYMMETRIC_SIGNATURE_SIZE (QSC_DILITHIUM_SIGNATURE_SIZE) |
| The byte size of the asymmetric signature array. | |
| #define | UDIF_ASYMMETRIC_SIGNING_KEY_SIZE (QSC_DILITHIUM_PRIVATEKEY_SIZE) |
| The byte size of the asymmetric signature signing-key array. | |
| #define | UDIF_ASYMMETRIC_VERIFICATION_KEY_SIZE (QSC_DILITHIUM_PUBLICKEY_SIZE) |
| The byte size of the asymmetric signature verification-key array. | |
| #define | UDIF_CAPABILITY_BITMAP_SIZE 8U |
| Capability bitmap size in bytes (64-bit) | |
| #define | UDIF_CAPABILITY_MASK_SIZE 8U |
| The size of a capability mask in hex characters. | |
| #define | UDIF_CAPABILITY_TOKEN_MAX_SIZE 2048U |
| The maximum size of a serialized capability token. | |
| #define | UDIF_CLAIM_ANCHOR_SIZE 32U |
| The size of a claim anchor or merkle root in bytes. | |
| #define | UDIF_CRYPTO_HASH_SIZE 32U |
| The size of the certificate hash in bytes. | |
| #define | UDIF_CRYPTO_KEY_SIZE 32U |
| The byte length of the symmetric cipher key. | |
| #define | UDIF_CRYPTO_MAC_SIZE 32U |
| The MAC function output byte size. | |
| #define | UDIF_CRYPTO_NONCE_SIZE 32U |
| The byte length of the symmetric cipher nonce. | |
| #define | UDIF_IDENTITY_ID_SIZE 32U |
| The size of a subject identity identifier in bytes. | |
| #define | UDIF_ISSUER_DOMAIN_CODE_SIZE 8U |
| The size of an issuer domain code (unique identifier). | |
| #define | UDIF_NAMESPACE_CODE_SIZE 8U |
| The size of a namespace code (short string or numeric). | |
| #define | UDIF_PERMISSION_MASK_SIZE 8U |
| The size of a permission mask in bytes. | |
| #define | UDIF_POLICY_HASH_SIZE 32U |
| The size of a policy identifier hash in bytes. | |
| #define | UDIF_POLICY_VERB_SIZE 4U |
| The size of a policy verb in bytes. | |
| #define | UDIF_PROTOCOL_SET_SIZE 41U |
| The size of the protocol configuration string. | |
| #define | UDIF_ROLE_SIZE 1U |
| The UDIF role parameter size. | |
| #define | UDIF_SERIAL_NUMBER_SIZE 16U |
| The serial number field length. | |
| #define | UDIF_SIGNED_HASH_SIZE (UDIF_ASYMMETRIC_SIGNATURE_SIZE + UDIF_CRYPTO_HASH_SIZE) |
| The combined size of a signature and hash. | |
| #define | UDIF_SUITEID_SIZE 1U |
| The UDIF suite id parameter size. | |
| #define | UDIF_TIME_WINDOW_SECONDS 60U |
| The query time window seconds. | |
| #define | UDIF_VALID_TIME_SIZE 8U |
| #define | UDIF_VALID_TIME_STRUCTURE_SIZE 16U |
| The certificate expiration date length. | |
Typedefs | |
| typedef UDIF_EXPORT_API enum udif_claim_type | udif_claim_type |
| typedef UDIF_EXPORT_API enum udif_configuration_sets | udif_configuration_sets |
| typedef UDIF_EXPORT_API enum udif_errors | udif_errors |
| typedef UDIF_EXPORT_API enum udif_error_capability | udif_error_capability |
| typedef UDIF_EXPORT_API enum udif_error_claims | udif_error_claims |
| typedef UDIF_EXPORT_API enum udif_error_encoding | udif_error_encoding |
| typedef UDIF_EXPORT_API enum udif_error_identity | udif_error_identity |
| typedef UDIF_EXPORT_API enum udif_error_policy | udif_error_policy |
| typedef UDIF_EXPORT_API enum udif_logging_event_codes | udif_logging_event_codes |
| typedef UDIF_EXPORT_API enum udif_permission_class | udif_permission_class |
| typedef UDIF_EXPORT_API enum udif_policy_decision | udif_policy_decision |
| typedef UDIF_EXPORT_API enum udif_roles | udif_roles |
| typedef UDIF_EXPORT_API enum udif_time_validation | udif_time_validation |
| typedef UDIF_EXPORT_API enum udif_token_type | udif_token_type |
| typedef UDIF_EXPORT_API enum udif_status | udif_status |
| typedef UDIF_EXPORT_API enum udif_verify_policy | udif_verify_policy |
| typedef UDIF_EXPORT_API enum udif_version_sets | udif_version_sets |
| typedef UDIF_EXPORT_API struct udif_capability_mask | udif_capability_mask |
| typedef UDIF_EXPORT_API struct udif_claim | udif_claim |
| typedef UDIF_EXPORT_API struct udif_claim_anchor | udif_claim_anchor |
| typedef UDIF_EXPORT_API struct udif_claim_set | udif_claim_set |
| typedef UDIF_EXPORT_API struct udif_encoded_blob | udif_encoded_blob |
| typedef UDIF_EXPORT_API struct udif_identity_id | udif_identity_id |
| typedef UDIF_EXPORT_API struct udif_issuer_domain_code | udif_issuer_domain_code |
| typedef UDIF_EXPORT_API struct udif_kem_keypair | udif_kem_keypair |
| typedef UDIF_EXPORT_API struct udif_namespace_code | udif_namespace_code |
| typedef UDIF_EXPORT_API struct udif_permission_mask | udif_permission_mask |
| typedef UDIF_EXPORT_API struct udif_policy_hash | udif_policy_hash |
| typedef UDIF_EXPORT_API struct udif_signature_keypair | udif_signature_keypair |
| typedef UDIF_EXPORT_API struct udif_time_window | udif_time_window |
| typedef UDIF_EXPORT_API struct udif_token_header | udif_token_header |
| typedef UDIF_EXPORT_API struct udif_token | udif_token |
| typedef UDIF_EXPORT_API struct udif_valid_time | udif_valid_time |
| typedef UDIF_EXPORT_API struct udif_identity_record | udif_identity_record |
Functions | |
| UDIF_EXPORT_API bool | udif_suite_is_valid (uint8_t suiteid) |
| Check if the suite id valid. | |
| UDIF_EXPORT_API const char * | udif_error_to_string (udif_errors error) |
| Convert an error to a string. | |
UDIF Common Definitions and Protocol Configuration.
This header defines the common constants, macros, enumerations, structures, and function prototypes for the Anonymous Encrypted Relay Network (UDIF). It provides configuration for the cryptographic parameter sets, certificate handling, network protocol operations, and socket communication required to implement the UDIF protocol.
The UDIF protocol leverages a combination of asymmetric cipher and signature schemes from the QSC library. The parameter sets can be configured in the QSC library's common.h file. For maximum security, the McEliece/SPHINCS+ parameter set is recommended; for a balance of performance and security, the Dilithium/Kyber parameter set is advised.
Key components defined in this header include:
These tests collectively ensure the robustness, consistency, and security of the UDIF protocol configuration.
| #define udif_cipher_generate_keypair qsc_kyber_generate_keypair |
UDIF function mapping macros.
These macros alias the high-level UDIF cryptographic operations to the corresponding QSC library functions. The mapping depends on the selected parameter set. For instance, if UDIF_CONFIG_SPHINCS_MCELIECE is defined, then the UDIF cipher and signature functions map to the McEliece/SPHINCS+ routines. Alternatively, if UDIF_CONFIG_DILITHIUM_KYBER is defined, the corresponding Dilithium/Kyber routines are used.
Generate an asymmetric cipher key-pair
| enum udif_claim_type |
Claim type identifiers (deterministic canonicalization required).
The UDIF algorithm configuration sets.
| enum udif_error_claims |
Claim/claim-set error codes.
| enum udif_error_encoding |
| enum udif_error_identity |
Identity-specific error codes.
| enum udif_error_policy |
| enum udif_errors |
UDIF error codes.
Membership and transaction log event codes.
Permission classes whose bits populate the permission mask.
| enum udif_policy_decision |
| enum udif_roles |
UDIF entity roles.
| enum udif_status |
Generic status codes for UDIF operations.
| enum udif_time_validation |
| enum udif_token_type |
| enum udif_verify_policy |
| enum udif_version_sets |
| UDIF_EXPORT_API const char * udif_error_to_string | ( | udif_errors | error | ) |
Convert an error to a string.
| error | The error enumerator. |
| UDIF_EXPORT_API bool udif_suite_is_valid | ( | uint8_t | suiteid | ) |
Check if the suite id valid.
| suiteid | The suite id. |