Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
sep_crypto.h File Reference

Go to the source code of this file.

Data Structures

struct  sep_des_internal_key
 
struct  sep_des_internal_context
 
struct  sep_des_private_context
 
struct  sep_des_key
 
struct  sep_aes_internal_context
 
struct  sep_aes_private_context
 
struct  sep_hash_internal_context
 
struct  sep_hash_private_context
 
union  key_t
 
struct  this_task_ctx
 
struct  sep_system_ctx
 
struct  sep_work_struct
 

Macros

#define SEP_START_MSG_TOKEN   0x02558808
 
#define SEP_DES_IV_SIZE_WORDS   2
 
#define SEP_DES_IV_SIZE_BYTES
 
#define SEP_DES_KEY_SIZE_WORDS   2
 
#define SEP_DES_KEY_SIZE_BYTES
 
#define SEP_DES_BLOCK_SIZE   8
 
#define SEP_DES_DUMMY_SIZE   16
 
#define SEP_DES_INIT_OPCODE   0x10
 
#define SEP_DES_BLOCK_OPCODE   0x11
 
#define SEP_AES_BLOCK_SIZE_WORDS   4
 
#define SEP_AES_BLOCK_SIZE_BYTES   (SEP_AES_BLOCK_SIZE_WORDS * sizeof(u32))
 
#define SEP_AES_DUMMY_BLOCK_SIZE   16
 
#define SEP_AES_IV_SIZE_WORDS   SEP_AES_BLOCK_SIZE_WORDS
 
#define SEP_AES_IV_SIZE_BYTES   (SEP_AES_IV_SIZE_WORDS * sizeof(u32))
 
#define SEP_AES_KEY_128_SIZE   16
 
#define SEP_AES_KEY_192_SIZE   24
 
#define SEP_AES_KEY_256_SIZE   32
 
#define SEP_AES_KEY_512_SIZE   64
 
#define SEP_AES_MAX_KEY_SIZE_WORDS   16
 
#define SEP_AES_MAX_KEY_SIZE_BYTES   (SEP_AES_MAX_KEY_SIZE_WORDS * sizeof(u32))
 
#define SEP_AES_WRAP_MIN_SIZE   8
 
#define SEP_AES_WRAP_MAX_SIZE   0x10000000
 
#define SEP_AES_WRAP_BLOCK_SIZE_WORDS   2
 
#define SEP_AES_WRAP_BLOCK_SIZE_BYTES   (SEP_AES_WRAP_BLOCK_SIZE_WORDS * sizeof(u32))
 
#define SEP_AES_SECRET_RKEK1   0x1
 
#define SEP_AES_SECRET_RKEK2   0x2
 
#define SEP_AES_INIT_OPCODE   0x2
 
#define SEP_AES_BLOCK_OPCODE   0x3
 
#define SEP_AES_FINISH_OPCODE   0x4
 
#define SEP_AES_WRAP_OPCODE   0x6
 
#define SEP_AES_UNWRAP_OPCODE   0x7
 
#define SEP_AES_XTS_FINISH_OPCODE   0x8
 
#define SEP_HASH_RESULT_SIZE_WORDS   16
 
#define SEP_MD5_DIGEST_SIZE_WORDS   4
 
#define SEP_MD5_DIGEST_SIZE_BYTES   (SEP_MD5_DIGEST_SIZE_WORDS * sizeof(u32))
 
#define SEP_SHA1_DIGEST_SIZE_WORDS   5
 
#define SEP_SHA1_DIGEST_SIZE_BYTES   (SEP_SHA1_DIGEST_SIZE_WORDS * sizeof(u32))
 
#define SEP_SHA224_DIGEST_SIZE_WORDS   7
 
#define SEP_SHA224_DIGEST_SIZE_BYTES   (SEP_SHA224_DIGEST_SIZE_WORDS * sizeof(u32))
 
#define SEP_SHA256_DIGEST_SIZE_WORDS   8
 
#define SEP_SHA256_DIGEST_SIZE_BYTES   (SEP_SHA256_DIGEST_SIZE_WORDS * sizeof(u32))
 
#define SEP_SHA384_DIGEST_SIZE_WORDS   12
 
#define SEP_SHA384_DIGEST_SIZE_BYTES   (SEP_SHA384_DIGEST_SIZE_WORDS * sizeof(u32))
 
#define SEP_SHA512_DIGEST_SIZE_WORDS   16
 
#define SEP_SHA512_DIGEST_SIZE_BYTES   (SEP_SHA512_DIGEST_SIZE_WORDS * sizeof(u32))
 
