1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26#ifndef _ZCRYPT_PCICA_H_
27#define _ZCRYPT_PCICA_H_
28
29
30
31
32
33
34
35
36
37
38
39struct type4_hdr {
40 unsigned char reserved1;
41 unsigned char msg_type_code;
42 unsigned short msg_len;
43 unsigned char request_code;
44 unsigned char msg_fmt;
45 unsigned short reserved2;
46} __attribute__((packed));
47
48#define TYPE4_TYPE_CODE 0x04
49#define TYPE4_REQU_CODE 0x40
50
51#define TYPE4_SME_FMT 0x00
52#define TYPE4_LME_FMT 0x10
53#define TYPE4_SCR_FMT 0x40
54#define TYPE4_LCR_FMT 0x50
55
56
57struct type4_sme {
58 struct type4_hdr header;
59 unsigned char message[128];
60 unsigned char exponent[128];
61 unsigned char modulus[128];
62} __attribute__((packed));
63
64
65struct type4_lme {
66 struct type4_hdr header;
67 unsigned char message[256];
68 unsigned char exponent[256];
69 unsigned char modulus[256];
70} __attribute__((packed));
71
72
73struct type4_scr {
74 struct type4_hdr header;
75 unsigned char message[128];
76 unsigned char dp[72];
77 unsigned char dq[64];
78 unsigned char p[72];
79 unsigned char q[64];
80 unsigned char u[72];
81} __attribute__((packed));
82
83
84struct type4_lcr {
85 struct type4_hdr header;
86 unsigned char message[256];
87 unsigned char dp[136];
88 unsigned char dq[128];
89 unsigned char p[136];
90 unsigned char q[128];
91 unsigned char u[136];
92} __attribute__((packed));
93
94
95
96
97
98
99
100
101
102
103struct type84_hdr {
104 unsigned char reserved1;
105 unsigned char code;
106 unsigned short len;
107 unsigned char reserved2[4];
108} __attribute__((packed));
109
110#define TYPE84_RSP_CODE 0x84
111
112int zcrypt_pcica_init(void);
113void zcrypt_pcica_exit(void);
114
115#endif
116