43#include "aerncommon.h"
45#include "socketbase.h"
47#if defined(AERN_CONFIG_DILITHIUM_KYBER)
48# include "dilithium.h"
50#elif defined(AERN_CONFIG_SPHINCS_MCELIECE)
52# include "sphincsplus.h"
54# error Invalid parameter set!
110#define AERN_USE_RCS_ENCRYPTION
112#if defined(AERN_USE_RCS_ENCRYPTION)
114# define aern_cipher_state qsc_rcs_state
115# define aern_cipher_dispose qsc_rcs_dispose
116# define aern_cipher_initialize qsc_rcs_initialize
117# define aern_cipher_keyparams qsc_rcs_keyparams
118# define aern_cipher_set_associated qsc_rcs_set_associated
119# define aern_cipher_transform qsc_rcs_transform
122# define aern_cipher_state qsc_aes_gcm256_state
123# define aern_cipher_dispose qsc_aes_gcm256_dispose
124# define aern_cipher_initialize qsc_aes_gcm256_initialize
125# define aern_cipher_keyparams qsc_aes_keyparams
126# define aern_cipher_set_associated qsc_aes_gcm256_set_associated
127# define aern_cipher_transform qsc_aes_gcm256_transform
138#if defined(AERN_CONFIG_SPHINCS_MCELIECE)
143# define aern_cipher_generate_keypair qsc_mceliece_generate_keypair
148# define aern_cipher_decapsulate qsc_mceliece_decapsulate
153# define aern_cipher_encapsulate qsc_mceliece_encapsulate
158# define aern_signature_generate_keypair qsc_sphincsplus_generate_keypair
163# define aern_signature_sign qsc_sphincsplus_sign
168# define aern_signature_verify qsc_sphincsplus_verify
169#elif defined(AERN_CONFIG_DILITHIUM_KYBER)
174# define aern_cipher_generate_keypair qsc_kyber_generate_keypair
179# define aern_cipher_decapsulate qsc_kyber_decapsulate
184# define aern_cipher_encapsulate qsc_kyber_encapsulate
189# define aern_signature_generate_keypair qsc_dilithium_generate_keypair
194# define aern_signature_sign qsc_dilithium_sign
199# define aern_signature_verify qsc_dilithium_verify
201# error Invalid parameter set!
233#if defined(AERN_CONFIG_DILITHIUM_KYBER)
239# define AERN_ASYMMETRIC_CIPHERTEXT_SIZE (QSC_KYBER_CIPHERTEXT_SIZE)
245# define AERN_ASYMMETRIC_PRIVATE_KEY_SIZE (QSC_KYBER_PRIVATEKEY_SIZE)
251# define AERN_ASYMMETRIC_PUBLIC_KEY_SIZE (QSC_KYBER_PUBLICKEY_SIZE)
257# define AERN_ASYMMETRIC_SIGNATURE_SIZE (QSC_DILITHIUM_SIGNATURE_SIZE)
263# define AERN_ASYMMETRIC_SIGNING_KEY_SIZE (QSC_DILITHIUM_PRIVATEKEY_SIZE)
269# define AERN_ASYMMETRIC_VERIFICATION_KEY_SIZE (QSC_DILITHIUM_PUBLICKEY_SIZE)
271# if defined(QSC_DILITHIUM_S1P44) && defined(QSC_KYBER_S1K2P512)
276# define AERN_CHILD_CERTIFICATE_STRING_SIZE 5612U
281# define AERN_PARAMATERS_DILITHIUM_KYBER_D1K1
286# define AERN_ROOT_CERTIFICATE_STRING_SIZE 2188U
291# define AERN_SIGNATURE_ENCODING_SIZE 3312U
296# define AERN_VERIFICATION_KEY_ENCODING_SIZE 1752U
297# elif defined(QSC_DILITHIUM_S3P65) && defined(QSC_KYBER_S3K3P768)
302# define AERN_CHILD_CERTIFICATE_STRING_SIZE 7648U
307# define AERN_PARAMATERS_DILITHIUM_KYBER_D3K3
312# define AERN_ROOT_CERTIFICATE_STRING_SIZE 3053U
317# define AERN_SIGNATURE_ENCODING_SIZE 4476U
322# define AERN_VERIFICATION_KEY_ENCODING_SIZE 2604
323# elif defined(QSC_DILITHIUM_S5P87) && defined(QSC_KYBER_S5K4P1024)
328# define AERN_CHILD_CERTIFICATE_STRING_SIZE 10311U
333# define AERN_PARAMATERS_DILITHIUM_KYBER_D5K5
338# define AERN_ROOT_CERTIFICATE_STRING_SIZE 3919U
343# define AERN_SIGNATURE_ENCODING_SIZE 6212U
348# define AERN_VERIFICATION_KEY_ENCODING_SIZE 3456U
349# elif defined(QSC_DILITHIUM_S5P87) && defined(QSC_KYBER_S6K5P1280)
354# define AERN_CHILD_CERTIFICATE_STRING_SIZE 10311U
359# define AERN_PARAMATERS_DILITHIUM_KYBER_D5K6
364# define AERN_ROOT_CERTIFICATE_STRING_SIZE 3919U
369# define AERN_SIGNATURE_ENCODING_SIZE 6172U
374# define AERN_VERIFICATION_KEY_ENCODING_SIZE 3456U
378# error the library parameter sets are mismatched!
381#elif defined(AERN_CONFIG_SPHINCS_MCELIECE)
387# define AERN_ASYMMETRIC_CIPHERTEXT_SIZE (QSC_MCELIECE_CIPHERTEXT_SIZE)
393# define AERN_ASYMMETRIC_PRIVATE_KEY_SIZE (QSC_MCELIECE_PRIVATEKEY_SIZE)
399# define AERN_ASYMMETRIC_PUBLIC_KEY_SIZE (QSC_MCELIECE_PUBLICKEY_SIZE)
405# define AERN_ASYMMETRIC_SIGNATURE_SIZE (QSC_SPHINCSPLUS_SIGNATURE_SIZE)
411# define AERN_ASYMMETRIC_SIGNING_KEY_SIZE (QSC_SPHINCSPLUS_PRIVATEKEY_SIZE)
417# define AERN_ASYMMETRIC_VERIFICATION_KEY_SIZE (QSC_SPHINCSPLUS_PUBLICKEY_SIZE)
419# if defined(QSC_MCELIECE_S1N3488T64)
420# if defined(QSC_SPHINCSPLUS_S1S128SHAKERF)
425# define AERN_CHILD_CERTIFICATE_STRING_SIZE 23737U
430# define AERN_PARAMATERS_SPHINCSF_MCELIECE_SF1M1
435# define AERN_ROOT_CERTIFICATE_STRING_SIZE 455U
440# define AERN_SIGNATURE_ENCODING_SIZE 22828U
445# define AERN_VERIFICATION_KEY_ENCODING_SIZE 44U
446# elif defined(QSC_SPHINCSPLUS_S1S128SHAKERS)
451# define AERN_CHILD_CERTIFICATE_STRING_SIZE 11237U
456# define AERN_PARAMATERS_SPHINCSS_MCELIECE_SS1M1
461# define AERN_ROOT_CERTIFICATE_STRING_SIZE 455U
466# define AERN_SIGNATURE_ENCODING_SIZE 10520U
471# define AERN_VERIFICATION_KEY_ENCODING_SIZE 44U
473# elif defined(QSC_MCELIECE_S3N4608T96)
474# if defined(QSC_SPHINCSPLUS_S3S192SHAKERF)
479# define AERN_CHILD_CERTIFICATE_STRING_SIZE 48912U
484# define AERN_PARAMATERS_SPHINCSF_MCELIECE_SF3M3
489# define AERN_ROOT_CERTIFICATE_STRING_SIZE 476U
494# define AERN_SIGNATURE_ENCODING_SIZE 47596U
499# define AERN_VERIFICATION_KEY_ENCODING_SIZE 64U
500# elif defined(QSC_SPHINCSPLUS_S3S192SHAKERS)
505# define AERN_CHILD_CERTIFICATE_STRING_SIZE 22588U
510# define AERN_PARAMATERS_SPHINCSS_MCELIECE_SS3M3
515# define AERN_ROOT_CERTIFICATE_STRING_SIZE 476U
520# define AERN_SIGNATURE_ENCODING_SIZE 21676U
525# define AERN_VERIFICATION_KEY_ENCODING_SIZE 64U
527# elif defined(QSC_MCELIECE_S5N6688T128)
528# if defined(QSC_SPHINCSPLUS_S5S256SHAKERF)
533# define AERN_CHILD_CERTIFICATE_STRING_SIZE 68158U
538# define AERN_PARAMATERS_SPHINCSF_MCELIECE_SF5M5
543# define AERN_ROOT_CERTIFICATE_STRING_SIZE 501U
548# define AERN_SIGNATURE_ENCODING_SIZE 66520U
553# define AERN_VERIFICATION_KEY_ENCODING_SIZE 88U
554# elif defined(QSC_SPHINCSPLUS_S5S256SHAKERS)
559# define AERN_CHILD_CERTIFICATE_STRING_SIZE 40987U
564# define AERN_PARAMATERS_SPHINCSS_MCELIECE_SS5M5
569# define AERN_ROOT_CERTIFICATE_STRING_SIZE 501U
574# define AERN_SIGNATURE_ENCODING_SIZE 39768U
579# define AERN_VERIFICATION_KEY_ENCODING_SIZE 88U
581# elif defined(QSC_MCELIECE_S6N6960T119)
582# if defined(QSC_SPHINCSPLUS_S5S256SHAKERF)
587# define AERN_CHILD_CERTIFICATE_STRING_SIZE 68157U
592# define AERN_PARAMATERS_SPHINCSF_MCELIECE_SF5M6
597# define AERN_ROOT_CERTIFICATE_STRING_SIZE 501U
602# define AERN_SIGNATURE_ENCODING_SIZE 66520U
607# define AERN_VERIFICATION_KEY_ENCODING_SIZE 88U
608# elif defined(QSC_SPHINCSPLUS_S5S256SHAKERS)
613# define AERN_CHILD_CERTIFICATE_STRING_SIZE 40987U
618# define AERN_PARAMATERS_SPHINCSS_MCELIECE_SS5M6
623# define AERN_ROOT_CERTIFICATE_STRING_SIZE 501U
628# define AERN_SIGNATURE_ENCODING_SIZE 39768U
633# define AERN_VERIFICATION_KEY_ENCODING_SIZE 88U
635# elif defined(QSC_MCELIECE_S7N8192T128)
636# if defined(QSC_SPHINCSPLUS_S5S256SHAKERF)
641# define AERN_CHILD_CERTIFICATE_STRING_SIZE 68157U
646# define AERN_PARAMATERS_SPHINCSF_MCELIECE_SF5M7
651# define AERN_ROOT_CERTIFICATE_STRING_SIZE 501U
656# define AERN_SIGNATURE_ENCODING_SIZE 66520U
661# define AERN_VERIFICATION_KEY_ENCODING_SIZE 88U
662# elif defined(QSC_SPHINCSPLUS_S5S256SHAKERS)
667# define AERN_CHILD_CERTIFICATE_STRING_SIZE 40987U
672# define AERN_PARAMATERS_SPHINCSS_MCELIECE_SS5M7
677# define AERN_ROOT_CERTIFICATE_STRING_SIZE 501U
682# define AERN_SIGNATURE_ENCODING_SIZE 39768U
687# define AERN_VERIFICATION_KEY_ENCODING_SIZE 88U
689# error Invalid parameter sets, check the QSC library settings
695# error Invalid parameter sets, check the QSC library settings
703#define AERN_ACTIVE_VERSION 1U
709#define AERN_ACTIVE_VERSION_SIZE 2U
715#define AERN_APS_FULL_TRUST 1000001U
721#define AERN_APS_MINIMUM_TRUST 1U
728#define AERN_APS_NAME_MAX_SIZE 256U
734#define AERN_APS_TWOWAY_TRUST 1000002U
740#define AERN_APPLICATION_ADC_PORT 38762U
746#define AERN_APPLICATION_APS_PORT 38766U
752#define AERN_APPLICATION_ARS_PORT 38764U
758#define AERN_APPLICATION_CLIENT_PORT 37761U
764#define AERN_APPLICATION_IDG_PORT 38763U
770#define AERN_CANONICAL_NAME_MINIMUM_SIZE 3U
776#define AERN_CERTIFICATE_ADDRESS_SIZE 22U
782#define AERN_CERTIFICATE_ALGORITHM_SIZE 1U
788#define AERN_CERTIFICATE_DEFAULT_PERIOD ((uint64_t)365U * 24U * 60U * 60U)
794#define AERN_CERTIFICATE_DESIGNATION_SIZE 1U
800#define AERN_CERTIFICATE_EXPIRATION_SIZE 16U
806#define AERN_CERTIFICATE_HASH_SIZE 32U
813#define AERN_CERTIFICATE_ISSUER_SIZE 256U
819#define AERN_CERTIFICATE_LINE_LENGTH 64U
825#define AERN_CERTIFICATE_MAXIMUM_PERIOD (AERN_CERTIFICATE_DEFAULT_PERIOD * 2U)
831#define AERN_CERTIFICATE_MINIMUM_PERIOD ((uint64_t)1U * 24U * 60U * 60U)
837#define AERN_CERTIFICATE_SERIAL_SIZE 16U
843#define AERN_CERTIFICATE_HINT_SIZE (AERN_CERTIFICATE_HASH_SIZE + AERN_CERTIFICATE_SERIAL_SIZE)
849#define AERN_CERTIFICATE_SIGNED_HASH_SIZE (AERN_ASYMMETRIC_SIGNATURE_SIZE + AERN_CERTIFICATE_HASH_SIZE)
855#define AERN_CERTIFICATE_VERSION_SIZE 1U
861#define AERN_CERTIFICATE_CHILD_SIZE (AERN_CERTIFICATE_SIGNED_HASH_SIZE + \
862 AERN_ASYMMETRIC_VERIFICATION_KEY_SIZE + \
863 AERN_CERTIFICATE_ISSUER_SIZE + \
864 AERN_CERTIFICATE_SERIAL_SIZE + \
865 AERN_CERTIFICATE_SERIAL_SIZE + \
866 AERN_CERTIFICATE_EXPIRATION_SIZE + \
867 AERN_CERTIFICATE_DESIGNATION_SIZE + \
868 AERN_CERTIFICATE_ALGORITHM_SIZE + \
869 AERN_CERTIFICATE_VERSION_SIZE)
875#define AERN_CERTIFICATE_IDG_SIZE (AERN_ASYMMETRIC_SIGNATURE_SIZE + \
876 AERN_CERTIFICATE_HASH_SIZE + \
877 AERN_ASYMMETRIC_VERIFICATION_KEY_SIZE + \
878 AERN_CERTIFICATE_ISSUER_SIZE + \
879 AERN_CERTIFICATE_ADDRESS_SIZE + \
880 AERN_CERTIFICATE_SERIAL_SIZE + \
881 AERN_CERTIFICATE_SERIAL_SIZE + \
882 AERN_CERTIFICATE_EXPIRATION_SIZE + \
883 AERN_CERTIFICATE_DESIGNATION_SIZE + \
884 AERN_CERTIFICATE_ALGORITHM_SIZE + \
885 AERN_CERTIFICATE_VERSION_SIZE)
891#define AERN_CERTIFICATE_ROOT_SIZE (AERN_CERTIFICATE_HASH_SIZE + \
892 AERN_ASYMMETRIC_VERIFICATION_KEY_SIZE + \
893 AERN_CERTIFICATE_ISSUER_SIZE + \
894 AERN_CERTIFICATE_SERIAL_SIZE + \
895 AERN_CERTIFICATE_EXPIRATION_SIZE + \
896 AERN_CERTIFICATE_ALGORITHM_SIZE + \
897 AERN_CERTIFICATE_VERSION_SIZE)
903#define AERN_CRYPTO_SYMMETRIC_KEY_SIZE 32U
909#if defined(AERN_USE_RCS_ENCRYPTION)
910# define AERN_CRYPTO_SYMMETRIC_NONCE_SIZE 32U
912# define AERN_CRYPTO_SYMMETRIC_NONCE_SIZE 16U
919#define AERN_CRYPTO_SEED_SIZE 64U
925#define AERN_CRYPTO_SYMMETRIC_TOKEN_SIZE 32U
931#define AERN_CRYPTO_SYMMETRIC_HASH_SIZE 32U
937#if defined(AERN_USE_RCS_ENCRYPTION)
938# if defined(AERN_EXTENDED_SESSION_SECURITY)
939# define AERN_CRYPTO_SYMMETRIC_MAC_SIZE 64U
941# define AERN_CRYPTO_SYMMETRIC_MAC_SIZE 32U
944# define AERN_CRYPTO_SYMMETRIC_MAC_SIZE 16U
951#define AERN_CRYPTO_SYMMETRIC_SECRET_SIZE 32U
957#if defined(AERN_EXTENDED_SESSION_SECURITY)
958# define AERN_CRYPTO_SYMMETRIC_SESSION_KEY_SIZE 64U
960# define AERN_CRYPTO_SYMMETRIC_SESSION_KEY_SIZE 32U
967#define AERN_ADC_CONVERGENCE_INTERVAL (60U * 60U * 24U)
973#define AERN_ADC_IP_MAX 0x41U
979#define AERN_ADC_PENALTY_MAX 0x100U
985#define AERN_ADC_REDUCTION_INTERVAL 1000000UL
993#define AERN_ADC_UPDATE_WAIT_TIME (7U * 24U * 60U * 60U)
999#define AERN_ERROR_STRING_DEPTH 26U
1005#define AERN_ERROR_STRING_WIDTH 128U
1011#define AERN_MESSAGE_MAX_SIZE 1400000UL
1017#define AERN_MFK_EXPIRATION_PERIOD ((uint64_t)60U * 24U * 60U * 60U)
1023#define AERN_MINIMUM_PATH_LENGTH 9U
1029#define AERN_NETWORK_CONNECTION_MTU 1500U
1036#define AERN_NETWORK_DOMAIN_NAME_MAX_SIZE 256U
1042#define AERN_NETWORK_MAX_APSS 1000000UL
1048#define AERN_NETWORK_NODE_ID_SIZE 16
1054#define AERN_PERIOD_DAY_TO_SECONDS (24U * 60U * 60U)
1060#define AERN_SOCKET_TERMINATOR_SIZE 1U
1066#define AERN_PACKET_ERROR_SIZE 1U
1072#define AERN_PACKET_HEADER_SIZE 22U
1078#define AERN_PACKET_SUBHEADER_SIZE 16U
1084#define AERN_PACKET_SEQUENCE_TERMINATOR 0xFFFFFFFFUL
1090#define AERN_PACKET_TIME_SIZE 8U
1096#define AERN_PACKET_TIME_THRESHOLD 60U
1102#define AERN_NETWORK_TERMINATION_MESSAGE_SIZE 1U
1108#define AERN_NETWORK_TERMINATION_PACKET_SIZE (AERN_PACKET_HEADER_SIZE + AERN_NETWORK_TERMINATION_MESSAGE_SIZE)
1320 uint8_t
verkey[AERN_ASYMMETRIC_VERIFICATION_KEY_SIZE];
1334#define AERN_X509_CERTIFICATE_SIZE 4096U
1343#define AERN_IDG_HINT_SIZE (AERN_CERTIFICATE_HASH_SIZE + AERN_CERTIFICATE_SERIAL_SIZE)
1365 uint8_t
vkey[AERN_ASYMMETRIC_VERIFICATION_KEY_SIZE];
1437 uint8_t
verkey[AERN_ASYMMETRIC_VERIFICATION_KEY_SIZE];
1462 uint8_t
prikey[AERN_ASYMMETRIC_SIGNING_KEY_SIZE];
1463 uint8_t
pubkey[AERN_ASYMMETRIC_VERIFICATION_KEY_SIZE];
1472 uint8_t
prikey[AERN_ASYMMETRIC_PRIVATE_KEY_SIZE];
1473 uint8_t
pubkey[AERN_ASYMMETRIC_PUBLIC_KEY_SIZE];
1480#define AERN_CERTIFICATE_SEPERATOR_SIZE 1U
1481#define AERN_CHILD_CERTIFICATE_HEADER_SIZE 64U
1482#define AERN_CHILD_CERTIFICATE_ROOT_HASH_PREFIX_SIZE 30U
1483#define AERN_CHILD_CERTIFICATE_SIGNATURE_KEY_PREFIX_SIZE 23U
1484#define AERN_CHILD_CERTIFICATE_ISSUER_PREFIX_SIZE 9U
1485#define AERN_CHILD_CERTIFICATE_NAME_PREFIX_SIZE 7U
1486#define AERN_CHILD_CERTIFICATE_SERIAL_PREFIX_SIZE 9U
1487#define AERN_CHILD_CERTIFICATE_ROOT_SERIAL_PREFIX_SIZE 14U
1488#define AERN_CHILD_CERTIFICATE_VALID_FROM_PREFIX_SIZE 13U
1489#define AERN_CHILD_CERTIFICATE_EXPIRATION_TO_PREFIX_SIZE 6U
1490#define AERN_CHILD_CERTIFICATE_ALGORITHM_PREFIX_SIZE 12U
1491#define AERN_CHILD_CERTIFICATE_VERSION_PREFIX_SIZE 10U
1492#define AERN_CHILD_CERTIFICATE_DESIGNATION_PREFIX_SIZE 14U
1493#define AERN_CHILD_CERTIFICATE_ADDRESS_PREFIX_SIZE 10U
1494#define AERN_CHILD_CERTIFICATE_FOOTER_SIZE 64U
1495#define AERN_CHILD_CERTIFICATE_DEFAULT_NAME_SIZE 19U
1497static const char AERN_CHILD_CERTIFICATE_HEADER[AERN_CHILD_CERTIFICATE_HEADER_SIZE] =
"-----------BEGIN AERN CHILD PUBLIC CERTIFICATE BLOCK-----------";
1498static const char AERN_CHILD_CERTIFICATE_ROOT_HASH_PREFIX[AERN_CHILD_CERTIFICATE_ROOT_HASH_PREFIX_SIZE] =
"Root Signed Public Key Hash: ";
1499static const char AERN_CHILD_CERTIFICATE_SIGNATURE_KEY_PREFIX[AERN_CHILD_CERTIFICATE_SIGNATURE_KEY_PREFIX_SIZE] =
"Public Signature Key: ";
1500static const char AERN_CHILD_CERTIFICATE_ISSUER_PREFIX[AERN_CHILD_CERTIFICATE_ISSUER_PREFIX_SIZE] =
"Issuer: ";
1501static const char AERN_CHILD_CERTIFICATE_NAME_PREFIX[AERN_CHILD_CERTIFICATE_NAME_PREFIX_SIZE] =
"Name: ";
1502static const char AERN_CHILD_CERTIFICATE_SERIAL_PREFIX[AERN_CHILD_CERTIFICATE_SERIAL_PREFIX_SIZE] =
"Serial: ";
1503static const char AERN_CHILD_CERTIFICATE_ROOT_SERIAL_PREFIX[AERN_CHILD_CERTIFICATE_ROOT_SERIAL_PREFIX_SIZE] =
"Root Serial: ";
1504static const char AERN_CHILD_CERTIFICATE_VALID_FROM_PREFIX[AERN_CHILD_CERTIFICATE_VALID_FROM_PREFIX_SIZE] =
"Valid From: ";
1505static const char AERN_CHILD_CERTIFICATE_EXPIRATION_TO_PREFIX[AERN_CHILD_CERTIFICATE_EXPIRATION_TO_PREFIX_SIZE] =
" To: ";
1506static const char AERN_CHILD_CERTIFICATE_ALGORITHM_PREFIX[AERN_CHILD_CERTIFICATE_ALGORITHM_PREFIX_SIZE] =
"Algorithm: ";
1507static const char AERN_CHILD_CERTIFICATE_VERSION_PREFIX[AERN_CHILD_CERTIFICATE_VERSION_PREFIX_SIZE] =
"Version: ";
1508static const char AERN_CHILD_CERTIFICATE_DESIGNATION_PREFIX[AERN_CHILD_CERTIFICATE_DESIGNATION_PREFIX_SIZE] =
"Designation: ";
1509static const char AERN_CHILD_CERTIFICATE_ADDRESS_PREFIX[AERN_CHILD_CERTIFICATE_ADDRESS_PREFIX_SIZE] =
"Address: ";
1510static const char AERN_CHILD_CERTIFICATE_FOOTER[AERN_CHILD_CERTIFICATE_FOOTER_SIZE] =
"------------END AERN CHILD PUBLIC CERTIFICATE BLOCK------------";
1511static const char AERN_CHILD_CERTIFICATE_DEFAULT_NAME[AERN_CHILD_CERTIFICATE_DEFAULT_NAME_SIZE] =
" Child Certificate";
1513#define AERN_NETWORK_DESIGNATION_SIZE 33
1514static const char AERN_NETWORK_DESIGNATION_NONE[AERN_NETWORK_DESIGNATION_SIZE] =
"aern_network_designation_none";
1515static const char AERN_NETWORK_DESIGNATION_APS[AERN_NETWORK_DESIGNATION_SIZE] =
"aern_network_designation_aps";
1516static const char AERN_NETWORK_DESIGNATION_CLIENT[AERN_NETWORK_DESIGNATION_SIZE] =
"aern_network_designation_client";
1517static const char AERN_NETWORK_DESIGNATION_ADS[AERN_NETWORK_DESIGNATION_SIZE] =
"aern_network_designation_ads";
1518static const char AERN_NETWORK_DESIGNATION_IDG[AERN_NETWORK_DESIGNATION_SIZE] =
"aern_network_designation_idg";
1519static const char AERN_NETWORK_DESIGNATION_REMOTE[AERN_NETWORK_DESIGNATION_SIZE] =
"aern_network_designation_remote";
1520static const char AERN_NETWORK_DESIGNATION_ROOT[AERN_NETWORK_DESIGNATION_SIZE] =
"aern_network_designation_ars";
1521static const char AERN_NETWORK_DESIGNATION_ALL[AERN_NETWORK_DESIGNATION_SIZE] =
"aern_network_designation_all";
1529#define AERN_PROTOCOL_SET_SIZE 41U
1544#if defined(AERN_PARAMATERS_DILITHIUM_KYBER_D1K1)
1547#elif defined(AERN_PARAMATERS_DILITHIUM_KYBER_D3K3)
1550#elif defined(AERN_PARAMATERS_DILITHIUM_KYBER_D5K5)
1553#elif defined(AERN_PARAMATERS_DILITHIUM_KYBER_D5K6)
1556#elif defined(AERN_PARAMATERS_SPHINCSF_MCELIECE_SF1M1)
1559#elif defined(AERN_PARAMATERS_SPHINCSPLUS_S1S128SHAKERS)
1562#elif defined(AERN_PARAMATERS_SPHINCSF_MCELIECE_SF3M3)
1565#elif defined(AERN_PARAMATERS_SPHINCSPLUS_S3S192SHAKERS)
1568#elif defined(AERN_PARAMATERS_SPHINCSF_MCELIECE_SF5M5)
1571#elif defined(AERN_PARAMATERS_SPHINCSPLUS_S5S256SHAKERS)
1574#elif defined(AERN_PARAMATERS_SPHINCSF_MCELIECE_SF5M6)
1577#elif defined(AERN_PARAMATERS_SPHINCSPLUS_S5S256SHAKERS)
1580#elif defined(AERN_PARAMATERS_SPHINCSF_MCELIECE_SF5M7)
1583#elif defined(AERN_PARAMATERS_SPHINCSPLUS_S5S256SHAKERS)
1587# error Invalid parameter set!
1594#define AERN_ROOT_CERTIFICATE_HEADER_SIZE 64U
1595#define AERN_ROOT_CERTIFICATE_HASH_PREFIX_SIZE 19U
1596#define AERN_ROOT_CERTIFICATE_PUBLICKEY_PREFIX_SIZE 13U
1597#define AERN_ROOT_CERTIFICATE_ISSUER_PREFIX_SIZE 9U
1598#define AERN_ROOT_CERTIFICATE_NAME_PREFIX_SIZE 7U
1599#define AERN_ROOT_CERTIFICATE_SERIAL_PREFIX_SIZE 9U
1600#define AERN_ROOT_CERTIFICATE_FOOTER_SIZE 64U
1601#define AERN_ROOT_CERTIFICATE_VALID_FROM_PREFIX_SIZE 13U
1602#define AERN_ROOT_CERTIFICATE_EXPIRATION_TO_PREFIX_SIZE 6U
1603#define AERN_ROOT_CERTIFICATE_ALGORITHM_PREFIX_SIZE 12U
1604#define AERN_ROOT_CERTIFICATE_VERSION_PREFIX_SIZE 10U
1605#define AERN_ROOT_CERTIFICATE_DEFAULT_NAME_SIZE 18U
1606#define AERN_ACTIVE_VERSION_STRING_SIZE 5U
1612static const char AERN_ROOT_CERTIFICATE_HEADER[AERN_ROOT_CERTIFICATE_HEADER_SIZE] =
"------------BEGIN AERN ROOT PUBLIC CERTIFICATE BLOCK-----------";
1613static const char AERN_ROOT_CERTIFICATE_ISSUER_PREFIX[AERN_ROOT_CERTIFICATE_ISSUER_PREFIX_SIZE] =
"Issuer: ";
1614static const char AERN_ROOT_CERTIFICATE_NAME_PREFIX[AERN_ROOT_CERTIFICATE_NAME_PREFIX_SIZE] =
"Name: ";
1615static const char AERN_ROOT_CERTIFICATE_SERIAL_PREFIX[AERN_ROOT_CERTIFICATE_SERIAL_PREFIX_SIZE] =
"Serial: ";
1616static const char AERN_ROOT_CERTIFICATE_VALID_FROM_PREFIX[AERN_ROOT_CERTIFICATE_VALID_FROM_PREFIX_SIZE] =
"Valid From: ";
1617static const char AERN_ROOT_CERTIFICATE_EXPIRATION_TO_PREFIX[AERN_ROOT_CERTIFICATE_EXPIRATION_TO_PREFIX_SIZE] =
" To: ";
1618static const char AERN_ROOT_CERTIFICATE_ALGORITHM_PREFIX[AERN_ROOT_CERTIFICATE_ALGORITHM_PREFIX_SIZE] =
"Algorithm: ";
1619static const char AERN_ROOT_CERTIFICATE_VERSION_PREFIX[AERN_ROOT_CERTIFICATE_VERSION_PREFIX_SIZE] =
"Version: ";
1620static const char AERN_ROOT_CERTIFICATE_HASH_PREFIX[AERN_ROOT_CERTIFICATE_HASH_PREFIX_SIZE] =
"Certificate Hash: ";
1621static const char AERN_ROOT_CERTIFICATE_PUBLICKEY_PREFIX[AERN_ROOT_CERTIFICATE_PUBLICKEY_PREFIX_SIZE] =
"Public Key: ";
1622static const char AERN_ROOT_CERTIFICATE_FOOTER[AERN_ROOT_CERTIFICATE_FOOTER_SIZE] =
"------------END AERN ROOT PUBLIC CERTIFICATE BLOCK-------------";
1623static const char AERN_ROOT_CERTIFICATE_DEFAULT_NAME[AERN_ROOT_CERTIFICATE_DEFAULT_NAME_SIZE] =
" Root Certificate";
1625static const char AERN_ACTIVE_VERSION_STRING[AERN_ACTIVE_VERSION_STRING_SIZE] =
"0x01";
1626static const char AERN_CERTIFICATE_CHILD_EXTENSION[] =
".ccert";
1627static const char AERN_CERTIFICATE_MFCOL_EXTENSION[] =
".mfcol";
1628static const char AERN_CERTIFICATE_ROOT_EXTENSION[] =
".rcert";
1629static const char AERN_CERTIFICATE_TOPOLOGY_EXTENSION[] =
".dtop";
1630static const char AERN_APPLICATION_ROOT_PATH[] =
"\\AERN";
1631static const char AERN_CERTIFICATE_BACKUP_PATH[] =
"\\Backup";
1632static const char AERN_CERTIFICATE_STORE_PATH[] =
"\\Certificates";
1633static const char AERN_ROOT_CERTIFICATE_PATH[] =
"\\Root";
1634static const char AERN_CERTIFICATE_TOPOLOGY_PATH[] =
"\\Topology";
1638#define AERN_NETWORK_ERROR_STRING_DEPTH 28U
1639#define AERN_NETWORK_ERROR_STRING_SIZE 128U
1643static const char AERN_NETWORK_ERROR_STRINGS[AERN_NETWORK_ERROR_STRING_DEPTH][AERN_NETWORK_ERROR_STRING_SIZE] =
1645 "No error was detected",
1646 "The socket accept function returned an error",
1647 "The cipher authentication has failed",
1648 "The keep alive check failed",
1649 "The communications channel has failed",
1650 "The device could not make a connnection to the remote host",
1651 "The decryption authentication has failed",
1652 "The transmission failed at the kex establish phase",
1653 "The connection experienced an unexpected error",
1654 "The server has run out of socket connections",
1655 "The random generator experienced a failure",
1656 "The input is invalid",
1657 "The request is invalid",
1658 "The keep alive has expired with no response",
1659 "The keepalive failure counter has exceeded maximum ",
1660 "The kex authentication has failed",
1661 "The key-id is not recognized",
1662 "The certificate has expired",
1663 "The listener function failed to initialize",
1664 "The server has run out of memory",
1665 "The random generator experienced a failure",
1666 "The random generator experienced a failure",
1667 "The ratchet operation has failed",
1668 "The receiver failed at the network layer",
1669 "The transmitter failed at the network layer",
1670 "The protocol version is unknown",
1671 "The packet was received out of sequence",
1672 "The expected data could not be verified"
1675#define AERN_PROTOCOL_ERROR_STRING_DEPTH 44U
1676#define AERN_PROTOCOL_ERROR_STRING_SIZE 128U
1678static const char AERN_PROTOCOL_ERROR_STRINGS[AERN_PROTOCOL_ERROR_STRING_DEPTH][AERN_PROTOCOL_ERROR_STRING_SIZE] =
1680 "No error was detected",
1681 "The symmetric cipher had an authentication failure",
1682 "The node certificate could not be found",
1683 "The communications channel has failed",
1684 "The device could not make a connection to the remote host",
1685 "The transmission failed at the KEX connection phase",
1686 "The convergence call has returned an error",
1687 "The database is already synchronized",
1688 "The asymmetric cipher failed to decapsulate the shared secret",
1689 "The node or certificate decoding failed",
1690 "The decryption authentication has failed",
1691 "The transmission failed at the KEX establish phase",
1692 "The transmission failed at the KEX exchange phase",
1693 "The application could not delete a local file",
1694 "The file could not be found",
1695 "The file could not be written to storage",
1696 "The public-key hash is invalid",
1697 "The server has run out of socket connections",
1698 "The packet flag was unexpected",
1699 "The certificate has expired and is invalid",
1700 "The AERN public key has expired ",
1701 "The key identity is unrecognized",
1702 "The listener function failed to initialize",
1703 "The server has run out of memory",
1704 "The network time is invalid or has substantial delay",
1705 "The expected data could not be verified",
1706 "The server has no usable IP address, assign in configuration",
1707 "The node is offline or not available for connection",
1708 "The node could not be found in the database",
1709 "The node was previously registered in the database",
1710 "The operation was cancelled by the user",
1711 "The packet header received was invalid",
1712 "The packet was received out of sequence",
1713 "The receiver failed at the network layer",
1714 "The root signature failed authentication",
1715 "The certificate could not be serialized",
1716 "The signature scheme could not sign a message",
1717 "The transmission failed to sign the data",
1718 "The socket could not be bound to an IP address",
1719 "The socket could not be created",
1720 "The transmitter failed at the network layer",
1721 "The topological database has no aps entries",
1722 "The protocol string was not recognized",
1723 "The transmission failed at the KEX verify phase"
AERN_EXPORT_API void aern_stream_to_packet(const uint8_t *pstream, aern_network_packet *packet)
Deserialize a byte stream into a network packet.
Definition aern.c:277
AERN_EXPORT_API size_t aern_packet_to_stream(const aern_network_packet *packet, uint8_t *pstream)
Serialize a network packet to a byte stream.
Definition aern.c:245
#define AERN_CRYPTO_SYMMETRIC_NONCE_SIZE
The byte length of the symmetric cipher nonce.
Definition aern.h:910
#define AERN_CERTIFICATE_ISSUER_SIZE
The maximum certificate issuer string length. The last character must be a string terminator.
Definition aern.h:813
AERN_EXPORT_API void aern_packet_clear(aern_network_packet *packet)
Clear the state of a network packet.
Definition aern.c:172
AERN_EXPORT_API void aern_packet_header_serialize(const aern_network_packet *packet, uint8_t *header)
Serialize a packet header into a byte array.
Definition aern.c:212
#define AERN_CERTIFICATE_SIGNED_HASH_SIZE
The size of the signature and hash field in a certificate.
Definition aern.h:849
AERN_EXPORT_API void aern_packet_set_utc_time(aern_network_packet *packet)
Set the local UTC time in the packet header.
Definition aern.c:231
aern_configuration_sets
The AERN algorithm configuration sets.
Definition aern.h:1117
@ aern_configuration_set_sphincsplus3f_mceliece3_rcs256_shake256
Definition aern.h:1125
@ aern_configuration_set_dilithium5_kyber5_rcs256_shake256
Definition aern.h:1121
@ aern_configuration_set_dilithium5_kyber6_rcs512_shake256
Definition aern.h:1122
@ aern_configuration_set_sphincsplus1f_mceliece1_rcs256_shake256
Definition aern.h:1123
@ aern_configuration_set_sphincsplus5f_mceliece5_rcs256_shake256
Definition aern.h:1127
@ aern_configuration_set_sphincsplus3s_mceliece3_rcs256_shake256
Definition aern.h:1126
@ aern_configuration_set_sphincsplus5s_mceliece6_rcs256_shake256
Definition aern.h:1130
@ aern_configuration_set_none
Definition aern.h:1118
@ aern_configuration_set_sphincsplus5f_mceliece7_rcs256_shake256
Definition aern.h:1131
@ aern_configuration_set_dilithium1_kyber1_rcs256_shake256
Definition aern.h:1119
@ aern_configuration_set_sphincsplus1s_mceliece1_rcs256_shake256
Definition aern.h:1124
@ aern_configuration_set_sphincsplus5s_mceliece5_rcs256_shake256
Definition aern.h:1128
@ aern_configuration_set_sphincsplus5f_mceliece6_rcs256_shake256
Definition aern.h:1129
@ aern_configuration_set_sphincsplus5s_mceliece7_rcs256_shake256
Definition aern.h:1132
@ aern_configuration_set_dilithium3_kyber3_rcs256_shake256
Definition aern.h:1120
aern_protocol_errors
The AERN protocol error values.
Definition aern.h:1244
@ aern_protocol_error_signature_failure
Definition aern.h:1281
@ aern_protocol_error_file_not_found
Definition aern.h:1259
@ aern_protocol_error_connection_failure
Definition aern.h:1249
@ aern_protocol_error_transmit_failure
Definition aern.h:1285
@ aern_protocol_error_listener_fail
Definition aern.h:1267
@ aern_protocol_error_message_time_invalid
Definition aern.h:1269
@ aern_protocol_error_channel_down
Definition aern.h:1248
@ aern_protocol_error_operation_cancelled
Definition aern.h:1275
@ aern_protocol_error_packet_header_invalid
Definition aern.h:1276
@ aern_protocol_error_authentication_failure
Definition aern.h:1246
@ aern_protocol_error_connect_failure
Definition aern.h:1250
@ aern_protocol_error_signing_failure
Definition aern.h:1282
@ aern_protocol_error_key_expired
Definition aern.h:1265
@ aern_protocol_error_node_not_available
Definition aern.h:1272
@ aern_protocol_error_socket_creation
Definition aern.h:1284
@ aern_protocol_error_node_was_registered
Definition aern.h:1274
@ aern_protocol_error_no_usable_address
Definition aern.h:1271
@ aern_protocol_error_decoding_failure
Definition aern.h:1254
@ aern_protocol_error_root_signature_invalid
Definition aern.h:1279
@ aern_protocol_error_establish_failure
Definition aern.h:1256
@ aern_protocol_error_decapsulation_failure
Definition aern.h:1253
@ aern_protocol_error_packet_unsequenced
Definition aern.h:1277
@ aern_protocol_error_unknown_protocol
Definition aern.h:1287
@ aern_protocol_error_file_not_deleted
Definition aern.h:1258
@ aern_protocol_error_topology_no_aps
Definition aern.h:1286
@ aern_protocol_error_decryption_failure
Definition aern.h:1255
@ aern_protocol_error_invalid_request
Definition aern.h:1263
@ aern_protocol_error_receive_failure
Definition aern.h:1278
@ aern_protocol_error_certificate_expired
Definition aern.h:1264
@ aern_protocol_error_hash_invalid
Definition aern.h:1261
@ aern_protocol_error_message_verification_failure
Definition aern.h:1270
@ aern_protocol_error_none
Definition aern.h:1245
@ aern_protocol_error_verification_failure
Definition aern.h:1288
@ aern_protocol_error_convergence_synchronized
Definition aern.h:1252
@ aern_protocol_error_file_not_written
Definition aern.h:1260
@ aern_protocol_error_certificate_not_found
Definition aern.h:1247
@ aern_protocol_error_node_not_found
Definition aern.h:1273
@ aern_protocol_error_hosts_exceeded
Definition aern.h:1262
@ aern_protocol_error_memory_allocation
Definition aern.h:1268
@ aern_protocol_error_socket_binding
Definition aern.h:1283
@ aern_protocol_error_key_unrecognized
Definition aern.h:1266
@ aern_protocol_error_exchange_failure
Definition aern.h:1257
@ aern_protocol_error_convergence_failure
Definition aern.h:1251
@ aern_protocol_error_serialization_failure
Definition aern.h:1280
#define AERN_PROTOCOL_SET_SIZE
The size of the protocol configuration string.
Definition aern.h:1529
AERN_EXPORT_API void aern_packet_header_deserialize(const uint8_t *header, aern_network_packet *packet)
Deserialize a byte array into a packet header.
Definition aern.c:193
AERN_EXPORT_API aern_protocol_errors aern_decrypt_packet(aern_connection_state *cns, uint8_t *message, size_t *msglen, const aern_network_packet *packetin)
Decrypt a message and copy it to the output buffer.
Definition aern.c:41
#define AERN_CRYPTO_SYMMETRIC_KEY_SIZE
The byte length of the symmetric cipher key.
Definition aern.h:903
AERN_EXPORT_API void aern_packet_error_message(aern_network_packet *packet, aern_protocol_errors error)
Populate a packet structure with an error message.
Definition aern.c:180
AERN_EXPORT_API void aern_connection_close(qsc_socket *rsock, aern_network_errors err, bool notify)
Close the network connection between hosts.
Definition aern.c:10
#define AERN_X509_CERTIFICATE_SIZE
x509 implementation where algorithm/signature output size is stored.
Definition aern.h:1334
AERN_EXPORT_API aern_protocol_errors aern_encrypt_packet(aern_connection_state *cns, aern_network_packet *packetout, const uint8_t *message, size_t msglen)
Encrypt a message and build an output packet.
Definition aern.c:102
AERN_EXPORT_API const char * aern_network_error_to_string(aern_network_errors error)
Return a pointer to a string description of a network error code.
Definition aern.c:144
AERN_EXPORT_API const char * aern_protocol_error_to_string(aern_protocol_errors error)
Return a pointer to a string description of a protocol error code.
Definition aern.c:158
#define AERN_CERTIFICATE_HINT_SIZE
The topological hint.
Definition aern.h:843
aern_network_errors
The AERN network error values.
Definition aern.h:1157
@ aern_network_error_channel_down
Definition aern.h:1162
@ aern_network_error_invalid_input
Definition aern.h:1169
@ aern_network_error_ratchet_fail
Definition aern.h:1180
@ aern_network_error_transmit_failure
Definition aern.h:1182
@ aern_network_error_establish_failure
Definition aern.h:1165
@ aern_network_error_general_failure
Definition aern.h:1166
@ aern_network_error_connection_failure
Definition aern.h:1163
@ aern_network_error_keep_alive_expired
Definition aern.h:1171
@ aern_network_error_hosts_exceeded
Definition aern.h:1167
@ aern_network_error_accept_fail
Definition aern.h:1159
@ aern_network_error_verify_failure
Definition aern.h:1185
@ aern_network_error_unsequenced
Definition aern.h:1184
@ aern_network_error_listener_fail
Definition aern.h:1176
@ aern_network_error_identity_unknown
Definition aern.h:1168
@ aern_network_error_kex_auth_failure
Definition aern.h:1173
@ aern_network_error_invalid_request
Definition aern.h:1170
@ aern_network_error_memory_allocation
Definition aern.h:1177
@ aern_network_error_receive_failure
Definition aern.h:1181
@ aern_network_error_keep_alive_timeout
Definition aern.h:1172
@ aern_network_error_random_failure
Definition aern.h:1179
@ aern_network_error_bad_keep_alive
Definition aern.h:1161
@ aern_network_error_auth_failure
Definition aern.h:1160
@ aern_network_error_key_not_recognized
Definition aern.h:1174
@ aern_network_error_decryption_failure
Definition aern.h:1164
@ aern_network_error_key_has_expired
Definition aern.h:1175
@ aern_network_error_unknown_protocol
Definition aern.h:1183
@ aern_network_error_none
Definition aern.h:1158
@ aern_network_error_packet_unsequenced
Definition aern.h:1178
aern_version_sets
The AERN version sets.
Definition aern.h:1296
@ aern_version_set_one_zero
Definition aern.h:1298
@ aern_version_set_none
Definition aern.h:1297
aern_network_designations
The AERN device designation.
Definition aern.h:1140
@ aern_network_designation_all
Definition aern.h:1149
@ aern_network_designation_idg
Definition aern.h:1148
@ aern_network_designation_ars
Definition aern.h:1146
@ aern_network_designation_remote
Definition aern.h:1145
@ aern_network_designation_ads
Definition aern.h:1144
@ aern_network_designation_none
Definition aern.h:1141
@ aern_network_designation_revoked
Definition aern.h:1147
@ aern_network_designation_aps
Definition aern.h:1142
@ aern_network_designation_client
Definition aern.h:1143
AERN_EXPORT_API void aern_connection_state_dispose(aern_connection_state *cns)
Dispose of the tunnel connection state.
Definition aern.c:302
AERN_EXPORT_API bool aern_packet_time_valid(const aern_network_packet *packet)
Check if the packet's UTC time is within the valid time threshold.
Definition aern.c:236
#define AERN_CERTIFICATE_HASH_SIZE
The size of the certificate hash in bytes.
Definition aern.h:806
#define AERN_CERTIFICATE_SERIAL_SIZE
The certificate serial number field length.
Definition aern.h:837
aern_network_flags
The AERN network flags.
Definition aern.h:1193
@ aern_network_flag_topology_status_unavailable
Definition aern.h:1234
@ aern_network_flag_fragment_collection_request
Definition aern.h:1197
@ aern_network_flag_tunnel_session_established
Definition aern.h:1226
@ aern_network_flag_register_update_response
Definition aern.h:1208
@ aern_network_flag_tunnel_connection_terminate
Definition aern.h:1224
@ aern_network_flag_fragment_query_request
Definition aern.h:1201
@ aern_network_flag_register_request
Definition aern.h:1205
@ aern_network_flag_keep_alive_response
Definition aern.h:1210
@ aern_network_flag_fragment_response
Definition aern.h:1200
@ aern_network_flag_network_converge_update
Definition aern.h:1218
@ aern_network_flag_network_resign_request
Definition aern.h:1219
@ aern_network_flag_fragment_collection_response
Definition aern.h:1198
@ aern_network_flag_topology_status_request
Definition aern.h:1230
@ aern_network_flag_network_announce_broadcast
Definition aern.h:1215
@ aern_network_flag_register_response
Definition aern.h:1206
@ aern_network_flag_network_resign_response
Definition aern.h:1220
@ aern_network_flag_tunnel_transfer_request
Definition aern.h:1227
@ aern_network_flag_network_remote_signing_response
Definition aern.h:1236
@ aern_network_flag_fragment_query_response
Definition aern.h:1202
@ aern_network_flag_system_error_condition
Definition aern.h:1223
@ aern_network_flag_topology_query_response
Definition aern.h:1229
@ aern_network_flag_register_update_request
Definition aern.h:1207
@ aern_network_flag_network_converge_response
Definition aern.h:1217
@ aern_network_flag_network_revocation_broadcast
Definition aern.h:1221
@ aern_network_flag_topology_status_response
Definition aern.h:1231
@ aern_network_flag_mfk_verify
Definition aern.h:1214
@ aern_network_flag_network_remote_signing_request
Definition aern.h:1235
@ aern_network_flag_connection_terminate_request
Definition aern.h:1195
@ aern_network_flag_network_signature_request
Definition aern.h:1222
@ aern_network_flag_incremental_update_request
Definition aern.h:1203
@ aern_network_flag_mfk_establish
Definition aern.h:1211
@ aern_network_flag_tunnel_encrypted_message
Definition aern.h:1225
@ aern_network_flag_topology_status_synchronized
Definition aern.h:1233
@ aern_network_flag_keep_alive_request
Definition aern.h:1209
@ aern_network_flag_mfk_request
Definition aern.h:1212
@ aern_network_flag_network_converge_request
Definition aern.h:1216
@ aern_network_flag_none
Definition aern.h:1194
@ aern_network_flag_incremental_update_response
Definition aern.h:1204
@ aern_network_flag_topology_query_request
Definition aern.h:1228
@ aern_network_flag_topology_status_available
Definition aern.h:1232
@ aern_network_flag_fragment_request
Definition aern.h:1199
@ aern_network_flag_error_condition
Definition aern.h:1196
@ aern_network_flag_mfk_response
Definition aern.h:1213
The certificate expiration time structure.
Definition aern.h:1308
uint64_t to
Definition aern.h:1310
uint64_t from
Definition aern.h:1309
The child certificate structure.
Definition aern.h:1318
char issuer[AERN_CERTIFICATE_ISSUER_SIZE]
Definition aern.h:1321
aern_configuration_sets algorithm
Definition aern.h:1326
uint8_t csig[AERN_CERTIFICATE_SIGNED_HASH_SIZE]
Definition aern.h:1319
aern_certificate_expiration expiration
Definition aern.h:1324
uint8_t serial[AERN_CERTIFICATE_SERIAL_SIZE]
Definition aern.h:1322
aern_network_designations designation
Definition aern.h:1325
uint8_t version
Definition aern.h:1327
uint8_t verkey[AERN_ASYMMETRIC_VERIFICATION_KEY_SIZE]
Definition aern.h:1320
uint8_t rootser[AERN_CERTIFICATE_SERIAL_SIZE]
Definition aern.h:1323
The AERN asymmetric cipher key container.
Definition aern.h:1471
uint8_t pubkey[AERN_ASYMMETRIC_PUBLIC_KEY_SIZE]
Definition aern.h:1473
uint8_t prikey[AERN_ASYMMETRIC_PRIVATE_KEY_SIZE]
Definition aern.h:1472
The AERN socket connection state structure.
Definition aern.h:1382
uint64_t txseq
Definition aern.h:1387
aern_cipher_state txcpr
Definition aern.h:1385
uint64_t rxseq
Definition aern.h:1386
uint32_t instance
Definition aern.h:1388
aern_network_flags exflag
Definition aern.h:1389
aern_cipher_state rxcpr
Definition aern.h:1384
qsc_socket target
Definition aern.h:1383
The IDG certificate structure.
Definition aern.h:1363
char issuer[AERN_CERTIFICATE_ISSUER_SIZE]
Definition aern.h:1370
uint8_t xcert[AERN_X509_CERTIFICATE_SIZE]
Definition aern.h:1366
aern_configuration_sets algorithm
Definition aern.h:1373
uint8_t csig[AERN_CERTIFICATE_SIGNED_HASH_SIZE]
Definition aern.h:1364
aern_certificate_expiration expiration
Definition aern.h:1371
uint8_t hint[AERN_CERTIFICATE_HINT_SIZE]
Definition aern.h:1369
uint8_t vkey[AERN_ASYMMETRIC_VERIFICATION_KEY_SIZE]
Definition aern.h:1365
uint8_t serial[AERN_CERTIFICATE_SERIAL_SIZE]
Definition aern.h:1367
aern_network_designations designation
Definition aern.h:1372
uint8_t version
Definition aern.h:1374
uint8_t rootser[AERN_CERTIFICATE_SERIAL_SIZE]
Definition aern.h:1368
The IDG hint structure.
Definition aern.h:1350
uint8_t chash[AERN_CERTIFICATE_HASH_SIZE]
Definition aern.h:1351
uint8_t rootser[AERN_CERTIFICATE_SERIAL_SIZE]
Definition aern.h:1352
The AERN keep alive state structure.
Definition aern.h:1397
bool recd
Definition aern.h:1401
uint64_t seqctr
Definition aern.h:1400
qsc_socket target
Definition aern.h:1398
uint64_t etime
Definition aern.h:1399
The AERN master fragment key structure.
Definition aern.h:1409
uint8_t serial[AERN_CERTIFICATE_SERIAL_SIZE]
Definition aern.h:1410
uint8_t mfk[AERN_CRYPTO_SYMMETRIC_KEY_SIZE]
Definition aern.h:1411
The AERN packet structure.
Definition aern.h:1419
uint8_t * pmessage
Definition aern.h:1424
uint32_t msglen
Definition aern.h:1421
uint64_t utctime
Definition aern.h:1423
uint64_t sequence
Definition aern.h:1422
uint8_t flag
Definition aern.h:1420
The root certificate structure.
Definition aern.h:1436
char issuer[AERN_CERTIFICATE_ISSUER_SIZE]
Definition aern.h:1438
aern_version_sets version
Definition aern.h:1442
aern_configuration_sets algorithm
Definition aern.h:1441
aern_certificate_expiration expiration
Definition aern.h:1440
uint8_t serial[AERN_CERTIFICATE_SERIAL_SIZE]
Definition aern.h:1439
uint8_t verkey[AERN_ASYMMETRIC_VERIFICATION_KEY_SIZE]
Definition aern.h:1437
The structure for a serialized symmetric key.
Definition aern.h:1450
uint8_t key[AERN_CRYPTO_SYMMETRIC_KEY_SIZE]
Definition aern.h:1452
uint8_t nonce[AERN_CRYPTO_SYMMETRIC_NONCE_SIZE]
Definition aern.h:1453
uint64_t keyid
Definition aern.h:1451
The AERN asymmetric signature scheme key container.
Definition aern.h:1461
uint8_t prikey[AERN_ASYMMETRIC_SIGNING_KEY_SIZE]
Definition aern.h:1462
uint8_t pubkey[AERN_ASYMMETRIC_VERIFICATION_KEY_SIZE]
Definition aern.h:1463