Mistake on this page?
Report an issue in GitHub or email us
TARGET_STM/ccm_alt.h
1 /**
2  * \file ccm.h
3  *
4  * \brief This file provides an API for the CCM authenticated encryption
5  * mode for block ciphers.
6  *
7  * CCM combines Counter mode encryption with CBC-MAC authentication
8  * for 128-bit block ciphers.
9  *
10  * Input to CCM includes the following elements:
11  * <ul><li>Payload - data that is both authenticated and encrypted.</li>
12  * <li>Associated data (Adata) - data that is authenticated but not
13  * encrypted, For example, a header.</li>
14  * <li>Nonce - A unique value that is assigned to the payload and the
15  * associated data.</li></ul>
16  *
17  * Definition of CCM:
18  * http://csrc.nist.gov/publications/nistpubs/800-38C/SP800-38C_updated-July20_2007.pdf
19  * RFC 3610 "Counter with CBC-MAC (CCM)"
20  *
21  * Related:
22  * RFC 5116 "An Interface and Algorithms for Authenticated Encryption"
23  *
24  * Definition of CCM*:
25  * IEEE 802.15.4 - IEEE Standard for Local and metropolitan area networks
26  * Integer representation is fixed most-significant-octet-first order and
27  * the representation of octets is most-significant-bit-first order. This is
28  * consistent with RFC 3610.
29  */
30 /*
31  * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved
32  * Copyright (C) 2019-2020 STMicroelectronics, All Rights Reserved
33  * SPDX-License-Identifier: Apache-2.0
34  *
35  * Licensed under the Apache License, Version 2.0 (the "License"); you may
36  * not use this file except in compliance with the License.
37  * You may obtain a copy of the License at
38  *
39  * http://www.apache.org/licenses/LICENSE-2.0
40  *
41  * Unless required by applicable law or agreed to in writing, software
42  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
43  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44  * See the License for the specific language governing permissions and
45  * limitations under the License.
46  *
47  * This file implements ST CCM HW services based on API from mbed TLS
48  */
49 
50 /* Define to prevent recursive inclusion -------------------------------------*/
51 #ifndef MBEDTLS_CCM_ALT_H
52 #define MBEDTLS_CCM_ALT_H
53 
54 #if defined(MBEDTLS_CCM_ALT)
55 /* Includes ------------------------------------------------------------------*/
56 #include "cryp_stm32.h"
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 /* Exported types ------------------------------------------------------------*/
63 /**
64  * \brief The CCM context-type definition. The CCM context is passed
65  * to the APIs called.
66  */
67 typedef struct mbedtls_ccm_context {
68  /* Encryption/Decryption key */
69  uint32_t ccm_key[8];
70 
71  CRYP_HandleTypeDef hcryp_ccm; /* CCM context */
72  uint32_t ctx_save_cr; /* save context for multi-context */
73 }
74 mbedtls_ccm_context;
75 
76 /* Exported constants --------------------------------------------------------*/
77 /* Exported macro ------------------------------------------------------------*/
78 /* Exported functions --------------------------------------------------------*/
79 
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif /* MBEDTLS_CCM_ALT */
86 #endif /* MBEDTLS_CCM_ALT_H */
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.