1 /**
2  * \brief AES block cipher, ESP-IDF hardware accelerated version
3  * Based on mbedTLS FIPS-197 compliant version.
4  *
5  *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
6  *  Additions Copyright (C) 2016, Espressif Systems (Shanghai) PTE Ltd
7  *  SPDX-License-Identifier: Apache-2.0
8  *
9  *  Licensed under the Apache License, Version 2.0 (the "License"); you may
10  *  not use this file except in compliance with the License.
11  *  You may obtain a copy of the License at
12  *
13  *  http://www.apache.org/licenses/LICENSE-2.0
14  *
15  *  Unless required by applicable law or agreed to in writing, software
16  *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17  *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  *  See the License for the specific language governing permissions and
19  *  limitations under the License.
20  *
21  *  Internal API
22  */
23 
24 #pragma once
25 
26 
27 #include "aes/esp_aes.h"
28 #include "aes/esp_aes_gcm.h"
29 #include <stdbool.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 bool valid_key_length(const esp_aes_context *ctx);
36 
37 
38 /**
39  * @brief           Run a AES-GCM conversion using DMA
40  *
41  * @param ctx       Aes context
42  * @param input     Pointer to input data
43  * @param output    Pointer to output data
44  * @param len       Length of the input data
45  * @param aad_desc  GCM additional data DMA descriptor
46  * @param aad_len   GCM additional data length
47  * @return int      -1 on error
48  */
49 int esp_aes_process_dma_gcm(esp_aes_context *ctx, const unsigned char *input, unsigned char *output, size_t len, lldesc_t *aad_desc, size_t aad_len);
50 
51 
52 #ifdef __cplusplus
53 }
54 #endif
55