Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
zcrypt_cex2a.h
Go to the documentation of this file.
1 /*
2  * zcrypt 2.1.0
3  *
4  * Copyright IBM Corp. 2001, 2006
5  * Author(s): Robert Burroughs
6  * Eric Rossman ([email protected])
7  *
8  * Hotplug & misc device support: Jochen Roehrig ([email protected])
9  * Major cleanup & driver split: Martin Schwidefsky <[email protected]>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2, or (at your option)
14  * any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25 
26 #ifndef _ZCRYPT_CEX2A_H_
27 #define _ZCRYPT_CEX2A_H_
28 
39 struct type50_hdr {
40  unsigned char reserved1;
41  unsigned char msg_type_code; /* 0x50 */
42  unsigned short msg_len;
43  unsigned char reserved2;
44  unsigned char ignored;
45  unsigned short reserved3;
46 } __attribute__((packed));
47 
48 #define TYPE50_TYPE_CODE 0x50
49 
50 #define TYPE50_MEB1_FMT 0x0001
51 #define TYPE50_MEB2_FMT 0x0002
52 #define TYPE50_MEB3_FMT 0x0003
53 #define TYPE50_CRB1_FMT 0x0011
54 #define TYPE50_CRB2_FMT 0x0012
55 #define TYPE50_CRB3_FMT 0x0013
56 
57 /* Mod-Exp, with a small modulus */
60  unsigned short keyblock_type; /* 0x0001 */
61  unsigned char reserved[6];
62  unsigned char exponent[128];
63  unsigned char modulus[128];
64  unsigned char message[128];
65 } __attribute__((packed));
66 
67 /* Mod-Exp, with a large modulus */
70  unsigned short keyblock_type; /* 0x0002 */
71  unsigned char reserved[6];
72  unsigned char exponent[256];
73  unsigned char modulus[256];
74  unsigned char message[256];
75 } __attribute__((packed));
76 
77 /* Mod-Exp, with a larger modulus */
80  unsigned short keyblock_type; /* 0x0003 */
81  unsigned char reserved[6];
82  unsigned char exponent[512];
83  unsigned char modulus[512];
84  unsigned char message[512];
85 } __attribute__((packed));
86 
87 /* CRT, with a small modulus */
90  unsigned short keyblock_type; /* 0x0011 */
91  unsigned char reserved[6];
92  unsigned char p[64];
93  unsigned char q[64];
94  unsigned char dp[64];
95  unsigned char dq[64];
96  unsigned char u[64];
97  unsigned char message[128];
98 } __attribute__((packed));
99 
100 /* CRT, with a large modulus */
103  unsigned short keyblock_type; /* 0x0012 */
104  unsigned char reserved[6];
105  unsigned char p[128];
106  unsigned char q[128];
107  unsigned char dp[128];
108  unsigned char dq[128];
109  unsigned char u[128];
110  unsigned char message[256];
111 } __attribute__((packed));
112 
113 /* CRT, with a larger modulus */
116  unsigned short keyblock_type; /* 0x0013 */
117  unsigned char reserved[6];
118  unsigned char p[256];
119  unsigned char q[256];
120  unsigned char dp[256];
121  unsigned char dq[256];
122  unsigned char u[256];
123  unsigned char message[512];
124 } __attribute__((packed));
125 
135 #define TYPE80_RSP_CODE 0x80
136 
137 struct type80_hdr {
138  unsigned char reserved1;
139  unsigned char type; /* 0x80 */
140  unsigned short len;
141  unsigned char code; /* 0x00 */
142  unsigned char reserved2[3];
143  unsigned char reserved3[8];
144 } __attribute__((packed));
145 
147 void zcrypt_cex2a_exit(void);
149 #endif /* _ZCRYPT_CEX2A_H_ */