|
HKDS: Heirarchal Key Derivation System 1.0.0.2 (A2)
A fast post-quantum secure replacement for DUKPT
|
SHA3 header definition
Contains the public api and documentation for SHA3 digest, SHAKE, cSHAKE, and KMAC implementations.
More...
Go to the source code of this file.
Data Structures | |
| struct | hkds_keccak_state |
| The Keccak state array; state array must be initialized by the caller. More... | |
Macros | |
| #define | HKDS_KECCAK_CSHAKE_DOMAIN_ID 0x04 |
| The cSHAKE domain id. | |
| #define | HKDS_KECCAK_KMAC_DOMAIN_ID 0x04 |
| The KMAC domain id. | |
| #define | HKDS_KECCAK_KPA_DOMAIN_ID 0x41 |
| The KPA domain id. | |
| #define | HKDS_KECCAK_PERMUTATION_ROUNDS 24 |
| The standard number of permutation rounds. | |
| #define | HKDS_KECCAK_PERMUTATION_MAX_ROUNDS 48 |
| The maximum number of permutation rounds. | |
| #define | HKDS_KECCAK_PERMUTATION_MIN_ROUNDS 12 |
| The minimum number of permutation rounds. | |
| #define | HKDS_KECCAK_SHA3_DOMAIN_ID 0x06 |
| The SHA3 domain id. | |
| #define | HKDS_KECCAK_SHAKE_DOMAIN_ID 0x1F |
| The SHAKE domain id. | |
| #define | HKDS_KECCAK_STATE_BYTE_SIZE 200 |
| The Keccak state array byte size. | |
| #define | HKDS_KECCAK_128_RATE 168 |
| The 128-bit absorption rate. | |
| #define | HKDS_KECCAK_256_RATE 136 |
| The 256-bit absorption rate. | |
| #define | HKDS_KECCAK_512_RATE 72 |
| The 512 bit absorption rate. | |
| #define | HKDS_KECCAK_STATE_SIZE 25 |
| The Keccak SHA3 uint64 state array size. | |
| #define | HKDS_KECCAK_STATE_BYTE_SIZE 200 |
| The Keccak state array byte size. | |
| #define | HKDS_KMAC_256_KEY_SIZE 32 |
| The KMAC-256 key size in bytes. | |
| #define | HKDS_KMAC_512_KEY_SIZE 64 |
| The KMAC-512 key size in bytes. | |
| #define | HKDS_KECCAK_SCBKDF_DOMAIN_ID 0x42 |
| The SCBKDF domain id. | |
| #define | HKDS_SHA3_128_HASH_SIZE 16 |
| The HKDS_SHA3_128_HASH_SIZE hash size in bytes (16) | |
| #define | HKDS_SHA3_256_HASH_SIZE 32 |
| The SHA-256 hash size in bytes (32) | |
| #define | HKDS_SHA3_512_HASH_SIZE 64 |
| The SHA-512 hash size in bytes (64) | |
| #define | HKDS_SHAKE_256_KEY_SIZE 32 |
| The SHAKE-256 key size in bytes. | |
| #define | HKDS_SHAKE512_KEY_SIZE 64 |
| The SHAKE-512 key size in bytes. | |
Typedefs | |
| typedef HKDS_EXPORT_API struct hkds_keccak_state | hkds_keccak_state |
| typedef enum hkds_keccak_rate | hkds_keccak_rate |
Enumerations | |
| enum | hkds_keccak_rate { hkds_keccak_rate_none = 0 , hkds_keccak_rate_128 = HKDS_KECCAK_128_RATE , hkds_keccak_rate_256 = HKDS_KECCAK_256_RATE , hkds_keccak_rate_512 = HKDS_KECCAK_512_RATE } |
| The Keccak rate; determines which security strength is used by the function, 128, 256, or 512-bit. More... | |
Functions | |
| HKDS_EXPORT_API void | hkds_keccak_absorb (hkds_keccak_state *ctx, hkds_keccak_rate rate, const uint8_t *message, size_t msglen, uint8_t domain, size_t rounds) |
| Absorb an input message into the Keccak state. | |
| HKDS_EXPORT_API void | hkds_keccak_absorb_custom (hkds_keccak_state *ctx, hkds_keccak_rate rate, const uint8_t *custom, size_t custlen, const uint8_t *name, size_t namelen, size_t rounds) |
| Absorb the custom, and name arrays into the Keccak state. | |
| HKDS_EXPORT_API void | hkds_keccak_absorb_key_custom (hkds_keccak_state *ctx, hkds_keccak_rate rate, const uint8_t *key, size_t keylen, const uint8_t *custom, size_t custlen, const uint8_t *name, size_t namelen, size_t rounds) |
| Absorb the custom, name, and key arrays into the Keccak state. | |
| HKDS_EXPORT_API void | hkds_keccak_dispose (hkds_keccak_state *ctx) |
| Dispose of the Keccak state. | |
| HKDS_EXPORT_API void | hkds_keccak_finalize (hkds_keccak_state *ctx, hkds_keccak_rate rate, uint8_t *output, size_t outlen, uint8_t domain, size_t rounds) |
| Finalize the Keccak state. | |
| HKDS_EXPORT_API void | hkds_keccak_incremental_absorb (hkds_keccak_state *ctx, uint32_t rate, const uint8_t *message, size_t msglen) |
| Absorb bytes into state incrementally. | |
| HKDS_EXPORT_API void | hkds_keccak_incremental_finalize (hkds_keccak_state *ctx, uint32_t rate, uint8_t domain) |
| Finalize state added incrementally. | |
| HKDS_EXPORT_API void | hkds_keccak_incremental_squeeze (hkds_keccak_state *ctx, size_t rate, uint8_t *output, size_t outlen) |
| Extract an array of bytes from the Keccak state. | |
| HKDS_EXPORT_API void | hkds_keccak_permute (hkds_keccak_state *ctx, size_t rounds) |
| The Keccak permute function. Internal function: Permutes the state array, can be used in external constructions. | |
| HKDS_EXPORT_API void | hkds_keccak_permute_p1600c (uint64_t *state, size_t rounds) |
| The compact Keccak permute function. Internal function: Permutes the state array, can be used in external constructions. | |
| HKDS_EXPORT_API void | hkds_keccak_permute_p1600u (uint64_t *state) |
| The unrolled Keccak permute function. Internal function: Permutes the state array, can be used in external constructions. | |
| HKDS_EXPORT_API void | hkds_keccak_squeezeblocks (hkds_keccak_state *ctx, uint8_t *output, size_t nblocks, hkds_keccak_rate rate, size_t rounds) |
| The Keccak squeeze function. | |
| HKDS_EXPORT_API void | hkds_keccak_initialize_state (hkds_keccak_state *ctx) |
| Initializes a Keccak state structure, must be called before message processing. Long form api: must be used in conjunction with the block-update and finalize functions. | |
| HKDS_EXPORT_API void | hkds_keccak_update (hkds_keccak_state *ctx, hkds_keccak_rate rate, const uint8_t *message, size_t msglen, size_t rounds) |
| Update Keccak state with message input. | |
| HKDS_EXPORT_API void | hkds_shake128_compute (uint8_t *output, size_t outlen, const uint8_t *key, size_t keylen) |
| Key a SHAKE-128 instance, and generate an array of pseudo-random bytes. Short form api: processes the key and generates the pseudo-random output with a single call. | |
| HKDS_EXPORT_API void | hkds_shake256_compute (uint8_t *output, size_t outlen, const uint8_t *key, size_t keylen) |
| Key a SHAKE-256 instance, and generate an array of pseudo-random bytes. Short form api: processes the key and generates the pseudo-random output with a single call. | |
| HKDS_EXPORT_API void | hkds_shake512_compute (uint8_t *output, size_t outlen, const uint8_t *key, size_t keylen) |
| Key a SHAKE-512 instance, and generate an array of pseudo-random bytes. Short form api: processes the key and generates the pseudo-random output with a single call. | |
| HKDS_EXPORT_API void | hkds_shake_initialize (hkds_keccak_state *ctx, hkds_keccak_rate rate, const uint8_t *key, size_t keylen) |
| The SHAKE initialize function. Long form api: must be used in conjunction with the squeezeblocks function. Absorb and finalize an input key byte array. | |
| HKDS_EXPORT_API void | hkds_shake_squeezeblocks (hkds_keccak_state *ctx, hkds_keccak_rate rate, uint8_t *output, size_t nblocks) |
| The SHAKE squeeze function. Long form api: must be used in conjunction with the initialize function. Permutes and extracts the state to an output byte array. | |
| HKDS_EXPORT_API void | hkds_kmac128_compute (uint8_t *output, size_t outlen, const uint8_t *message, size_t msglen, const uint8_t *key, size_t keylen, const uint8_t *custom, size_t custlen) |
| Key a KMAC-128 instance and generate a MAC code. Short form api: processes the key and custom inputs and generates the MAC code with a single call. Key the MAC generator process a message and output the MAC code. | |
| HKDS_EXPORT_API void | hkds_kmac256_compute (uint8_t *output, size_t outlen, const uint8_t *message, size_t msglen, const uint8_t *key, size_t keylen, const uint8_t *custom, size_t custlen) |
| Key a KMAC-256 instance and generate a MAC code. Short form api: processes the key and custom inputs and generates the MAC code with a single call. Key the MAC generator process a message and output the MAC code. | |
| HKDS_EXPORT_API void | hkds_kmac512_compute (uint8_t *output, size_t outlen, const uint8_t *message, size_t msglen, const uint8_t *key, size_t keylen, const uint8_t *custom, size_t custlen) |
| Key a KMAC-512 instance and generate a MAC code. Short form api: processes the key and custom inputs and generates the MAC code with a single call. Key the MAC generator process a message and output the MAC code. | |
| HKDS_EXPORT_API void | hkds_kmac_update (hkds_keccak_state *ctx, hkds_keccak_rate rate, const uint8_t *message, size_t msglen) |
| The KMAC message update function. Long form api: must be used in conjunction with the initialize and finalize functions. | |
| HKDS_EXPORT_API void | hkds_kmac_finalize (hkds_keccak_state *ctx, hkds_keccak_rate rate, uint8_t *output, size_t outlen) |
| The KMAC finalize function. Long form api: must be used in conjunction with the initialize and blockupdate functions. Final processing and calculation of the MAC code. | |
| HKDS_EXPORT_API void | hkds_kmac_initialize (hkds_keccak_state *ctx, hkds_keccak_rate rate, const uint8_t *key, size_t keylen, const uint8_t *custom, size_t custlen) |
| Initialize a KMAC instance. Long form api: must be used in conjunction with the blockupdate and finalize functions. Key the MAC generator and initialize the internal state. | |
| HKDS_EXPORT_API void | hkds_shake_128x4 (uint8_t *out0, uint8_t *out1, uint8_t *out2, uint8_t *out3, size_t outlen, const uint8_t *inp0, const uint8_t *inp1, const uint8_t *inp2, const uint8_t *inp3, size_t inplen) |
| Process 4 SHAKE-128 instances simultaneously using SIMD instructions. | |
| HKDS_EXPORT_API void | hkds_shake_256x4 (uint8_t *out0, uint8_t *out1, uint8_t *out2, uint8_t *out3, size_t outlen, const uint8_t *inp0, const uint8_t *inp1, const uint8_t *inp2, const uint8_t *inp3, size_t inplen) |
| Process 4 SHAKE-256 instances simultaneously using SIMD instructions. | |
| HKDS_EXPORT_API void | hkds_shake_512x4 (uint8_t *out0, uint8_t *out1, uint8_t *out2, uint8_t *out3, size_t outlen, const uint8_t *inp0, const uint8_t *inp1, const uint8_t *inp2, const uint8_t *inp3, size_t inplen) |
| Process 4 SHAKE-512 instances simultaneously using SIMD instructions. | |
| HKDS_EXPORT_API void | hkds_shake_128x8 (uint8_t *out0, uint8_t *out1, uint8_t *out2, uint8_t *out3, uint8_t *out4, uint8_t *out5, uint8_t *out6, uint8_t *out7, size_t outlen, const uint8_t *inp0, const uint8_t *inp1, const uint8_t *inp2, const uint8_t *inp3, const uint8_t *inp4, const uint8_t *inp5, const uint8_t *inp6, const uint8_t *inp7, size_t inplen) |
| Process 8 SHAKE-128 instances simultaneously using SIMD instructions. | |
| HKDS_EXPORT_API void | hkds_shake_256x8 (uint8_t *out0, uint8_t *out1, uint8_t *out2, uint8_t *out3, uint8_t *out4, uint8_t *out5, uint8_t *out6, uint8_t *out7, size_t outlen, const uint8_t *inp0, const uint8_t *inp1, const uint8_t *inp2, const uint8_t *inp3, const uint8_t *inp4, const uint8_t *inp5, const uint8_t *inp6, const uint8_t *inp7, size_t inplen) |
| Process 8 SHAKE-256 instances simultaneously using SIMD instructions. | |
| HKDS_EXPORT_API void | hkds_shake_512x8 (uint8_t *out0, uint8_t *out1, uint8_t *out2, uint8_t *out3, uint8_t *out4, uint8_t *out5, uint8_t *out6, uint8_t *out7, size_t outlen, const uint8_t *inp0, const uint8_t *inp1, const uint8_t *inp2, const uint8_t *inp3, const uint8_t *inp4, const uint8_t *inp5, const uint8_t *inp6, const uint8_t *inp7, size_t inplen) |
| Process 8 SHAKE-512 instances simultaneously using SIMD instructions. | |
| HKDS_EXPORT_API void | hkds_kmac_128x4 (uint8_t *out0, uint8_t *out1, uint8_t *out2, uint8_t *out3, size_t outlen, const uint8_t *key0, const uint8_t *key1, const uint8_t *key2, const uint8_t *key3, size_t keylen, const uint8_t *cst0, const uint8_t *cst1, const uint8_t *cst2, const uint8_t *cst3, size_t cstlen, const uint8_t *msg0, const uint8_t *msg1, const uint8_t *msg2, const uint8_t *msg3, size_t msglen) |
| Process 4 KMAC-128 instances simultaneously using SIMD instructions. | |
| HKDS_EXPORT_API void | hkds_kmac_256x4 (uint8_t *out0, uint8_t *out1, uint8_t *out2, uint8_t *out3, size_t outlen, const uint8_t *key0, const uint8_t *key1, const uint8_t *key2, const uint8_t *key3, size_t keylen, const uint8_t *cst0, const uint8_t *cst1, const uint8_t *cst2, const uint8_t *cst3, size_t cstlen, const uint8_t *msg0, const uint8_t *msg1, const uint8_t *msg2, const uint8_t *msg3, size_t msglen) |
| Process 4 KMAC-256 instances simultaneously using SIMD instructions. | |
| HKDS_EXPORT_API void | hkds_kmac_512x4 (uint8_t *out0, uint8_t *out1, uint8_t *out2, uint8_t *out3, size_t outlen, const uint8_t *key0, const uint8_t *key1, const uint8_t *key2, const uint8_t *key3, size_t keylen, const uint8_t *cst0, const uint8_t *cst1, const uint8_t *cst2, const uint8_t *cst3, size_t cstlen, const uint8_t *msg0, const uint8_t *msg1, const uint8_t *msg2, const uint8_t *msg3, size_t msglen) |
| Process 4 KMAC-512 instances simultaneously using SIMD instructions. | |
| HKDS_EXPORT_API void | hkds_kmac_128x8 (uint8_t *out0, uint8_t *out1, uint8_t *out2, uint8_t *out3, uint8_t *out4, uint8_t *out5, uint8_t *out6, uint8_t *out7, size_t outlen, const uint8_t *key0, const uint8_t *key1, const uint8_t *key2, const uint8_t *key3, const uint8_t *key4, const uint8_t *key5, const uint8_t *key6, const uint8_t *key7, size_t keylen, const uint8_t *cst0, const uint8_t *cst1, const uint8_t *cst2, const uint8_t *cst3, const uint8_t *cst4, const uint8_t *cst5, const uint8_t *cst6, const uint8_t *cst7, size_t cstlen, const uint8_t *msg0, const uint8_t *msg1, const uint8_t *msg2, const uint8_t *msg3, const uint8_t *msg4, const uint8_t *msg5, const uint8_t *msg6, const uint8_t *msg7, size_t msglen) |
| Process 8 KMAC-128 instances simultaneously using SIMD instructions. | |
| HKDS_EXPORT_API void | hkds_kmac_256x8 (uint8_t *out0, uint8_t *out1, uint8_t *out2, uint8_t *out3, uint8_t *out4, uint8_t *out5, uint8_t *out6, uint8_t *out7, size_t outlen, const uint8_t *key0, const uint8_t *key1, const uint8_t *key2, const uint8_t *key3, const uint8_t *key4, const uint8_t *key5, const uint8_t *key6, const uint8_t *key7, size_t keylen, const uint8_t *cst0, const uint8_t *cst1, const uint8_t *cst2, const uint8_t *cst3, const uint8_t *cst4, const uint8_t *cst5, const uint8_t *cst6, const uint8_t *cst7, size_t cstlen, const uint8_t *msg0, const uint8_t *msg1, const uint8_t *msg2, const uint8_t *msg3, const uint8_t *msg4, const uint8_t *msg5, const uint8_t *msg6, const uint8_t *msg7, size_t msglen) |
| Process 8 KMAC-256 instances simultaneously using SIMD instructions. | |
| HKDS_EXPORT_API void | hkds_kmac_512x8 (uint8_t *out0, uint8_t *out1, uint8_t *out2, uint8_t *out3, uint8_t *out4, uint8_t *out5, uint8_t *out6, uint8_t *out7, size_t outlen, const uint8_t *key0, const uint8_t *key1, const uint8_t *key2, const uint8_t *key3, const uint8_t *key4, const uint8_t *key5, const uint8_t *key6, const uint8_t *key7, size_t keylen, const uint8_t *cst0, const uint8_t *cst1, const uint8_t *cst2, const uint8_t *cst3, const uint8_t *cst4, const uint8_t *cst5, const uint8_t *cst6, const uint8_t *cst7, size_t cstlen, const uint8_t *msg0, const uint8_t *msg1, const uint8_t *msg2, const uint8_t *msg3, const uint8_t *msg4, const uint8_t *msg5, const uint8_t *msg6, const uint8_t *msg7, size_t msglen) |
| Process 8 KMAC-512 instances simultaneously using SIMD instructions. | |
SHA3 header definition
Contains the public api and documentation for SHA3 digest, SHAKE, cSHAKE, and KMAC implementations.
Usage Examples
SHA3-512 hash computation using long-form api
KMAC-256 MAC code generation using long-form api
cSHAKE-512 pseudo-random generation using long-form api
For additional usage examples, see sha3_test.h.
| #define HKDS_KECCAK_STATE_BYTE_SIZE 200 |
The Keccak state array byte size.
The Keccak SHA3 state size in bytes.
| #define HKDS_KECCAK_STATE_BYTE_SIZE 200 |
The Keccak state array byte size.
The Keccak SHA3 state size in bytes.
| enum hkds_keccak_rate |
| HKDS_EXPORT_API void hkds_keccak_absorb | ( | hkds_keccak_state * | ctx, |
| hkds_keccak_rate | rate, | ||
| const uint8_t * | message, | ||
| size_t | msglen, | ||
| uint8_t | domain, | ||
| size_t | rounds ) |
Absorb an input message into the Keccak state.
| ctx | [struct] A reference to the Keccak state; must be initialized |
| rate | The rate of absorption in bytes |
| message | [const] The input message byte array |
| msglen | The number of message bytes to process |
| domain | The function domain id |
| rounds | The number of permutation rounds, the default is 24, maximum is 48 |
| HKDS_EXPORT_API void hkds_keccak_absorb_custom | ( | hkds_keccak_state * | ctx, |
| hkds_keccak_rate | rate, | ||
| const uint8_t * | custom, | ||
| size_t | custlen, | ||
| const uint8_t * | name, | ||
| size_t | namelen, | ||
| size_t | rounds ) |
Absorb the custom, and name arrays into the Keccak state.
| ctx | [struct] The Keccak state structure |
| rate | The rate of absorption in bytes |
| custom | [const] The customization string |
| custlen | The byte length of the customization string |
| name | [const] The function name string |
| namelen | The byte length of the function name |
| rounds | The number of permutation rounds, the default is 24, maximum is 48 |
| HKDS_EXPORT_API void hkds_keccak_absorb_key_custom | ( | hkds_keccak_state * | ctx, |
| hkds_keccak_rate | rate, | ||
| const uint8_t * | key, | ||
| size_t | keylen, | ||
| const uint8_t * | custom, | ||
| size_t | custlen, | ||
| const uint8_t * | name, | ||
| size_t | namelen, | ||
| size_t | rounds ) |
Absorb the custom, name, and key arrays into the Keccak state.
| ctx | [struct] The Keccak state structure |
| rate | The rate of absorption in bytes |
| key | [const] The input key byte array |
| keylen | The number of key bytes to process |
| custom | [const] The customization string |
| custlen | The byte length of the customization string |
| name | [const] The function name string |
| namelen | The byte length of the function name |
| rounds | The number of permutation rounds, the default is 24, maximum is 48 |
| HKDS_EXPORT_API void hkds_keccak_dispose | ( | hkds_keccak_state * | ctx | ) |
Dispose of the Keccak state.
| ctx | [struct] The Keccak state structure |
| HKDS_EXPORT_API void hkds_keccak_finalize | ( | hkds_keccak_state * | ctx, |
| hkds_keccak_rate | rate, | ||
| uint8_t * | output, | ||
| size_t | outlen, | ||
| uint8_t | domain, | ||
| size_t | rounds ) |
Finalize the Keccak state.
| ctx | [struct] The Keccak state structure |
| rate | The rate of absorption in bytes |
| output | The output byte array |
| outlen | The number of output bytes to generate |
| domain | The function domain id |
| rounds | The number of permutation rounds, the default is 24, maximum is 48 |
| HKDS_EXPORT_API void hkds_keccak_incremental_absorb | ( | hkds_keccak_state * | ctx, |
| uint32_t | rate, | ||
| const uint8_t * | message, | ||
| size_t | msglen ) |
Absorb bytes into state incrementally.
| ctx | The function state |
| rate | The rate of absorption in bytes |
| message | [const] The input message array |
| msglen | The number of message bytes |
| HKDS_EXPORT_API void hkds_keccak_incremental_finalize | ( | hkds_keccak_state * | ctx, |
| uint32_t | rate, | ||
| uint8_t | domain ) |
Finalize state added incrementally.
| ctx | The function state |
| rate | The rate of absorption in bytes |
| domain | The function domain id |
| HKDS_EXPORT_API void hkds_keccak_incremental_squeeze | ( | hkds_keccak_state * | ctx, |
| size_t | rate, | ||
| uint8_t * | output, | ||
| size_t | outlen ) |
Extract an array of bytes from the Keccak state.
| ctx | The function state |
| output | The output byte array |
| outlen | The number of output bytes to generate |
| rate | The rate of absorption in bytes |
| HKDS_EXPORT_API void hkds_keccak_initialize_state | ( | hkds_keccak_state * | ctx | ) |
Initializes a Keccak state structure, must be called before message processing. Long form api: must be used in conjunction with the block-update and finalize functions.
| ctx | [struct] A reference to the Keccak state; must be initialized |
| HKDS_EXPORT_API void hkds_keccak_permute | ( | hkds_keccak_state * | ctx, |
| size_t | rounds ) |
The Keccak permute function. Internal function: Permutes the state array, can be used in external constructions.
| ctx | [struct] The function state; must be initialized |
| rounds | The number of permutation rounds, the default and maximum is 24 |
| HKDS_EXPORT_API void hkds_keccak_permute_p1600c | ( | uint64_t * | state, |
| size_t | rounds ) |
The compact Keccak permute function. Internal function: Permutes the state array, can be used in external constructions.
| state | The state array; must be initialized |
| rounds | The number of permutation rounds, the default and maximum is 24 |
| HKDS_EXPORT_API void hkds_keccak_permute_p1600u | ( | uint64_t * | state | ) |
The unrolled Keccak permute function. Internal function: Permutes the state array, can be used in external constructions.
| state | The state array; must be initialized |
| HKDS_EXPORT_API void hkds_keccak_squeezeblocks | ( | hkds_keccak_state * | ctx, |
| uint8_t * | output, | ||
| size_t | nblocks, | ||
| hkds_keccak_rate | rate, | ||
| size_t | rounds ) |
The Keccak squeeze function.
| ctx | [struct] A reference to the Keccak state; must be initialized |
| output | The output byte array |
| nblocks | The number of blocks to extract |
| rate | The rate of absorption in bytes |
| rounds | The number of permutation rounds, the default and maximum is 24 |
| HKDS_EXPORT_API void hkds_keccak_update | ( | hkds_keccak_state * | ctx, |
| hkds_keccak_rate | rate, | ||
| const uint8_t * | message, | ||
| size_t | msglen, | ||
| size_t | rounds ) |
Update Keccak state with message input.
| ctx | [struct] A reference to the Keccak state; must be initialized |
| rate | The rate of absorption in bytes |
| message | [const] The input message byte array |
| msglen | The number of message bytes to process |
| rounds | The number of permutation rounds, the default and maximum is 24 |
| HKDS_EXPORT_API void hkds_kmac128_compute | ( | uint8_t * | output, |
| size_t | outlen, | ||
| const uint8_t * | message, | ||
| size_t | msglen, | ||
| const uint8_t * | key, | ||
| size_t | keylen, | ||
| const uint8_t * | custom, | ||
| size_t | custlen ) |
Key a KMAC-128 instance and generate a MAC code. Short form api: processes the key and custom inputs and generates the MAC code with a single call. Key the MAC generator process a message and output the MAC code.
| output | The MAC code byte array |
| outlen | The number of MAC code bytes to generate |
| message | [const] The message input byte array |
| msglen | The number of message bytes to process |
| key | [const] The input key byte array |
| keylen | The number of key bytes to process |
| custom | [const] The customization string |
| custlen | The byte length of the customization string |
| HKDS_EXPORT_API void hkds_kmac256_compute | ( | uint8_t * | output, |
| size_t | outlen, | ||
| const uint8_t * | message, | ||
| size_t | msglen, | ||
| const uint8_t * | key, | ||
| size_t | keylen, | ||
| const uint8_t * | custom, | ||
| size_t | custlen ) |
Key a KMAC-256 instance and generate a MAC code. Short form api: processes the key and custom inputs and generates the MAC code with a single call. Key the MAC generator process a message and output the MAC code.
| output | The MAC code byte array |
| outlen | The number of MAC code bytes to generate |
| message | [const] The message input byte array |
| msglen | The number of message bytes to process |
| key | [const] The input key byte array |
| keylen | The number of key bytes to process |
| custom | [const] The customization string |
| custlen | The byte length of the customization string |
| HKDS_EXPORT_API void hkds_kmac512_compute | ( | uint8_t * | output, |
| size_t | outlen, | ||
| const uint8_t * | message, | ||
| size_t | msglen, | ||
| const uint8_t * | key, | ||
| size_t | keylen, | ||
| const uint8_t * | custom, | ||
| size_t | custlen ) |
Key a KMAC-512 instance and generate a MAC code. Short form api: processes the key and custom inputs and generates the MAC code with a single call. Key the MAC generator process a message and output the MAC code.
| output | The MAC code byte array |
| outlen | The number of MAC code bytes to generate |
| message | [const] The message input byte array |
| msglen | The number of message bytes to process |
| key | [const] The input key byte array |
| keylen | The number of key bytes to process |
| custom | [const] The customization string |
| custlen | The byte length of the customization string |
| HKDS_EXPORT_API void hkds_kmac_128x4 | ( | uint8_t * | out0, |
| uint8_t * | out1, | ||
| uint8_t * | out2, | ||
| uint8_t * | out3, | ||
| size_t | outlen, | ||
| const uint8_t * | key0, | ||
| const uint8_t * | key1, | ||
| const uint8_t * | key2, | ||
| const uint8_t * | key3, | ||
| size_t | keylen, | ||
| const uint8_t * | cst0, | ||
| const uint8_t * | cst1, | ||
| const uint8_t * | cst2, | ||
| const uint8_t * | cst3, | ||
| size_t | cstlen, | ||
| const uint8_t * | msg0, | ||
| const uint8_t * | msg1, | ||
| const uint8_t * | msg2, | ||
| const uint8_t * | msg3, | ||
| size_t | msglen ) |
Process 4 KMAC-128 instances simultaneously using SIMD instructions.
| out0 | The 1st output array |
| out1 | The 2nd output array |
| out2 | The 3rd output array |
| out3 | The 4th output array |
| outlen | The length of the output arrays |
| key0 | [const] The 1st key array |
| key1 | [const] The 2nd key array |
| key2 | [const] The 3rd key array |
| key3 | [const] The 4th key array |
| keylen | The length of the input key arrays |
| cst0 | [const] The 1st custom array |
| cst1 | [const] The 2nd custom array |
| cst2 | [const] The 3rd custom array |
| cst3 | [const] The 4th custom array |
| cstlen | The length of the custom arrays |
| msg0 | [const] The 1st message array |
| msg1 | [const] The 2nd message array |
| msg2 | [const] The 3rd message array |
| msg3 | [const] The 4th message array |
| msglen | The length of the message arrays |
| HKDS_EXPORT_API void hkds_kmac_128x8 | ( | uint8_t * | out0, |
| uint8_t * | out1, | ||
| uint8_t * | out2, | ||
| uint8_t * | out3, | ||
| uint8_t * | out4, | ||
| uint8_t * | out5, | ||
| uint8_t * | out6, | ||
| uint8_t * | out7, | ||
| size_t | outlen, | ||
| const uint8_t * | key0, | ||
| const uint8_t * | key1, | ||
| const uint8_t * | key2, | ||
| const uint8_t * | key3, | ||
| const uint8_t * | key4, | ||
| const uint8_t * | key5, | ||
| const uint8_t * | key6, | ||
| const uint8_t * | key7, | ||
| size_t | keylen, | ||
| const uint8_t * | cst0, | ||
| const uint8_t * | cst1, | ||
| const uint8_t * | cst2, | ||
| const uint8_t * | cst3, | ||
| const uint8_t * | cst4, | ||
| const uint8_t * | cst5, | ||
| const uint8_t * | cst6, | ||
| const uint8_t * | cst7, | ||
| size_t | cstlen, | ||
| const uint8_t * | msg0, | ||
| const uint8_t * | msg1, | ||
| const uint8_t * | msg2, | ||
| const uint8_t * | msg3, | ||
| const uint8_t * | msg4, | ||
| const uint8_t * | msg5, | ||
| const uint8_t * | msg6, | ||
| const uint8_t * | msg7, | ||
| size_t | msglen ) |
Process 8 KMAC-128 instances simultaneously using SIMD instructions.
| out0 | The 1st output array |
| out1 | The 2nd output array |
| out2 | The 3rd output array |
| out3 | The 4th output array |
| out4 | The 5th output array |
| out5 | The 6th output array |
| out6 | The 7th output array |
| out7 | The 8th output array |
| outlen | The length of the output arrays |
| key0 | [const] The 1st key array |
| key1 | [const] The 2nd key array |
| key2 | [const] The 3rd key array |
| key3 | [const] The 4th key array |
| key4 | [const] The 5th key array |
| key5 | [const] The 6th key array |
| key6 | [const] The 7th key array |
| key7 | [const] The 8th key array |
| keylen | The length of the key arrays |
| cst0 | [const] The 1st custom array |
| cst1 | [const] The 2nd custom array |
| cst2 | [const] The 3rd custom array |
| cst3 | [const] The 4th custom array |
| cst4 | [const] The 5th custom array |
| cst5 | [const] The 6th custom array |
| cst6 | [const] The 7th custom array |
| cst7 | [const] The 8th custom array |
| cstlen | The length of the custom arrays |
| msg0 | [const] The 1st message array |
| msg1 | [const] The 2nd message array |
| msg2 | [const] The 3rd message array |
| msg3 | [const] The 4th message array |
| msg4 | [const] The 5th message array |
| msg5 | [const] The 6th message array |
| msg6 | [const] The 7th message array |
| msg7 | [const] The 8th message array |
| msglen | The length of the message arrays |
| HKDS_EXPORT_API void hkds_kmac_256x4 | ( | uint8_t * | out0, |
| uint8_t * | out1, | ||
| uint8_t * | out2, | ||
| uint8_t * | out3, | ||
| size_t | outlen, | ||
| const uint8_t * | key0, | ||
| const uint8_t * | key1, | ||
| const uint8_t * | key2, | ||
| const uint8_t * | key3, | ||
| size_t | keylen, | ||
| const uint8_t * | cst0, | ||
| const uint8_t * | cst1, | ||
| const uint8_t * | cst2, | ||
| const uint8_t * | cst3, | ||
| size_t | cstlen, | ||
| const uint8_t * | msg0, | ||
| const uint8_t * | msg1, | ||
| const uint8_t * | msg2, | ||
| const uint8_t * | msg3, | ||
| size_t | msglen ) |
Process 4 KMAC-256 instances simultaneously using SIMD instructions.
| out0 | The 1st output array |
| out1 | The 2nd output array |
| out2 | The 3rd output array |
| out3 | The 4th output array |
| outlen | The length of the output arrays |
| key0 | [const] The 1st key array |
| key1 | [const] The 2nd key array |
| key2 | [const] The 3rd key array |
| key3 | [const] The 4th key array |
| keylen | The length of the input key arrays |
| cst0 | [const] The 1st custom array |
| cst1 | [const] The 2nd custom array |
| cst2 | [const] The 3rd custom array |
| cst3 | [const] The 4th custom array |
| cstlen | The length of the custom arrays |
| msg0 | [const] The 1st message array |
| msg1 | [const] The 2nd message array |
| msg2 | [const] The 3rd message array |
| msg3 | [const] The 4th message array |
| msglen | The length of the message arrays |
| HKDS_EXPORT_API void hkds_kmac_256x8 | ( | uint8_t * | out0, |
| uint8_t * | out1, | ||
| uint8_t * | out2, | ||
| uint8_t * | out3, | ||
| uint8_t * | out4, | ||
| uint8_t * | out5, | ||
| uint8_t * | out6, | ||
| uint8_t * | out7, | ||
| size_t | outlen, | ||
| const uint8_t * | key0, | ||
| const uint8_t * | key1, | ||
| const uint8_t * | key2, | ||
| const uint8_t * | key3, | ||
| const uint8_t * | key4, | ||
| const uint8_t * | key5, | ||
| const uint8_t * | key6, | ||
| const uint8_t * | key7, | ||
| size_t | keylen, | ||
| const uint8_t * | cst0, | ||
| const uint8_t * | cst1, | ||
| const uint8_t * | cst2, | ||
| const uint8_t * | cst3, | ||
| const uint8_t * | cst4, | ||
| const uint8_t * | cst5, | ||
| const uint8_t * | cst6, | ||
| const uint8_t * | cst7, | ||
| size_t | cstlen, | ||
| const uint8_t * | msg0, | ||
| const uint8_t * | msg1, | ||
| const uint8_t * | msg2, | ||
| const uint8_t * | msg3, | ||
| const uint8_t * | msg4, | ||
| const uint8_t * | msg5, | ||
| const uint8_t * | msg6, | ||
| const uint8_t * | msg7, | ||
| size_t | msglen ) |
Process 8 KMAC-256 instances simultaneously using SIMD instructions.
| out0 | The 1st output array |
| out1 | The 2nd output array |
| out2 | The 3rd output array |
| out3 | The 4th output array |
| out4 | The 5th output array |
| out5 | The 6th output array |
| out6 | The 7th output array |
| out7 | The 8th output array |
| outlen | The length of the output arrays |
| key0 | [const] The 1st key array |
| key1 | [const] The 2nd key array |
| key2 | [const] The 3rd key array |
| key3 | [const] The 4th key array |
| key4 | [const] The 5th key array |
| key5 | [const] The 6th key array |
| key6 | [const] The 7th key array |
| key7 | [const] The 8th key array |
| keylen | The length of the key arrays |
| cst0 | [const] The 1st custom array |
| cst1 | [const] The 2nd custom array |
| cst2 | [const] The 3rd custom array |
| cst3 | [const] The 4th custom array |
| cst4 | [const] The 5th custom array |
| cst5 | [const] The 6th custom array |
| cst6 | [const] The 7th custom array |
| cst7 | [const] The 8th custom array |
| cstlen | The length of the custom arrays |
| msg0 | [const] The 1st message array |
| msg1 | [const] The 2nd message array |
| msg2 | [const] The 3rd message array |
| msg3 | [const] The 4th message array |
| msg4 | [const] The 5th message array |
| msg5 | [const] The 6th message array |
| msg6 | [const] The 7th message array |
| msg7 | [const] The 8th message array |
| msglen | The length of the message arrays |
| HKDS_EXPORT_API void hkds_kmac_512x4 | ( | uint8_t * | out0, |
| uint8_t * | out1, | ||
| uint8_t * | out2, | ||
| uint8_t * | out3, | ||
| size_t | outlen, | ||
| const uint8_t * | key0, | ||
| const uint8_t * | key1, | ||
| const uint8_t * | key2, | ||
| const uint8_t * | key3, | ||
| size_t | keylen, | ||
| const uint8_t * | cst0, | ||
| const uint8_t * | cst1, | ||
| const uint8_t * | cst2, | ||
| const uint8_t * | cst3, | ||
| size_t | cstlen, | ||
| const uint8_t * | msg0, | ||
| const uint8_t * | msg1, | ||
| const uint8_t * | msg2, | ||
| const uint8_t * | msg3, | ||
| size_t | msglen ) |
Process 4 KMAC-512 instances simultaneously using SIMD instructions.
| out0 | The 1st output array |
| out1 | The 2nd output array |
| out2 | The 3rd output array |
| out3 | The 4th output array |
| outlen | The length of the output arrays |
| key0 | [const] The 1st key array |
| key1 | [const] The 2nd key array |
| key2 | [const] The 3rd key array |
| key3 | [const] The 4th key array |
| keylen | The length of the input key arrays |
| cst0 | [const] The 1st custom array |
| cst1 | [const] The 2nd custom array |
| cst2 | [const] The 3rd custom array |
| cst3 | [const] The 4th custom array |
| cstlen | The length of the custom arrays |
| msg0 | [const] The 1st message array |
| msg1 | [const] The 2nd message array |
| msg2 | [const] The 3rd message array |
| msg3 | [const] The 4th message array |
| msglen | The length of the message arrays |
| HKDS_EXPORT_API void hkds_kmac_512x8 | ( | uint8_t * | out0, |
| uint8_t * | out1, | ||
| uint8_t * | out2, | ||
| uint8_t * | out3, | ||
| uint8_t * | out4, | ||
| uint8_t * | out5, | ||
| uint8_t * | out6, | ||
| uint8_t * | out7, | ||
| size_t | outlen, | ||
| const uint8_t * | key0, | ||
| const uint8_t * | key1, | ||
| const uint8_t * | key2, | ||
| const uint8_t * | key3, | ||
| const uint8_t * | key4, | ||
| const uint8_t * | key5, | ||
| const uint8_t * | key6, | ||
| const uint8_t * | key7, | ||
| size_t | keylen, | ||
| const uint8_t * | cst0, | ||
| const uint8_t * | cst1, | ||
| const uint8_t * | cst2, | ||
| const uint8_t * | cst3, | ||
| const uint8_t * | cst4, | ||
| const uint8_t * | cst5, | ||
| const uint8_t * | cst6, | ||
| const uint8_t * | cst7, | ||
| size_t | cstlen, | ||
| const uint8_t * | msg0, | ||
| const uint8_t * | msg1, | ||
| const uint8_t * | msg2, | ||
| const uint8_t * | msg3, | ||
| const uint8_t * | msg4, | ||
| const uint8_t * | msg5, | ||
| const uint8_t * | msg6, | ||
| const uint8_t * | msg7, | ||
| size_t | msglen ) |
Process 8 KMAC-512 instances simultaneously using SIMD instructions.
| out0 | The 1st output array |
| out1 | The 2nd output array |
| out2 | The 3rd output array |
| out3 | The 4th output array |
| out4 | The 5th output array |
| out5 | The 6th output array |
| out6 | The 7th output array |
| out7 | The 8th output array |
| outlen | The length of the output arrays |
| key0 | [const] The 1st key array |
| key1 | [const] The 2nd key array |
| key2 | [const] The 3rd key array |
| key3 | [const] The 4th key array |
| key4 | [const] The 5th key array |
| key5 | [const] The 6th key array |
| key6 | [const] The 7th key array |
| key7 | [const] The 8th key array |
| keylen | The length of the key arrays |
| cst0 | [const] The 1st custom array |
| cst1 | [const] The 2nd custom array |
| cst2 | [const] The 3rd custom array |
| cst3 | [const] The 4th custom array |
| cst4 | [const] The 5th custom array |
| cst5 | [const] The 6th custom array |
| cst6 | [const] The 7th custom array |
| cst7 | [const] The 8th custom array |
| cstlen | The length of the custom arrays |
| msg0 | [const] The 1st message array |
| msg1 | [const] The 2nd message array |
| msg2 | [const] The 3rd message array |
| msg3 | [const] The 4th message array |
| msg4 | [const] The 5th message array |
| msg5 | [const] The 6th message array |
| msg6 | [const] The 7th message array |
| msg7 | [const] The 8th message array |
| msglen | The length of the message arrays |
| HKDS_EXPORT_API void hkds_kmac_finalize | ( | hkds_keccak_state * | ctx, |
| hkds_keccak_rate | rate, | ||
| uint8_t * | output, | ||
| size_t | outlen ) |
The KMAC finalize function. Long form api: must be used in conjunction with the initialize and blockupdate functions. Final processing and calculation of the MAC code.
| ctx | [struct] A reference to the Keccak state; must be initialized |
| rate | The rate of absorption in bytes |
| output | The output byte array |
| outlen | The number of bytes to extract |
| HKDS_EXPORT_API void hkds_kmac_initialize | ( | hkds_keccak_state * | ctx, |
| hkds_keccak_rate | rate, | ||
| const uint8_t * | key, | ||
| size_t | keylen, | ||
| const uint8_t * | custom, | ||
| size_t | custlen ) |
Initialize a KMAC instance. Long form api: must be used in conjunction with the blockupdate and finalize functions. Key the MAC generator and initialize the internal state.
| ctx | [struct] A reference to the keccak state; must be initialized |
| rate | The rate of absorption in bytes |
| key | [const] The input key byte array |
| keylen | The number of key bytes to process |
| custom | [const] The customization string |
| custlen | The byte length of the customization string |
| HKDS_EXPORT_API void hkds_kmac_update | ( | hkds_keccak_state * | ctx, |
| hkds_keccak_rate | rate, | ||
| const uint8_t * | message, | ||
| size_t | msglen ) |
The KMAC message update function. Long form api: must be used in conjunction with the initialize and finalize functions.
| ctx | [struct] A reference to the Keccak state; must be initialized |
| rate | The rate of absorption in bytes |
| message | [const] The message input byte array |
| msglen | The number of message bytes to process |
| HKDS_EXPORT_API void hkds_shake128_compute | ( | uint8_t * | output, |
| size_t | outlen, | ||
| const uint8_t * | key, | ||
| size_t | keylen ) |
Key a SHAKE-128 instance, and generate an array of pseudo-random bytes. Short form api: processes the key and generates the pseudo-random output with a single call.
| output | The output byte array |
| outlen | The number of output bytes to generate |
| key | [const] The input key byte array |
| keylen | The number of key bytes to process |
| HKDS_EXPORT_API void hkds_shake256_compute | ( | uint8_t * | output, |
| size_t | outlen, | ||
| const uint8_t * | key, | ||
| size_t | keylen ) |
Key a SHAKE-256 instance, and generate an array of pseudo-random bytes. Short form api: processes the key and generates the pseudo-random output with a single call.
| output | The output byte array |
| outlen | The number of output bytes to generate |
| key | [const] The input key byte array |
| keylen | The number of key bytes to process |
| HKDS_EXPORT_API void hkds_shake512_compute | ( | uint8_t * | output, |
| size_t | outlen, | ||
| const uint8_t * | key, | ||
| size_t | keylen ) |
Key a SHAKE-512 instance, and generate an array of pseudo-random bytes. Short form api: processes the key and generates the pseudo-random output with a single call.
| output | The output byte array |
| outlen | The number of output bytes to generate |
| key | [const] The input key byte array |
| keylen | The number of key bytes to process |
| HKDS_EXPORT_API void hkds_shake_128x4 | ( | uint8_t * | out0, |
| uint8_t * | out1, | ||
| uint8_t * | out2, | ||
| uint8_t * | out3, | ||
| size_t | outlen, | ||
| const uint8_t * | inp0, | ||
| const uint8_t * | inp1, | ||
| const uint8_t * | inp2, | ||
| const uint8_t * | inp3, | ||
| size_t | inplen ) |
Process 4 SHAKE-128 instances simultaneously using SIMD instructions.
| out0 | The 1st output array |
| out1 | The 2nd output array |
| out2 | The 3rd output array |
| out3 | The 4th output array |
| outlen | The length of the output arrays |
| inp0 | [const] The 1st input key array |
| inp1 | [const] The 2nd input key array |
| inp2 | [const] The 3rd input key array |
| inp3 | [const] The 4th input key array |
| inplen | The length of the input key arrays |
| HKDS_EXPORT_API void hkds_shake_128x8 | ( | uint8_t * | out0, |
| uint8_t * | out1, | ||
| uint8_t * | out2, | ||
| uint8_t * | out3, | ||
| uint8_t * | out4, | ||
| uint8_t * | out5, | ||
| uint8_t * | out6, | ||
| uint8_t * | out7, | ||
| size_t | outlen, | ||
| const uint8_t * | inp0, | ||
| const uint8_t * | inp1, | ||
| const uint8_t * | inp2, | ||
| const uint8_t * | inp3, | ||
| const uint8_t * | inp4, | ||
| const uint8_t * | inp5, | ||
| const uint8_t * | inp6, | ||
| const uint8_t * | inp7, | ||
| size_t | inplen ) |
Process 8 SHAKE-128 instances simultaneously using SIMD instructions.
| out0 | The 1st output array |
| out1 | The 2nd output array |
| out2 | The 3rd output array |
| out3 | The 4th output array |
| out4 | The 5th output array |
| out5 | The 6th output array |
| out6 | The 7th output array |
| out7 | The 8th output array |
| outlen | The length of the output arrays |
| inp0 | [const] The 1st input key array |
| inp1 | [const] The 2nd input key array |
| inp2 | [const] The 3rd input key array |
| inp3 | [const] The 4th input key array |
| inp4 | [const] The 5th input key array |
| inp5 | [const] The 6th input key array |
| inp6 | [const] The 7th input key array |
| inp7 | [const] The 8th input key array |
| inplen | The length of the input key arrays |
| HKDS_EXPORT_API void hkds_shake_256x4 | ( | uint8_t * | out0, |
| uint8_t * | out1, | ||
| uint8_t * | out2, | ||
| uint8_t * | out3, | ||
| size_t | outlen, | ||
| const uint8_t * | inp0, | ||
| const uint8_t * | inp1, | ||
| const uint8_t * | inp2, | ||
| const uint8_t * | inp3, | ||
| size_t | inplen ) |
Process 4 SHAKE-256 instances simultaneously using SIMD instructions.
| out0 | The 1st output array |
| out1 | The 2nd output array |
| out2 | The 3rd output array |
| out3 | The 4th output array |
| outlen | The length of the output arrays |
| inp0 | [const] The 1st input key array |
| inp1 | [const] The 2nd input key array |
| inp2 | [const] The 3rd input key array |
| inp3 | [const] The 4th input key array |
| inplen | The length of the input key arrays |
| HKDS_EXPORT_API void hkds_shake_256x8 | ( | uint8_t * | out0, |
| uint8_t * | out1, | ||
| uint8_t * | out2, | ||
| uint8_t * | out3, | ||
| uint8_t * | out4, | ||
| uint8_t * | out5, | ||
| uint8_t * | out6, | ||
| uint8_t * | out7, | ||
| size_t | outlen, | ||
| const uint8_t * | inp0, | ||
| const uint8_t * | inp1, | ||
| const uint8_t * | inp2, | ||
| const uint8_t * | inp3, | ||
| const uint8_t * | inp4, | ||
| const uint8_t * | inp5, | ||
| const uint8_t * | inp6, | ||
| const uint8_t * | inp7, | ||
| size_t | inplen ) |
Process 8 SHAKE-256 instances simultaneously using SIMD instructions.
| out0 | The 1st output array |
| out1 | The 2nd output array |
| out2 | The 3rd output array |
| out3 | The 4th output array |
| out4 | The 5th output array |
| out5 | The 6th output array |
| out6 | The 7th output array |
| out7 | The 8th output array |
| outlen | The length of the output arrays |
| [const] | inp0: The 1st input key array |
| [const] | inp1: The 2nd input key array |
| [const] | inp2: The 3rd input key array |
| [const] | inp3: The 4th input key array |
| [const] | inp4: The 5th input key array |
| [const] | inp5: The 6th input key array |
| [const] | inp6: The 7th input key array |
| [const] | inp7: The 8th input key array |
| inplen | The length of the input key arrays |
| HKDS_EXPORT_API void hkds_shake_512x4 | ( | uint8_t * | out0, |
| uint8_t * | out1, | ||
| uint8_t * | out2, | ||
| uint8_t * | out3, | ||
| size_t | outlen, | ||
| const uint8_t * | inp0, | ||
| const uint8_t * | inp1, | ||
| const uint8_t * | inp2, | ||
| const uint8_t * | inp3, | ||
| size_t | inplen ) |
Process 4 SHAKE-512 instances simultaneously using SIMD instructions.
| out0 | The 1st output array |
| out1 | The 2nd output array |
| out2 | The 3rd output array |
| out3 | The 4th output array |
| outlen | The length of the output arrays |
| inp0 | [const] The 1st input key array |
| inp1 | [const] The 2nd input key array |
| inp2 | [const] The 3rd input key array |
| inp3 | [const] The 4th input key array |
| inplen | The length of the input key arrays |
| HKDS_EXPORT_API void hkds_shake_512x8 | ( | uint8_t * | out0, |
| uint8_t * | out1, | ||
| uint8_t * | out2, | ||
| uint8_t * | out3, | ||
| uint8_t * | out4, | ||
| uint8_t * | out5, | ||
| uint8_t * | out6, | ||
| uint8_t * | out7, | ||
| size_t | outlen, | ||
| const uint8_t * | inp0, | ||
| const uint8_t * | inp1, | ||
| const uint8_t * | inp2, | ||
| const uint8_t * | inp3, | ||
| const uint8_t * | inp4, | ||
| const uint8_t * | inp5, | ||
| const uint8_t * | inp6, | ||
| const uint8_t * | inp7, | ||
| size_t | inplen ) |
Process 8 SHAKE-512 instances simultaneously using SIMD instructions.
| out0 | The 1st output array |
| out1 | The 2nd output array |
| out2 | The 3rd output array |
| out3 | The 4th output array |
| out4 | The 5th output array |
| out5 | The 6th output array |
| out6 | The 7th output array |
| out7 | The 8th output array |
| outlen | The length of the output arrays |
| inp0 | [const] The 1st input key array |
| inp1 | [const] The 2nd input key array |
| inp2 | [const] The 3rd input key array |
| inp3 | [const] The 4th input key array |
| inp4 | [const] The 5th input key array |
| inp5 | [const] The 6th input key array |
| inp6 | [const] The 7th input key array |
| inp7 | [const] The 8th input key array |
| inplen | The length of the input key arrays |
| HKDS_EXPORT_API void hkds_shake_initialize | ( | hkds_keccak_state * | ctx, |
| hkds_keccak_rate | rate, | ||
| const uint8_t * | key, | ||
| size_t | keylen ) |
The SHAKE initialize function. Long form api: must be used in conjunction with the squeezeblocks function. Absorb and finalize an input key byte array.
| ctx | [struct] A reference to the Keccak state; must be initialized |
| rate | The rate of absorption in bytes |
| key | [const] The input key byte array |
| keylen | The number of key bytes to process |
| HKDS_EXPORT_API void hkds_shake_squeezeblocks | ( | hkds_keccak_state * | ctx, |
| hkds_keccak_rate | rate, | ||
| uint8_t * | output, | ||
| size_t | nblocks ) |
The SHAKE squeeze function. Long form api: must be used in conjunction with the initialize function. Permutes and extracts the state to an output byte array.
| ctx | [struct] A reference to the Keccak state; must be initialized |
| rate | The rate of absorption in bytes |
| output | The output byte array |
| nblocks | The number of blocks to extract |