crypto: geode - Kill AES_IV_LENGTH
[deliverable/linux.git] / drivers / crypto / geode-aes.h
1 /* Copyright (C) 2003-2006, Advanced Micro Devices, Inc.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 */
8
9 #ifndef _GEODE_AES_H_
10 #define _GEODE_AES_H_
11
12 /* driver logic flags */
13 #define AES_KEY_LENGTH 16
14
15 #define AES_MODE_ECB 0
16 #define AES_MODE_CBC 1
17
18 #define AES_DIR_DECRYPT 0
19 #define AES_DIR_ENCRYPT 1
20
21 #define AES_FLAGS_HIDDENKEY (1 << 0)
22
23 /* Register definitions */
24
25 #define AES_CTRLA_REG 0x0000
26
27 #define AES_CTRL_START 0x01
28 #define AES_CTRL_DECRYPT 0x00
29 #define AES_CTRL_ENCRYPT 0x02
30 #define AES_CTRL_WRKEY 0x04
31 #define AES_CTRL_DCA 0x08
32 #define AES_CTRL_SCA 0x10
33 #define AES_CTRL_CBC 0x20
34
35 #define AES_INTR_REG 0x0008
36
37 #define AES_INTRA_PENDING (1 << 16)
38 #define AES_INTRB_PENDING (1 << 17)
39
40 #define AES_INTR_PENDING (AES_INTRA_PENDING | AES_INTRB_PENDING)
41 #define AES_INTR_MASK 0x07
42
43 #define AES_SOURCEA_REG 0x0010
44 #define AES_DSTA_REG 0x0014
45 #define AES_LENA_REG 0x0018
46 #define AES_WRITEKEY0_REG 0x0030
47 #define AES_WRITEIV0_REG 0x0040
48
49 /* A very large counter that is used to gracefully bail out of an
50 * operation in case of trouble
51 */
52
53 #define AES_OP_TIMEOUT 0x50000
54
55 struct geode_aes_op {
56
57 void *src;
58 void *dst;
59
60 u32 mode;
61 u32 dir;
62 u32 flags;
63 int len;
64
65 u8 key[AES_KEY_LENGTH];
66 u8 *iv;
67
68 union {
69 struct crypto_blkcipher *blk;
70 struct crypto_cipher *cip;
71 } fallback;
72 u32 keylen;
73 };
74
75 #endif
This page took 0.034631 seconds and 6 git commands to generate.