1 /*
2  * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 /** \file
8  * \brief This file contains common cryptographic definitions.
9  *
10  */
11 
12 #ifndef _CC_CRYPTO_DEFS_H
13 #define _CC_CRYPTO_DEFS_H
14 
15 
16 #ifdef __cplusplus
17 extern "C"
18 {
19 #endif
20 
21 
22 /************************ Hash Definitions ******************************/
23 
24 #define HASH_MD5_DIGEST_SIZE_IN_BYTES       16
25 #define HASH_SHA1_DIGEST_SIZE_IN_BYTES      20
26 #define HASH_SHA224_DIGEST_SIZE_IN_BYTES    28
27 #define HASH_SHA256_DIGEST_SIZE_IN_BYTES    32
28 #define HASH_SHA384_DIGEST_SIZE_IN_BYTES    48
29 #define HASH_SHA512_DIGEST_SIZE_IN_BYTES    64
30 
31 #define HASH_MD5_BLOCK_SIZE_IN_BYTES        64
32 #define HASH_SHA1_BLOCK_SIZE_IN_BYTES       64
33 #define HASH_SHA224_BLOCK_SIZE_IN_BYTES     64
34 #define HASH_SHA256_BLOCK_SIZE_IN_BYTES     64
35 #define HASH_SHA384_BLOCK_SIZE_IN_BYTES     128
36 #define HASH_SHA512_BLOCK_SIZE_IN_BYTES     128
37 
38 
39 
40 /************************ AES Definitions ******************************/
41 
42 #define AES_BLOCK_SIZE_IN_BYTES     16
43 
44 #define AES_IV_SIZE_IN_BYTES        AES_BLOCK_SIZE_IN_BYTES
45 
46 
47 /* AES-CCM Definitions */
48 #define AES_CCM_NONCE_LENGTH_MIN    7
49 #define AES_CCM_NONCE_LENGTH_MAX    13
50 
51 #define AES_CCM_TAG_LENGTH_MIN      4
52 #define AES_CCM_TAG_LENGTH_MAX      16
53 
54 
55 
56 /************************ DES Definitions ******************************/
57 
58 #define DES_IV_SIZE_IN_BYTES        8
59 
60 
61 
62 
63 
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 #endif
70 
71