#define SEP_HASH_BLOCK_SIZE_WORDS   16
 
#define SEP_HASH_BLOCK_SIZE_BYTES   (SEP_HASH_BLOCK_SIZE_WORDS * sizeof(u32))
 
#define SEP_SHA2_BLOCK_SIZE_WORDS   32
 
#define SEP_SHA2_BLOCK_SIZE_BYTES   (SEP_SHA2_BLOCK_SIZE_WORDS * sizeof(u32))
 
#define SEP_HASH_INIT_OPCODE   0x20
 
#define SEP_HASH_UPDATE_OPCODE   0x21
 
#define SEP_HASH_FINISH_OPCODE   0x22
 
#define SEP_HASH_SINGLE_OPCODE   0x23
 
#define SEP_HOST_ERROR   0x0b000000
 
#define SEP_OK   0x0
 
#define SEP_INVALID_START   (SEP_HOST_ERROR + 0x3)
 
#define SEP_WRONG_OPCODE   (SEP_HOST_ERROR + 0x1)
 
#define SEP_TRANSACTION_WAIT_TIME   5
 
#define SEP_QUEUE_LENGTH   2
 
#define CHG_ENDIAN(val)
 

Enumerations

enum  des_numkey {
  DES_KEY_1 = 1, DES_KEY_2 = 2, DES_KEY_3 = 3, SEP_NUMKEY_OPTIONS,
  SEP_NUMKEY_LAST = 0x7fffffff
}
 
enum  des_enc_mode { SEP_DES_ENCRYPT = 0, SEP_DES_DECRYPT = 1, SEP_DES_ENC_OPTIONS, SEP_DES_ENC_LAST = 0x7fffffff }
 
enum  des_op_mode { SEP_DES_ECB = 0, SEP_DES_CBC = 1, SEP_OP_OPTIONS, SEP_OP_LAST = 0x7fffffff }
 
enum  aes_keysize {
  AES_128 = 0, AES_192 = 1, AES_256 = 2, AES_512 = 3,
  AES_SIZE_OPTIONS, AEA_SIZE_LAST = 0x7FFFFFFF
}
 
enum  aes_enc_mode { SEP_AES_ENCRYPT = 0, SEP_AES_DECRYPT = 1, SEP_AES_ENC_OPTIONS, SEP_AES_ENC_LAST = 0x7FFFFFFF }
 
enum  aes_op_mode {
  SEP_AES_ECB = 0, SEP_AES_CBC = 1, SEP_AES_MAC = 2, SEP_AES_CTR = 3,
  SEP_AES_XCBC = 4, SEP_AES_CMAC = 5, SEP_AES_XTS = 6, SEP_AES_OP_OPTIONS,
  SEP_AES_OP_LAST = 0x7FFFFFFF
}
 
enum  hash_op_mode {
  SEP_HASH_SHA1 = 0, SEP_HASH_SHA224 = 1, SEP_HASH_SHA256 = 2, SEP_HASH_SHA384 = 3,
  SEP_HASH_SHA512 = 4, SEP_HASH_MD5 = 5, SEP_HASH_OPTIONS, SEP_HASH_LAST_MODE = 0x7FFFFFFF
}
 

Functions

int sep_crypto_setup (void)
 
void sep_crypto_takedown (void)
 

Macro Definition Documentation

#define CHG_ENDIAN (   val)
Value:
(((val) >> 24) | \
(((val) & 0x00FF0000) >> 8) | \
(((val) & 0x0000FF00) << 8) | \
(((val) & 0x000000FF) << 24))

Definition at line 123 of file sep_crypto.h.

#define SEP_AES_BLOCK_OPCODE   0x3

Definition at line 76 of file sep_crypto.h.

#define SEP_AES_BLOCK_SIZE_BYTES   (SEP_AES_BLOCK_SIZE_WORDS * sizeof(u32))

Definition at line 49 of file sep_crypto.h.

#define SEP_AES_BLOCK_SIZE_WORDS   4

Definition at line 48 of file sep_crypto.h.

#define SEP_AES_DUMMY_BLOCK_SIZE   16

Definition at line 52 of file sep_crypto.h.

#define SEP_AES_FINISH_OPCODE   0x4

Definition at line 77 of file sep_crypto.h.

#define SEP_AES_INIT_OPCODE   0x2

Definition at line 75 of file sep_crypto.h.

#define SEP_AES_IV_SIZE_BYTES   (SEP_AES_IV_SIZE_WORDS * sizeof(u32))

