2 * Copyright (C) 2017 C-SKY Microsystems Co., Ltd. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 /******************************************************************************
19 * @brief header file for aes driver
22 ******************************************************************************/
30 #define AES_LITTLE_ENDIAN 0x00000100
32 #define AES_MAX_KEY_LENGTH 32
33 #define AES_IT_DATAINT 0x4
34 #define AES_IT_KEYINT 0x2
35 #define AES_IT_BUSY 0x1
36 #define AES_IT_ALL 0x7
37 #define AES_CRYPTO_KEYEXP 0x2
39 #define AES_WORK_ENABLE_OFFSET 0
40 #define AES_INT_ENABLE_OFFSET 2
41 #define AES_MODE_OFFSET 3
42 #define AES_KEY_LEN_OFFSET 4
43 #define AES_OPCODE_OFFSET 6
46 __IOM uint32_t datain[4]; /* Offset: 0x000 (R/W) Data input 0~127 */
47 __IOM uint32_t key[8]; /* Offset: 0x010 (R/W) Key 0~255 */
48 __IOM uint32_t iv[4]; /* Offset: 0x030 (R/W) Initial Vector: 0~127 */
49 __IOM uint32_t ctrl; /* Offset: 0x040 (R/W) AES Control Register */
50 __IOM uint32_t state; /* Offset: 0x044 (R/W) AES State Register */
51 __IOM uint32_t dataout[4]; /* Offset: 0x048 (R/W) Data Output 0~31 */