Go to the documentation of this file.
34 #define SEP_START_MSG_TOKEN 0x02558808
36 #define SEP_DES_IV_SIZE_WORDS 2
37 #define SEP_DES_IV_SIZE_BYTES (SEP_DES_IV_SIZE_WORDS * \
39 #define SEP_DES_KEY_SIZE_WORDS 2
40 #define SEP_DES_KEY_SIZE_BYTES (SEP_DES_KEY_SIZE_WORDS * \
42 #define SEP_DES_BLOCK_SIZE 8
43 #define SEP_DES_DUMMY_SIZE 16
45 #define SEP_DES_INIT_OPCODE 0x10
46 #define SEP_DES_BLOCK_OPCODE 0x11
48 #define SEP_AES_BLOCK_SIZE_WORDS 4
49 #define SEP_AES_BLOCK_SIZE_BYTES \
50 (SEP_AES_BLOCK_SIZE_WORDS * sizeof(u32))
52 #define SEP_AES_DUMMY_BLOCK_SIZE 16
53 #define SEP_AES_IV_SIZE_WORDS SEP_AES_BLOCK_SIZE_WORDS
54 #define SEP_AES_IV_SIZE_BYTES \
55 (SEP_AES_IV_SIZE_WORDS * sizeof(u32))
57 #define SEP_AES_KEY_128_SIZE 16
58 #define SEP_AES_KEY_192_SIZE 24
59 #define SEP_AES_KEY_256_SIZE 32
60 #define SEP_AES_KEY_512_SIZE 64
61 #define SEP_AES_MAX_KEY_SIZE_WORDS 16
62 #define SEP_AES_MAX_KEY_SIZE_BYTES \
63 (SEP_AES_MAX_KEY_SIZE_WORDS * sizeof(u32))
65 #define SEP_AES_WRAP_MIN_SIZE 8
66 #define SEP_AES_WRAP_MAX_SIZE 0x10000000
68 #define SEP_AES_WRAP_BLOCK_SIZE_WORDS 2
69 #define SEP_AES_WRAP_BLOCK_SIZE_BYTES \
70 (SEP_AES_WRAP_BLOCK_SIZE_WORDS * sizeof(u32))
72 #define SEP_AES_SECRET_RKEK1 0x1
73 #define SEP_AES_SECRET_RKEK2 0x2
75 #define SEP_AES_INIT_OPCODE 0x2
76 #define SEP_AES_BLOCK_OPCODE 0x3
77 #define SEP_AES_FINISH_OPCODE 0x4
78 #define SEP_AES_WRAP_OPCODE 0x6
79 #define SEP_AES_UNWRAP_OPCODE 0x7
80 #define SEP_AES_XTS_FINISH_OPCODE 0x8
82 #define SEP_HASH_RESULT_SIZE_WORDS 16
83 #define SEP_MD5_DIGEST_SIZE_WORDS 4
84 #define SEP_MD5_DIGEST_SIZE_BYTES \
85 (SEP_MD5_DIGEST_SIZE_WORDS * sizeof(u32))
86 #define SEP_SHA1_DIGEST_SIZE_WORDS 5
87 #define SEP_SHA1_DIGEST_SIZE_BYTES \
88 (SEP_SHA1_DIGEST_SIZE_WORDS * sizeof(u32))
89 #define SEP_SHA224_DIGEST_SIZE_WORDS 7
90 #define SEP_SHA224_DIGEST_SIZE_BYTES \
91 (SEP_SHA224_DIGEST_SIZE_WORDS * sizeof(u32))
92 #define SEP_SHA256_DIGEST_SIZE_WORDS 8
93 #define SEP_SHA256_DIGEST_SIZE_BYTES \
94 (SEP_SHA256_DIGEST_SIZE_WORDS * sizeof(u32))
95 #define SEP_SHA384_DIGEST_SIZE_WORDS 12
96 #define SEP_SHA384_DIGEST_SIZE_BYTES \
97 (SEP_SHA384_DIGEST_SIZE_WORDS * sizeof(u32))
98 #define SEP_SHA512_DIGEST_SIZE_WORDS 16
99 #define SEP_SHA512_DIGEST_SIZE_BYTES \
100 (SEP_SHA512_DIGEST_SIZE_WORDS * sizeof(u32))
101 #define SEP_HASH_BLOCK_SIZE_WORDS 16
102 #define SEP_HASH_BLOCK_SIZE_BYTES \
103 (SEP_HASH_BLOCK_SIZE_WORDS * sizeof(u32))
104 #define SEP_SHA2_BLOCK_SIZE_WORDS 32
105 #define SEP_SHA2_BLOCK_SIZE_BYTES \
106 (SEP_SHA2_BLOCK_SIZE_WORDS * sizeof(u32))
108 #define SEP_HASH_INIT_OPCODE 0x20
109 #define SEP_HASH_UPDATE_OPCODE 0x21
110 #define SEP_HASH_FINISH_OPCODE 0x22
111 #define SEP_HASH_SINGLE_OPCODE 0x23
113 #define SEP_HOST_ERROR 0x0b000000
115 #define SEP_INVALID_START (SEP_HOST_ERROR + 0x3)
116 #define SEP_WRONG_OPCODE (SEP_HOST_ERROR + 0x1)
118 #define SEP_TRANSACTION_WAIT_TIME 5
120 #define SEP_QUEUE_LENGTH 2
122 #ifndef __LITTLE_ENDIAN
123 #define CHG_ENDIAN(val) \
125 (((val) & 0x00FF0000) >> 8) | \
126 (((val) & 0x0000FF00) << 8) | \
127 (((val) & 0x000000FF) << 24))
129 #define CHG_ENDIAN(val) val
294 unsigned char iv[100];