Definition at line 54 of file sep_crypto.h.

#define SEP_AES_IV_SIZE_WORDS   SEP_AES_BLOCK_SIZE_WORDS

Definition at line 53 of file sep_crypto.h.

#define SEP_AES_KEY_128_SIZE   16

Definition at line 57 of file sep_crypto.h.

#define SEP_AES_KEY_192_SIZE   24

Definition at line 58 of file sep_crypto.h.

#define SEP_AES_KEY_256_SIZE   32

Definition at line 59 of file sep_crypto.h.

#define SEP_AES_KEY_512_SIZE   64

Definition at line 60 of file sep_crypto.h.

#define SEP_AES_MAX_KEY_SIZE_BYTES   (SEP_AES_MAX_KEY_SIZE_WORDS * sizeof(u32))

Definition at line 62 of file sep_crypto.h.

#define SEP_AES_MAX_KEY_SIZE_WORDS   16

Definition at line 61 of file sep_crypto.h.

#define SEP_AES_SECRET_RKEK1   0x1

Definition at line 72 of file sep_crypto.h.

#define SEP_AES_SECRET_RKEK2   0x2

Definition at line 73 of file sep_crypto.h.

#define SEP_AES_UNWRAP_OPCODE   0x7

Definition at line 79 of file sep_crypto.h.

#define SEP_AES_WRAP_BLOCK_SIZE_BYTES   (SEP_AES_WRAP_BLOCK_SIZE_WORDS * sizeof(u32))

Definition at line 69 of file sep_crypto.h.

#define SEP_AES_WRAP_BLOCK_SIZE_WORDS   2

Definition at line 68 of file sep_crypto.h.

#define SEP_AES_WRAP_MAX_SIZE   0x10000000

Definition at line 66 of file sep_crypto.h.

#define SEP_AES_WRAP_MIN_SIZE   8

Definition at line 65 of file sep_crypto.h.

#define SEP_AES_WRAP_OPCODE   0x6

Definition at line 78 of file sep_crypto.h.

#define SEP_AES_XTS_FINISH_OPCODE   0x8

Definition at line 80 of file sep_crypto.h.

#define SEP_DES_BLOCK_OPCODE   0x11

Definition at line 46 of file sep_crypto.h.

#define SEP_DES_BLOCK_SIZE   8

Definition at line 42 of file sep_crypto.h.

#define SEP_DES_DUMMY_SIZE   16

Definition at line 43 of file sep_crypto.h.

#define SEP_DES_INIT_OPCODE   0x10

Definition at line 45 of file sep_crypto.h.

#define SEP_DES_IV_SIZE_BYTES
Value:
sizeof(u32))

Definition at line 37 of file sep_crypto.h.

#define SEP_DES_IV_SIZE_WORDS   2

Definition at line 36 of file sep_crypto.h.

#define SEP_DES_KEY_SIZE_BYTES
Value:

Definition at line 40 of file sep_crypto.h.

#define SEP_DES_KEY_SIZE_WORDS   2

Definition at line 39 of file sep_crypto.h.

#define SEP_HASH_BLOCK_SIZE_BYTES   (SEP_HASH_BLOCK_SIZE_WORDS * sizeof(u32))

Definition at line 102 of file sep_crypto.h.

#define SEP_HASH_BLOCK_SIZE_WORDS   16

Definition at line 101 of file sep_crypto.h.

#define SEP_HASH_FINISH_OPCODE   0x22

Definition at line 110 of file sep_crypto.h.

#define SEP_HASH_INIT_OPCODE   0x20

Definition at line 108 of file sep_crypto.h.

#define SEP_HASH_RESULT_SIZE_WORDS   16

Definition at line 82 of file sep_crypto.h.

#define SEP_HASH_SINGLE_OPCODE   0x23

Definition at line 111 of file sep_crypto.h.

#define SEP_HASH_UPDATE_OPCODE   0x21

Definition at line 109 of file sep_crypto.h.

#define SEP_HOST_ERROR   0x0b000000

Definition at line 113 of file sep_crypto.h.

#define SEP_INVALID_START   (SEP_HOST_ERROR + 0x3)

Definition at line 115 of file sep_crypto.h.

#define SEP_MD5_DIGEST_SIZE_BYTES   (SEP_MD5_DIGEST_SIZE_WORDS * sizeof(u32))

Definition at line 84 of file sep_crypto.h.

#define SEP_MD5_DIGEST_SIZE_WORDS   4

Definition at line 83 of file sep_crypto.h.

