4 #ifndef OPENTITAN_SW_DEVICE_LIB_CRYPTO_DRIVERS_KMAC_H_
5 #define OPENTITAN_SW_DEVICE_LIB_CRYPTO_DRIVERS_KMAC_H_
12 #include "sw/device/lib/crypto/impl/status.h"
23 kKmacPrefixMaxSize = 36,
25 kKmacCustStrMaxSize = 32,
28 kKmacSideloadKeyLength = 256,
30 kSha3_224DigestBytes = 224 / 8,
32 kSha3_224DigestWords = kSha3_224DigestBytes /
sizeof(uint32_t),
34 kSha3_256DigestBytes = 256 / 8,
36 kSha3_256DigestWords = kSha3_256DigestBytes /
sizeof(uint32_t),
38 kSha3_384DigestBytes = 384 / 8,
40 kSha3_384DigestWords = kSha3_384DigestBytes /
sizeof(uint32_t),
42 kSha3_512DigestBytes = 512 / 8,
44 kSha3_512DigestWords = kSha3_512DigestBytes /
sizeof(uint32_t),
67 status_t kmac_key_length_check(
size_t key_len);
92 status_t kmac_hwip_default_configure(
void);
106 status_t kmac_sha3_224(
const uint8_t *message,
size_t message_len,
121 status_t kmac_sha3_256(
const uint8_t *message,
size_t message_len,
136 status_t kmac_sha3_384(
const uint8_t *message,
size_t message_len,
151 status_t kmac_sha3_512(
const uint8_t *message,
size_t message_len,
167 status_t kmac_shake_128(
const uint8_t *message,
size_t message_len,
168 uint32_t *digest,
size_t digest_len);
183 status_t kmac_shake_256(
const uint8_t *message,
size_t message_len,
184 uint32_t *digest,
size_t digest_len);
203 status_t kmac_cshake_128(
const uint8_t *message,
size_t message_len,
204 const unsigned char *func_name,
size_t func_name_len,
205 const unsigned char *cust_str,
size_t cust_str_len,
206 uint32_t *digest,
size_t digest_len);
225 status_t kmac_cshake_256(
const uint8_t *message,
size_t message_len,
226 const unsigned char *func_name,
size_t func_name_len,
227 const unsigned char *cust_str,
size_t cust_str_len,
228 uint32_t *digest,
size_t digest_len);
255 size_t message_len,
const unsigned char *cust_str,
256 size_t cust_str_len, uint32_t *digest,
284 size_t message_len,
const unsigned char *cust_str,
285 size_t cust_str_len, uint32_t *digest,
292 #endif // OPENTITAN_SW_DEVICE_LIB_CRYPTO_DRIVERS_KMAC_H_