• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  *  SPDX-License-Identifier: Apache-2.0
33  *
34  *  Licensed under the Apache License, Version 2.0 (the "License"); you may
35  *  not use this file except in compliance with the License.
36  *  You may obtain a copy of the License at
37  *
38  *  http://www.apache.org/licenses/LICENSE-2.0
39  *
40  *  Unless required by applicable law or agreed to in writing, software
41  *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
42  *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
43  *  See the License for the specific language governing permissions and
44  *  limitations under the License.
45  *
46  *  This file is part of Mbed TLS (https://tls.mbed.org)
47  */
48 
49 #ifndef MBEDTLS_CCM_ALT_H
50 #define MBEDTLS_CCM_ALT_H
51 
52 #if !defined(MBEDTLS_CONFIG_FILE)
53 #include "config.h"
54 #else
55 #include MBEDTLS_CONFIG_FILE
56 #endif
57 
58 #include "cipher.h"
59 #include "cipher_internal.h"
60 #include "hi_cipher.h"
61 #include "securec.h"
62 #include "aes.h"
63 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 typedef struct mbedtls_ccm_context
68 {
69     mbedtls_cipher_context_t cipher_ctx;    /*!< The cipher context used. */
70 }
71 mbedtls_ccm_context;
72 
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif /* MBEDTLS_CCM_ALT_H */