|
1 | | -// Hardware crypto support Copyright 2017 Espressif Systems (Shanghai) PTE LTD |
2 | | -// |
3 | | -// Licensed under the Apache License, Version 2.0 (the "License"); |
4 | | -// you may not use this file except in compliance with the License. |
5 | | -// You may obtain a copy of the License at |
6 | | - |
7 | | -// http://www.apache.org/licenses/LICENSE-2.0 |
8 | | -// |
9 | | -// Unless required by applicable law or agreed to in writing, software |
10 | | -// distributed under the License is distributed on an "AS IS" BASIS, |
11 | | -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | | -// See the License for the specific language governing permissions and |
13 | | -// limitations under the License. |
| 1 | +/* |
| 2 | + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + */ |
14 | 6 |
|
15 | 7 |
|
16 | 8 | #ifndef __ESP_WIFI_CRYPTO_TYPES_H__ |
@@ -358,6 +350,21 @@ typedef uint8_t * (*esp_ccmp_decrypt_t)(const uint8_t *tk, const uint8_t *ieee80 |
358 | 350 | typedef uint8_t * (*esp_ccmp_encrypt_t)(const uint8_t *tk, uint8_t *frame, size_t len, size_t hdrlen, |
359 | 351 | uint8_t *pn, int keyid, size_t *encrypted_len); |
360 | 352 |
|
| 353 | +/** |
| 354 | + * @brief One-Key GMAC hash with AES for MIC computation |
| 355 | + * |
| 356 | + * @key: key for the hash operation |
| 357 | + * @keylen: key length |
| 358 | + * @iv: initialization vector |
| 359 | + * @iv_len: initialization vector length |
| 360 | + * @aad: aad |
| 361 | + * @aad_len: aad length |
| 362 | + * @mic: Buffer for MIC (128 bits, i.e., 16 bytes) |
| 363 | + * Returns: 0 on success, -1 on failure |
| 364 | + */ |
| 365 | +typedef int (*esp_aes_gmac_t)(const uint8_t *key, size_t keylen, const uint8_t *iv, size_t iv_len, |
| 366 | + const uint8_t *aad, size_t aad_len, uint8_t *mic); |
| 367 | + |
361 | 368 | /** |
362 | 369 | * @brief The crypto callback function structure used when do station security connect. |
363 | 370 | * The structure can be set as software crypto or the crypto optimized by ESP32 |
@@ -390,6 +397,7 @@ typedef struct { |
390 | 397 | esp_omac1_aes_128_t omac1_aes_128; |
391 | 398 | esp_ccmp_decrypt_t ccmp_decrypt; |
392 | 399 | esp_ccmp_encrypt_t ccmp_encrypt; |
| 400 | + esp_aes_gmac_t aes_gmac; |
393 | 401 | }wpa_crypto_funcs_t; |
394 | 402 |
|
395 | 403 | /** |
|
0 commit comments