/* compute the AES-CMAC value */
for (i = 0; i < num_aes_blocks; i++) {
/* Apply the chain data */
- apply_cbc_chain_data(cbc_chain_data, src, tmp_data);
+ aes_apply_cbc_chain_data(cbc_chain_data, src, tmp_data);
/* for the final block, XOR K1 into the IV */
if (i == num_aes_blocks - 1)
- apply_cbc_chain_data(tmp_data, k1, tmp_data);
+ aes_apply_cbc_chain_data(tmp_data, k1, tmp_data);
/* encrypt the AES block */
aes_encrypt(tmp_data, key_schedule, dst);
*/
void aes_decrypt(u8 *in, u8 *expkey, u8 *out);
+/**
+ * Apply chain data to the destination using EOR
+ *
+ * Each array is of length AES_KEY_LENGTH.
+ *
+ * @cbc_chain_data Chain data
+ * @src Source data
+ * @dst Destination data, which is modified here
+ */
+void aes_apply_cbc_chain_data(u8 *cbc_chain_data, u8 *src, u8 *dst);
+
/**
* aes_cbc_encrypt_blocks() - Encrypt multiple blocks of data with AES CBC.
*
#endif
}
-/**
- * Apply chain data to the destination using EOR
- *
- * Each array is of length AES_KEY_LENGTH.
- *
- * @cbc_chain_data Chain data
- * @src Source data
- * @dst Destination data, which is modified here
- */
-static void apply_cbc_chain_data(u8 *cbc_chain_data, u8 *src, u8 *dst)
+void aes_apply_cbc_chain_data(u8 *cbc_chain_data, u8 *src, u8 *dst)
{
int i;
debug_print_vector("AES Src", AES_KEY_LENGTH, src);
/* Apply the chain data */
- apply_cbc_chain_data(cbc_chain_data, src, tmp_data);
+ aes_apply_cbc_chain_data(cbc_chain_data, src, tmp_data);
debug_print_vector("AES Xor", AES_KEY_LENGTH, tmp_data);
/* Encrypt the AES block */
debug_print_vector("AES Xor", AES_KEY_LENGTH, tmp_data);
/* Apply the chain data */
- apply_cbc_chain_data(cbc_chain_data, tmp_data, dst);
+ aes_apply_cbc_chain_data(cbc_chain_data, tmp_data, dst);
debug_print_vector("AES Dst", AES_KEY_LENGTH, dst);
/* Update pointers for next loop. */