Go to the documentation of this file.
2 #ifndef __ICA_OPENSSL_API_H__
3 #define __ICA_OPENSSL_API_H__
9 #define ICA_ADAPTER_HANDLE int
11 #if defined(linux) || defined (_AIX)
15 #if defined(WIN32) || defined(_WIN32)
16 #define ICA_CALL __stdcall
27 #define MAX_EXP_SIZE 256
28 #define MAX_MODULUS_SIZE 256
29 #define MAX_MODEXP_SIZE (MAX_EXP_SIZE + MAX_MODULUS_SIZE)
31 #define MAX_OPERAND_SIZE MAX_EXP_SIZE
40 #define MAX_BP_SIZE 136
41 #define MAX_BQ_SIZE 128
42 #define MAX_NP_SIZE 136
43 #define MAX_NQ_SIZE 128
44 #define MAX_QINV_SIZE 136
45 #define MAX_RSACRT_SIZE (MAX_BP_SIZE+MAX_BQ_SIZE+MAX_NP_SIZE+MAX_NQ_SIZE+MAX_QINV_SIZE)
47 #define RSA_GEN_OPERAND_MAX 256
54 #define RSA_PUBLIC_MODULUS_EXPONENT 3
55 #define RSA_PKCS_PRIVATE_CHINESE_REMAINDER 6
57 #define KEYTYPE_MODEXPO 1
58 #define KEYTYPE_PKCSCRT 2
87 #define SZ_HEADER_MODEXPO (sizeof(ICA_KEY_RSA_MODEXPO) - sizeof(ICA_KEY_RSA_MODEXPO_REC))
101 unsigned int nLength;
110 unsigned int nOffset;
126 #define SZ_HEADER_CRT (sizeof(ICA_KEY_RSA_CRT) - sizeof(ICA_KEY_RSA_CRT_REC))
137 unsigned int inputDataLength,
138 unsigned char *pInputData,
140 unsigned int *pOutputDataLength,
141 unsigned char *pOutputData );
145 unsigned int inputDataLength,
146 unsigned char *pInputData,
148 unsigned int *pOutputDataLength,
149 unsigned char *pOutputData );
153 unsigned int outputDataLength,
154 unsigned char *pOutputData );
160 static const char *IBMCA_LIBNAME =
"/lib/libica.a(shr.o)";
162 static const char *IBMCA_LIBNAME =
"cryptica";
164 static const char *IBMCA_LIBNAME =
"ica";
173 #define CORRECT_ENDIANNESS(b) ( \
174 (((unsigned long) (b) & 0x000000ff) << 24) | \
175 (((unsigned long) (b) & 0x0000ff00) << 8) | \
176 (((unsigned long) (b) & 0x00ff0000) >> 8) | \
177 (((unsigned long) (b) & 0xff000000) >> 24) \
179 #define CRT_KEY_TYPE RSA_PKCS_PRIVATE_CHINESE_REMAINDER
180 #define ME_KEY_TYPE RSA_PUBLIC_MODULUS_EXPONENT
182 #define CORRECT_ENDIANNESS(b) (b)
183 #define CRT_KEY_TYPE KEYTYPE_PKCSCRT
184 #define ME_KEY_TYPE KEYTYPE_MODEXPO