2  *  linux/drivers/s390/crypto/zcrypt_pcica.h
 
   6  *  Copyright (C)  2001, 2006 IBM Corporation
 
   7  *  Author(s): Robert Burroughs
 
   8  *             Eric Rossman (edrossma@us.ibm.com)
 
  10  *  Hotplug & misc device support: Jochen Roehrig (roehrig@de.ibm.com)
 
  11  *  Major cleanup & driver split: Martin Schwidefsky <schwidefsky@de.ibm.com>
 
  13  * This program is free software; you can redistribute it and/or modify
 
  14  * it under the terms of the GNU General Public License as published by
 
  15  * the Free Software Foundation; either version 2, or (at your option)
 
  18  * This program is distributed in the hope that it will be useful,
 
  19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
  21  * GNU General Public License for more details.
 
  23  * You should have received a copy of the GNU General Public License
 
  24  * along with this program; if not, write to the Free Software
 
  25  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
  28 #ifndef _ZCRYPT_PCICA_H_
 
  29 #define _ZCRYPT_PCICA_H_
 
  32  * The type 4 message family is associated with a PCICA card.
 
  34  * The four members of the family are described below.
 
  36  * Note that all unsigned char arrays are right-justified and left-padded
 
  39  * Note that all reserved fields must be zeroes.
 
  42         unsigned char  reserved1;
 
  43         unsigned char  msg_type_code;   /* 0x04 */
 
  44         unsigned short msg_len;
 
  45         unsigned char  request_code;    /* 0x40 */
 
  46         unsigned char  msg_fmt;
 
  47         unsigned short reserved2;
 
  48 } __attribute__((packed));
 
  50 #define TYPE4_TYPE_CODE 0x04
 
  51 #define TYPE4_REQU_CODE 0x40
 
  53 #define TYPE4_SME_FMT 0x00
 
  54 #define TYPE4_LME_FMT 0x10
 
  55 #define TYPE4_SCR_FMT 0x40
 
  56 #define TYPE4_LCR_FMT 0x50
 
  58 /* Mod-Exp, with a small modulus */
 
  60         struct type4_hdr header;
 
  61         unsigned char    message[128];
 
  62         unsigned char    exponent[128];
 
  63         unsigned char    modulus[128];
 
  64 } __attribute__((packed));
 
  66 /* Mod-Exp, with a large modulus */
 
  68         struct type4_hdr header;
 
  69         unsigned char    message[256];
 
  70         unsigned char    exponent[256];
 
  71         unsigned char    modulus[256];
 
  72 } __attribute__((packed));
 
  74 /* CRT, with a small modulus */
 
  76         struct type4_hdr header;
 
  77         unsigned char    message[128];
 
  83 } __attribute__((packed));
 
  85 /* CRT, with a large modulus */
 
  87         struct type4_hdr header;
 
  88         unsigned char    message[256];
 
  89         unsigned char    dp[136];
 
  90         unsigned char    dq[128];
 
  94 } __attribute__((packed));
 
  97  * The type 84 response family is associated with a PCICA card.
 
  99  * Note that all unsigned char arrays are right-justified and left-padded
 
 102  * Note that all reserved fields must be zeroes.
 
 106         unsigned char  reserved1;
 
 109         unsigned char  reserved2[4];
 
 110 } __attribute__((packed));
 
 112 #define TYPE84_RSP_CODE 0x84
 
 114 int zcrypt_pcica_init(void);
 
 115 void zcrypt_pcica_exit(void);
 
 117 #endif /* _ZCRYPT_PCICA_H_ */