4 * Copyright IBM Corp. 2001, 2006
5 * Author(s): Robert Burroughs
6 * Eric Rossman (edrossma@us.ibm.com)
8 * Hotplug & misc device support: Jochen Roehrig (roehrig@de.ibm.com)
9 * Major cleanup & driver split: Martin Schwidefsky <schwidefsky@de.ibm.com>
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)
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.
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.
26 #ifndef _ZCRYPT_PCICA_H_
27 #define _ZCRYPT_PCICA_H_
30 * The type 4 message family is associated with a PCICA card.
32 * The four members of the family are described below.
34 * Note that all unsigned char arrays are right-justified and left-padded
37 * Note that all reserved fields must be zeroes.
40 unsigned char reserved1
;
41 unsigned char msg_type_code
; /* 0x04 */
42 unsigned short msg_len
;
43 unsigned char request_code
; /* 0x40 */
44 unsigned char msg_fmt
;
45 unsigned short reserved2
;
46 } __attribute__((packed
));
48 #define TYPE4_TYPE_CODE 0x04
49 #define TYPE4_REQU_CODE 0x40
51 #define TYPE4_SME_FMT 0x00
52 #define TYPE4_LME_FMT 0x10
53 #define TYPE4_SCR_FMT 0x40
54 #define TYPE4_LCR_FMT 0x50
56 /* Mod-Exp, with a small modulus */
58 struct type4_hdr header
;
59 unsigned char message
[128];
60 unsigned char exponent
[128];
61 unsigned char modulus
[128];
62 } __attribute__((packed
));
64 /* Mod-Exp, with a large modulus */
66 struct type4_hdr header
;
67 unsigned char message
[256];
68 unsigned char exponent
[256];
69 unsigned char modulus
[256];
70 } __attribute__((packed
));
72 /* CRT, with a small modulus */
74 struct type4_hdr header
;
75 unsigned char message
[128];
81 } __attribute__((packed
));
83 /* CRT, with a large modulus */
85 struct type4_hdr header
;
86 unsigned char message
[256];
87 unsigned char dp
[136];
88 unsigned char dq
[128];
92 } __attribute__((packed
));
95 * The type 84 response family is associated with a PCICA card.
97 * Note that all unsigned char arrays are right-justified and left-padded
100 * Note that all reserved fields must be zeroes.
104 unsigned char reserved1
;
107 unsigned char reserved2
[4];
108 } __attribute__((packed
));
110 #define TYPE84_RSP_CODE 0x84
112 int zcrypt_pcica_init(void);
113 void zcrypt_pcica_exit(void);
115 #endif /* _ZCRYPT_PCICA_H_ */