Go to the source code of this file.
|
#define | YH_INTERNAL __attribute__((visibility("hidden"))) |
|
◆ YH_INTERNAL
#define YH_INTERNAL __attribute__((visibility("hidden"))) |
◆ aes_cmac_destroy()
Definition at line 147 of file aes_cmac.c.
147 {
148 if (!ctx)
149 return;
152}
void aes_destroy(aes_context *ctx)
#define insecure_memzero(buf, len)
◆ aes_cmac_encrypt()
Definition at line 85 of file aes_cmac.c.
86 {
87
91
94
97
98 if (message_len == 0)
99 n_blocks = 0;
100 else
102
104
105 for (i = 0; i < n_blocks; i++) {
106 do_xor(ptr, mac);
109 }
110
111 if (remaining_bytes == 0) {
112 if (message != NULL && message_len != 0) {
115 } else {
116 do_pad(M, 0);
118 }
119 } else {
120 memcpy(M, ptr, remaining_bytes);
121 do_pad(M, remaining_bytes);
123 }
124
125 do_xor(M, mac);
126
128}
uint8_t aes_encrypt(uint8_t *in, uint8_t *out, const aes_context *ctx)
uint8_t k1[AES_BLOCK_SIZE]
uint8_t k2[AES_BLOCK_SIZE]
memcpy((char *) pInfo->slotDescription, s, l)
◆ aes_cmac_init()
Definition at line 130 of file aes_cmac.c.
130 {
131
133
135
138
139 cmac_generate_subkey(L, ctx->
k1);
140 cmac_generate_subkey(ctx->
k1, ctx->
k2);
141
143
144 return 0;
145}
uint8_t aes_set_encrypt_key(uint8_t *key, uint16_t key_len, aes_context *ctx)
void aes_cmac_encrypt(const aes_cmac_context_t *ctx, const uint8_t *message, const uint16_t message_len, uint8_t *mac)
uint8_t mac[AES_BLOCK_SIZE]
session operation op sign key_len