66HKDS_EXPORT_API
typedef struct
84HKDS_EXPORT_API
typedef struct
122 size_t datalen, uint8_t* plaintext);
188HKDS_EXPORT_API
typedef struct
272#if defined(SYSTEM_OPENMP)
HKDS configuration definitions.
#define HKDS_MESSAGE_SIZE
The encrypted message size in bytes.
Definition hkds_config.h:302
#define HKDS_TAG_SIZE
The size of the authentication tag (MAC) in bytes.
Definition hkds_config.h:314
#define HKDS_EDK_SIZE
The Embedded Device Key size for SHAKE-256 in bytes.
Definition hkds_config.h:391
#define HKDS_PARALLEL_DEPTH
The AVX512 depth multiplier.
Definition hkds_config.h:245
#define HKDS_CACHX8_DEPTH
The AVX512 depth multiplier for cache operations.
Definition hkds_config.h:254
#define HKDS_BDK_SIZE
The Base Derivation Key size for SHAKE-256 in bytes.
Definition hkds_config.h:385
#define HKDS_STK_SIZE
The Secret Token Key size for SHAKE-256 in bytes.
Definition hkds_config.h:415
#define HKDS_KSN_SIZE
The Key Serial Number (KSN) size in bytes.
Definition hkds_config.h:296
#define HKDS_DID_SIZE
The device identity size in bytes.
Definition hkds_config.h:272
#define HKDS_KID_SIZE
The master key identity string size in bytes.
Definition hkds_config.h:290
HKDS_EXPORT_API void hkds_server_generate_edk_x8(const hkds_server_x8_state *state, const uint8_t did[HKDS_CACHX8_DEPTH][HKDS_DID_SIZE], uint8_t edk[HKDS_CACHX8_DEPTH][HKDS_EDK_SIZE])
Generate a 2-dimensional x8 set of client embedded device keys.
Definition hkds_server.c:515
HKDS_EXPORT_API void hkds_server_decrypt_message(hkds_server_state *state, const uint8_t *ciphertext, uint8_t *plaintext)
Decrypt a message sent by the client.
Definition hkds_server.c:102
HKDS_EXPORT_API void hkds_server_initialize_state(hkds_server_state *state, hkds_master_key *mdk, const uint8_t *ksn)
Initialize the HKDS server state.
Definition hkds_server.c:224
HKDS_EXPORT_API void hkds_server_decrypt_message_x8(hkds_server_x8_state *state, const uint8_t ciphertext[HKDS_CACHX8_DEPTH][HKDS_MESSAGE_SIZE], uint8_t plaintext[HKDS_CACHX8_DEPTH][HKDS_MESSAGE_SIZE])
Decrypt a 2-dimensional x8 set of client messages.
Definition hkds_server.c:383
HKDS_EXPORT_API void hkds_server_decrypt_verify_message_x8(hkds_server_x8_state *state, const uint8_t ciphertext[HKDS_CACHX8_DEPTH][HKDS_MESSAGE_SIZE+HKDS_TAG_SIZE], const uint8_t data[HKDS_CACHX8_DEPTH][HKDS_MESSAGE_SIZE], size_t datalen, uint8_t plaintext[HKDS_CACHX8_DEPTH][HKDS_MESSAGE_SIZE], bool valid[HKDS_CACHX8_DEPTH])
Verify and decrypt a 2-dimensional x8 set of client messages.
Definition hkds_server.c:461
HKDS_EXPORT_API void hkds_server_generate_mdk(bool(*rng_generate)(uint8_t *, size_t), hkds_master_key *mdk, const uint8_t *kid)
Generate a master key set.
Definition hkds_server.c:214
HKDS_EXPORT_API void hkds_server_generate_edk(const uint8_t *bdk, const uint8_t *did, uint8_t *edk)
Generate the embedded device key (EDK) for a client.
Definition hkds_server.c:146
HKDS_EXPORT_API void hkds_server_initialize_state_x8(hkds_server_x8_state *state, hkds_master_key *mdk, const uint8_t ksn[HKDS_CACHX8_DEPTH][HKDS_KSN_SIZE])
Initialize a 2-dimensional x8 set of server states with client KSNs.
Definition hkds_server.c:539
HKDS_EXPORT_API bool hkds_server_decrypt_verify_message(hkds_server_state *state, const uint8_t *ciphertext, const uint8_t *data, size_t datalen, uint8_t *plaintext)
Verify a ciphertext's integrity with a keyed MAC and decrypt the message.
Definition hkds_server.c:111
HKDS_EXPORT_API void hkds_server_encrypt_token_x8(hkds_server_x8_state *state, uint8_t etok[HKDS_CACHX8_DEPTH][HKDS_STK_SIZE+HKDS_TAG_SIZE])
Encrypt a 2-dimensional x8 set of secret token keys.
Definition hkds_server.c:397
HKDS_EXPORT_API void hkds_server_encrypt_token(hkds_server_state *state, uint8_t *etok)
Encrypt a secret token key to send to the client.
Definition hkds_server.c:164
Contains the HKDS master key set.
Definition hkds_server.h:67
uint8_t bdk[HKDS_BDK_SIZE]
Definition hkds_server.h:68
uint8_t stk[HKDS_STK_SIZE]
Definition hkds_server.h:69
uint8_t kid[HKDS_KID_SIZE]
Definition hkds_server.h:70
Contains the HKDS server state.
Definition hkds_server.h:85
uint8_t ksn[HKDS_KSN_SIZE]
Definition hkds_server.h:86
size_t rate
Definition hkds_server.h:89
size_t count
Definition hkds_server.h:88
hkds_master_key * mdk
Definition hkds_server.h:87
Contains the HKDS parallel x8 server state.
Definition hkds_server.h:189
uint8_t ksn[HKDS_CACHX8_DEPTH][HKDS_KSN_SIZE]
Definition hkds_server.h:190
hkds_master_key * mdk
Definition hkds_server.h:191