sam4l_crypto_cipher.h
Go to the documentation of this file.
1 /**
2  * @file sam4l_crypto_cipher.h
3  * @brief SAM4L cipher hardware accelerator
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneCRYPTO Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.0
29  **/
30 
31 #ifndef _SAM4L_CRYPTO_CIPHER_H
32 #define _SAM4L_CRYPTO_CIPHER_H
33 
34 //Dependencies
35 #include "core/crypto.h"
36 
37 //Cipher hardware accelerator
38 #ifndef SAM4L_CRYPTO_CIPHER_SUPPORT
39  #define SAM4L_CRYPTO_CIPHER_SUPPORT DISABLED
40 #elif (SAM4L_CRYPTO_CIPHER_SUPPORT != ENABLED && SAM4L_CRYPTO_CIPHER_SUPPORT != DISABLED)
41  #error SAM4L_CRYPTO_CIPHER_SUPPORT parameter is not valid
42 #endif
43 
44 //CFBS bitfield
45 #define AESA_MODE_CFBS_128BIT AESA_MODE_CFBS(0)
46 #define AESA_MODE_CFBS_64BIT AESA_MODE_CFBS(1)
47 #define AESA_MODE_CFBS_32BIT AESA_MODE_CFBS(2)
48 #define AESA_MODE_CFBS_16BIT AESA_MODE_CFBS(3)
49 #define AESA_MODE_CFBS_8BIT AESA_MODE_CFBS(4)
50 
51 //OPMODE bitfield
52 #define AESA_MODE_OPMODE_ECB AESA_MODE_OPMODE(0)
53 #define AESA_MODE_OPMODE_CBC AESA_MODE_OPMODE(1)
54 #define AESA_MODE_OPMODE_CFB AESA_MODE_OPMODE(2)
55 #define AESA_MODE_OPMODE_OFB AESA_MODE_OPMODE(3)
56 #define AESA_MODE_OPMODE_CTR AESA_MODE_OPMODE(4)
57 
58 //C++ guard
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 //C++ guard
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 #endif
General definitions for cryptographic algorithms.