import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / masp / asf / asf_inc / sec_cust_struct.h
1 #ifndef _CUST_SEC_H
2 #define _CUST_SEC_H
3
4 /**************************************************************************
5 * RSA PKCS01 CONTROL
6 **************************************************************************/
7 #define RSA_KEY_LEN_2048 (0)
8 #define RSA_KEY_LEN_1024 (1)
9
10 /**************************************************************************
11 * RSA PKCS01 CHECKING
12 **************************************************************************/
13 #if RSA_KEY_LEN_2048
14 #if RSA_KEY_LEN_1024
15 #error "RSA_KEY_LEN_1024 should be disabled"
16 #endif
17 #endif
18
19 #if RSA_KEY_LEN_1024
20 #if RSA_KEY_LEN_2048
21 #error "RSA_KEY_LEN_2048 should be disabled"
22 #endif
23 #endif
24
25 /**************************************************************************
26 * RSA PKCS01 CONFIGURATION
27 **************************************************************************/
28 #define RSA_KEY_MAX_LEN (128) // bytes
29 #define RSA_E_KEY_LEN (5) // bytes
30
31 #if RSA_KEY_LEN_2048
32 #define RSA_KEY_LEN (256) // bytes
33 #define HASH_LEN (32) // bytes
34
35 #elif RSA_KEY_LEN_1024
36 #define RSA_KEY_LEN (128) // bytes
37 #define HASH_LEN (20) // bytes
38
39 #else
40 #error "RSA_KEY_LEN is not defined"
41
42 #endif
43
44 /**************************************************************************
45 * CUSTOMER INTERFACE
46 **************************************************************************/
47 typedef struct _CUST_SEC_INTER
48 {
49 /* key to sign image patch */
50 unsigned char key_rsa_n[RSA_KEY_MAX_LEN*2]; // string. number base = 16
51 unsigned char key_rsa_d[RSA_KEY_MAX_LEN*2]; // string. number base = 16
52 unsigned char key_rsa_e[RSA_E_KEY_LEN]; // string. number base = 16
53 } CUST_SEC_INTER;
54
55 #endif /*_CUST_SEC_H*/