70 b[i] = (
a[i] << 1) | *carry;
76static void cmac_generate_subkey(
const uint8_t *key,
uint8_t *subkey) {
80 do_shift_one_bit_left(key, subkey, &carry);
105 for (i = 0; i < n_blocks; i++) {
111 if (remaining_bytes == 0) {
112 if (message != NULL && message_len != 0) {
120 memcpy(M, ptr, remaining_bytes);
121 do_pad(M, remaining_bytes);
139 cmac_generate_subkey(L, ctx->
k1);
140 cmac_generate_subkey(ctx->
k1, ctx->
k2);
uint8_t aes_set_encrypt_key(uint8_t *key, uint16_t key_len, aes_context *ctx)
void aes_destroy(aes_context *ctx)
uint8_t aes_encrypt(uint8_t *in, uint8_t *out, const aes_context *ctx)
uint8_t aes_cmac_init(uint8_t *key, uint16_t key_len, aes_cmac_context_t *ctx)
void aes_cmac_destroy(aes_cmac_context_t *ctx)
void aes_cmac_encrypt(const aes_cmac_context_t *ctx, const uint8_t *message, const uint16_t message_len, uint8_t *mac)
#define insecure_memzero(buf, len)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
uint8_t mac[AES_BLOCK_SIZE]
uint8_t k1[AES_BLOCK_SIZE]
uint8_t k2[AES_BLOCK_SIZE]
session operation op sign key_len
memcpy((char *) pInfo->slotDescription, s, l)