#define SEP_OK   0x0

Definition at line 114 of file sep_crypto.h.

#define SEP_QUEUE_LENGTH   2

Definition at line 120 of file sep_crypto.h.

#define SEP_SHA1_DIGEST_SIZE_BYTES   (SEP_SHA1_DIGEST_SIZE_WORDS * sizeof(u32))

Definition at line 87 of file sep_crypto.h.

#define SEP_SHA1_DIGEST_SIZE_WORDS   5

Definition at line 86 of file sep_crypto.h.

#define SEP_SHA224_DIGEST_SIZE_BYTES   (SEP_SHA224_DIGEST_SIZE_WORDS * sizeof(u32))

Definition at line 90 of file sep_crypto.h.

#define SEP_SHA224_DIGEST_SIZE_WORDS   7

Definition at line 89 of file sep_crypto.h.

#define SEP_SHA256_DIGEST_SIZE_BYTES   (SEP_SHA256_DIGEST_SIZE_WORDS * sizeof(u32))

Definition at line 93 of file sep_crypto.h.

#define SEP_SHA256_DIGEST_SIZE_WORDS   8

Definition at line 92 of file sep_crypto.h.

#define SEP_SHA2_BLOCK_SIZE_BYTES   (SEP_SHA2_BLOCK_SIZE_WORDS * sizeof(u32))

Definition at line 105 of file sep_crypto.h.

#define SEP_SHA2_BLOCK_SIZE_WORDS   32

Definition at line 104 of file sep_crypto.h.

#define SEP_SHA384_DIGEST_SIZE_BYTES   (SEP_SHA384_DIGEST_SIZE_WORDS * sizeof(u32))

Definition at line 96 of file sep_crypto.h.

#define SEP_SHA384_DIGEST_SIZE_WORDS   12

Definition at line 95 of file sep_crypto.h.

#define SEP_SHA512_DIGEST_SIZE_BYTES   (SEP_SHA512_DIGEST_SIZE_WORDS * sizeof(u32))

Definition at line 99 of file sep_crypto.h.

#define SEP_SHA512_DIGEST_SIZE_WORDS   16

Definition at line 98 of file sep_crypto.h.

#define SEP_START_MSG_TOKEN   0x02558808

Definition at line 34 of file sep_crypto.h.

#define SEP_TRANSACTION_WAIT_TIME   5

Definition at line 118 of file sep_crypto.h.

#define SEP_WRONG_OPCODE   (SEP_HOST_ERROR + 0x1)

Definition at line 116 of file sep_crypto.h.

Enumeration Type Documentation

Enumerator:
SEP_AES_ENCRYPT 
SEP_AES_DECRYPT 
SEP_AES_ENC_OPTIONS 
SEP_AES_ENC_LAST 

Definition at line 163 of file sep_crypto.h.

Enumerator:
AES_128 
AES_192 
AES_256 
AES_512 
AES_SIZE_OPTIONS 
AEA_SIZE_LAST 

Definition at line 154 of file sep_crypto.h.

Enumerator:
SEP_AES_ECB 
SEP_AES_CBC 
SEP_AES_MAC 
SEP_AES_CTR 
SEP_AES_XCBC 
SEP_AES_CMAC 
SEP_AES_XTS 
SEP_AES_OP_OPTIONS 
SEP_AES_OP_LAST 

Definition at line 170 of file sep_crypto.h.

Enumerator:
SEP_DES_ENCRYPT 
SEP_DES_DECRYPT 
SEP_DES_ENC_OPTIONS 
SEP_DES_ENC_LAST 

Definition at line 140 of file sep_crypto.h.

enum des_numkey
Enumerator:
DES_KEY_1 
DES_KEY_2 
DES_KEY_3 
SEP_NUMKEY_OPTIONS 
SEP_NUMKEY_LAST 

Definition at line 132 of file sep_crypto.h.

Enumerator:
SEP_DES_ECB 
SEP_DES_CBC 
SEP_OP_OPTIONS 
SEP_OP_LAST 

Definition at line 147 of file sep_crypto.h.

Enumerator:
SEP_HASH_SHA1 
SEP_HASH_SHA224 
SEP_HASH_SHA256 
SEP_HASH_SHA384 
SEP_HASH_SHA512 
SEP_HASH_MD5 
SEP_HASH_OPTIONS 
SEP_HASH_LAST_MODE 

Definition at line 182 of file sep_crypto.h.

Function Documentation

int sep_crypto_setup ( void  )
void sep_crypto_takedown ( void  )