Run util/openssl-format-source -v -c .
Reviewed-by: Tim Hudson <tjh@openssl.org>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
@@ -53,7 +53,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* NOTE: this file was auto generated by the mkerr.pl script: any changes
|
||||
/*
|
||||
* NOTE: this file was auto generated by the mkerr.pl script: any changes
|
||||
* made to it will be overwritten when the script next updates this file,
|
||||
* only reason strings will be preserved.
|
||||
*/
|
||||
@@ -64,91 +65,85 @@
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
static ERR_STRING_DATA IBMCA_str_functs[]=
|
||||
{
|
||||
{ERR_PACK(0,IBMCA_F_IBMCA_CTRL,0), "IBMCA_CTRL"},
|
||||
{ERR_PACK(0,IBMCA_F_IBMCA_FINISH,0), "IBMCA_FINISH"},
|
||||
{ERR_PACK(0,IBMCA_F_IBMCA_INIT,0), "IBMCA_INIT"},
|
||||
{ERR_PACK(0,IBMCA_F_IBMCA_MOD_EXP,0), "IBMCA_MOD_EXP"},
|
||||
{ERR_PACK(0,IBMCA_F_IBMCA_MOD_EXP_CRT,0), "IBMCA_MOD_EXP_CRT"},
|
||||
{ERR_PACK(0,IBMCA_F_IBMCA_RAND_BYTES,0), "IBMCA_RAND_BYTES"},
|
||||
{ERR_PACK(0,IBMCA_F_IBMCA_RSA_MOD_EXP,0), "IBMCA_RSA_MOD_EXP"},
|
||||
{0,NULL}
|
||||
};
|
||||
static ERR_STRING_DATA IBMCA_str_functs[] = {
|
||||
{ERR_PACK(0, IBMCA_F_IBMCA_CTRL, 0), "IBMCA_CTRL"},
|
||||
{ERR_PACK(0, IBMCA_F_IBMCA_FINISH, 0), "IBMCA_FINISH"},
|
||||
{ERR_PACK(0, IBMCA_F_IBMCA_INIT, 0), "IBMCA_INIT"},
|
||||
{ERR_PACK(0, IBMCA_F_IBMCA_MOD_EXP, 0), "IBMCA_MOD_EXP"},
|
||||
{ERR_PACK(0, IBMCA_F_IBMCA_MOD_EXP_CRT, 0), "IBMCA_MOD_EXP_CRT"},
|
||||
{ERR_PACK(0, IBMCA_F_IBMCA_RAND_BYTES, 0), "IBMCA_RAND_BYTES"},
|
||||
{ERR_PACK(0, IBMCA_F_IBMCA_RSA_MOD_EXP, 0), "IBMCA_RSA_MOD_EXP"},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
static ERR_STRING_DATA IBMCA_str_reasons[]=
|
||||
{
|
||||
{IBMCA_R_ALREADY_LOADED ,"already loaded"},
|
||||
{IBMCA_R_BN_CTX_FULL ,"bn ctx full"},
|
||||
{IBMCA_R_BN_EXPAND_FAIL ,"bn expand fail"},
|
||||
{IBMCA_R_CTRL_COMMAND_NOT_IMPLEMENTED ,"ctrl command not implemented"},
|
||||
{IBMCA_R_DSO_FAILURE ,"dso failure"},
|
||||
{IBMCA_R_MEXP_LENGTH_TO_LARGE ,"mexp length to large"},
|
||||
{IBMCA_R_MISSING_KEY_COMPONENTS ,"missing key components"},
|
||||
{IBMCA_R_NOT_INITIALISED ,"not initialised"},
|
||||
{IBMCA_R_NOT_LOADED ,"not loaded"},
|
||||
{IBMCA_R_OPERANDS_TO_LARGE ,"operands to large"},
|
||||
{IBMCA_R_OUTLEN_TO_LARGE ,"outlen to large"},
|
||||
{IBMCA_R_REQUEST_FAILED ,"request failed"},
|
||||
{IBMCA_R_UNDERFLOW_CONDITION ,"underflow condition"},
|
||||
{IBMCA_R_UNDERFLOW_KEYRECORD ,"underflow keyrecord"},
|
||||
{IBMCA_R_UNIT_FAILURE ,"unit failure"},
|
||||
{0,NULL}
|
||||
};
|
||||
static ERR_STRING_DATA IBMCA_str_reasons[] = {
|
||||
{IBMCA_R_ALREADY_LOADED, "already loaded"},
|
||||
{IBMCA_R_BN_CTX_FULL, "bn ctx full"},
|
||||
{IBMCA_R_BN_EXPAND_FAIL, "bn expand fail"},
|
||||
{IBMCA_R_CTRL_COMMAND_NOT_IMPLEMENTED, "ctrl command not implemented"},
|
||||
{IBMCA_R_DSO_FAILURE, "dso failure"},
|
||||
{IBMCA_R_MEXP_LENGTH_TO_LARGE, "mexp length to large"},
|
||||
{IBMCA_R_MISSING_KEY_COMPONENTS, "missing key components"},
|
||||
{IBMCA_R_NOT_INITIALISED, "not initialised"},
|
||||
{IBMCA_R_NOT_LOADED, "not loaded"},
|
||||
{IBMCA_R_OPERANDS_TO_LARGE, "operands to large"},
|
||||
{IBMCA_R_OUTLEN_TO_LARGE, "outlen to large"},
|
||||
{IBMCA_R_REQUEST_FAILED, "request failed"},
|
||||
{IBMCA_R_UNDERFLOW_CONDITION, "underflow condition"},
|
||||
{IBMCA_R_UNDERFLOW_KEYRECORD, "underflow keyrecord"},
|
||||
{IBMCA_R_UNIT_FAILURE, "unit failure"},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef IBMCA_LIB_NAME
|
||||
static ERR_STRING_DATA IBMCA_lib_name[]=
|
||||
{
|
||||
{0 ,IBMCA_LIB_NAME},
|
||||
{0,NULL}
|
||||
};
|
||||
static ERR_STRING_DATA IBMCA_lib_name[] = {
|
||||
{0, IBMCA_LIB_NAME},
|
||||
{0, NULL}
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
static int IBMCA_lib_error_code=0;
|
||||
static int IBMCA_error_init=1;
|
||||
static int IBMCA_lib_error_code = 0;
|
||||
static int IBMCA_error_init = 1;
|
||||
|
||||
static void ERR_load_IBMCA_strings(void)
|
||||
{
|
||||
if (IBMCA_lib_error_code == 0)
|
||||
IBMCA_lib_error_code=ERR_get_next_error_library();
|
||||
{
|
||||
if (IBMCA_lib_error_code == 0)
|
||||
IBMCA_lib_error_code = ERR_get_next_error_library();
|
||||
|
||||
if (IBMCA_error_init)
|
||||
{
|
||||
IBMCA_error_init=0;
|
||||
if (IBMCA_error_init) {
|
||||
IBMCA_error_init = 0;
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_load_strings(IBMCA_lib_error_code,IBMCA_str_functs);
|
||||
ERR_load_strings(IBMCA_lib_error_code,IBMCA_str_reasons);
|
||||
ERR_load_strings(IBMCA_lib_error_code, IBMCA_str_functs);
|
||||
ERR_load_strings(IBMCA_lib_error_code, IBMCA_str_reasons);
|
||||
#endif
|
||||
|
||||
#ifdef IBMCA_LIB_NAME
|
||||
IBMCA_lib_name->error = ERR_PACK(IBMCA_lib_error_code,0,0);
|
||||
ERR_load_strings(0,IBMCA_lib_name);
|
||||
IBMCA_lib_name->error = ERR_PACK(IBMCA_lib_error_code, 0, 0);
|
||||
ERR_load_strings(0, IBMCA_lib_name);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void ERR_unload_IBMCA_strings(void)
|
||||
{
|
||||
if (IBMCA_error_init == 0)
|
||||
{
|
||||
{
|
||||
if (IBMCA_error_init == 0) {
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_unload_strings(IBMCA_lib_error_code,IBMCA_str_functs);
|
||||
ERR_unload_strings(IBMCA_lib_error_code,IBMCA_str_reasons);
|
||||
ERR_unload_strings(IBMCA_lib_error_code, IBMCA_str_functs);
|
||||
ERR_unload_strings(IBMCA_lib_error_code, IBMCA_str_reasons);
|
||||
#endif
|
||||
|
||||
#ifdef IBMCA_LIB_NAME
|
||||
ERR_unload_strings(0,IBMCA_lib_name);
|
||||
ERR_unload_strings(0, IBMCA_lib_name);
|
||||
#endif
|
||||
IBMCA_error_init=1;
|
||||
}
|
||||
}
|
||||
IBMCA_error_init = 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void ERR_IBMCA_error(int function, int reason, char *file, int line)
|
||||
{
|
||||
if (IBMCA_lib_error_code == 0)
|
||||
IBMCA_lib_error_code=ERR_get_next_error_library();
|
||||
ERR_PUT_error(IBMCA_lib_error_code,function,reason,file,line);
|
||||
}
|
||||
{
|
||||
if (IBMCA_lib_error_code == 0)
|
||||
IBMCA_lib_error_code = ERR_get_next_error_library();
|
||||
ERR_PUT_error(IBMCA_lib_error_code, function, reason, file, line);
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
@@ -53,48 +53,49 @@
|
||||
*/
|
||||
|
||||
#ifndef HEADER_IBMCA_ERR_H
|
||||
#define HEADER_IBMCA_ERR_H
|
||||
# define HEADER_IBMCA_ERR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
/*
|
||||
* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
static void ERR_load_IBMCA_strings(void);
|
||||
static void ERR_unload_IBMCA_strings(void);
|
||||
static void ERR_IBMCA_error(int function, int reason, char *file, int line);
|
||||
#define IBMCAerr(f,r) ERR_IBMCA_error((f),(r),__FILE__,__LINE__)
|
||||
# define IBMCAerr(f,r) ERR_IBMCA_error((f),(r),__FILE__,__LINE__)
|
||||
|
||||
/* Error codes for the IBMCA functions. */
|
||||
|
||||
/* Function codes. */
|
||||
#define IBMCA_F_IBMCA_CTRL 100
|
||||
#define IBMCA_F_IBMCA_FINISH 101
|
||||
#define IBMCA_F_IBMCA_INIT 102
|
||||
#define IBMCA_F_IBMCA_MOD_EXP 103
|
||||
#define IBMCA_F_IBMCA_MOD_EXP_CRT 104
|
||||
#define IBMCA_F_IBMCA_RAND_BYTES 105
|
||||
#define IBMCA_F_IBMCA_RSA_MOD_EXP 106
|
||||
# define IBMCA_F_IBMCA_CTRL 100
|
||||
# define IBMCA_F_IBMCA_FINISH 101
|
||||
# define IBMCA_F_IBMCA_INIT 102
|
||||
# define IBMCA_F_IBMCA_MOD_EXP 103
|
||||
# define IBMCA_F_IBMCA_MOD_EXP_CRT 104
|
||||
# define IBMCA_F_IBMCA_RAND_BYTES 105
|
||||
# define IBMCA_F_IBMCA_RSA_MOD_EXP 106
|
||||
|
||||
/* Reason codes. */
|
||||
#define IBMCA_R_ALREADY_LOADED 100
|
||||
#define IBMCA_R_BN_CTX_FULL 101
|
||||
#define IBMCA_R_BN_EXPAND_FAIL 102
|
||||
#define IBMCA_R_CTRL_COMMAND_NOT_IMPLEMENTED 103
|
||||
#define IBMCA_R_DSO_FAILURE 104
|
||||
#define IBMCA_R_MEXP_LENGTH_TO_LARGE 105
|
||||
#define IBMCA_R_MISSING_KEY_COMPONENTS 106
|
||||
#define IBMCA_R_NOT_INITIALISED 107
|
||||
#define IBMCA_R_NOT_LOADED 108
|
||||
#define IBMCA_R_OPERANDS_TO_LARGE 109
|
||||
#define IBMCA_R_OUTLEN_TO_LARGE 110
|
||||
#define IBMCA_R_REQUEST_FAILED 111
|
||||
#define IBMCA_R_UNDERFLOW_CONDITION 112
|
||||
#define IBMCA_R_UNDERFLOW_KEYRECORD 113
|
||||
#define IBMCA_R_UNIT_FAILURE 114
|
||||
# define IBMCA_R_ALREADY_LOADED 100
|
||||
# define IBMCA_R_BN_CTX_FULL 101
|
||||
# define IBMCA_R_BN_EXPAND_FAIL 102
|
||||
# define IBMCA_R_CTRL_COMMAND_NOT_IMPLEMENTED 103
|
||||
# define IBMCA_R_DSO_FAILURE 104
|
||||
# define IBMCA_R_MEXP_LENGTH_TO_LARGE 105
|
||||
# define IBMCA_R_MISSING_KEY_COMPONENTS 106
|
||||
# define IBMCA_R_NOT_INITIALISED 107
|
||||
# define IBMCA_R_NOT_LOADED 108
|
||||
# define IBMCA_R_OPERANDS_TO_LARGE 109
|
||||
# define IBMCA_R_OUTLEN_TO_LARGE 110
|
||||
# define IBMCA_R_REQUEST_FAILED 111
|
||||
# define IBMCA_R_UNDERFLOW_CONDITION 112
|
||||
# define IBMCA_R_UNDERFLOW_KEYRECORD 113
|
||||
# define IBMCA_R_UNIT_FAILURE 114
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -1,64 +1,63 @@
|
||||
|
||||
#ifndef __ICA_OPENSSL_API_H__
|
||||
#define __ICA_OPENSSL_API_H__
|
||||
# define __ICA_OPENSSL_API_H__
|
||||
|
||||
/**
|
||||
** abstract data types for API
|
||||
**/
|
||||
|
||||
#define ICA_ADAPTER_HANDLE int
|
||||
# define ICA_ADAPTER_HANDLE int
|
||||
|
||||
#if defined(linux) || defined (_AIX)
|
||||
#define ICA_CALL
|
||||
#endif
|
||||
# if defined(linux) || defined (_AIX)
|
||||
# define ICA_CALL
|
||||
# endif
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
#define ICA_CALL __stdcall
|
||||
#endif
|
||||
# if defined(WIN32) || defined(_WIN32)
|
||||
# define ICA_CALL __stdcall
|
||||
# endif
|
||||
|
||||
/*------------------------------------------------*
|
||||
/* -----------------------------------------------*
|
||||
| RSA defines and typedefs |
|
||||
*------------------------------------------------*/
|
||||
/*
|
||||
* All data elements of the RSA key are in big-endian format
|
||||
* Modulus-Exponent form of key
|
||||
*
|
||||
*/
|
||||
#define MAX_EXP_SIZE 256
|
||||
#define MAX_MODULUS_SIZE 256
|
||||
#define MAX_MODEXP_SIZE (MAX_EXP_SIZE + MAX_MODULUS_SIZE)
|
||||
* All data elements of the RSA key are in big-endian format
|
||||
* Modulus-Exponent form of key
|
||||
*
|
||||
*/
|
||||
# define MAX_EXP_SIZE 256
|
||||
# define MAX_MODULUS_SIZE 256
|
||||
# define MAX_MODEXP_SIZE (MAX_EXP_SIZE + MAX_MODULUS_SIZE)
|
||||
|
||||
#define MAX_OPERAND_SIZE MAX_EXP_SIZE
|
||||
# define MAX_OPERAND_SIZE MAX_EXP_SIZE
|
||||
|
||||
typedef unsigned char ICA_KEY_RSA_MODEXPO_REC[MAX_MODEXP_SIZE];
|
||||
typedef unsigned char ICA_KEY_RSA_MODEXPO_REC[MAX_MODEXP_SIZE];
|
||||
/*
|
||||
* All data elements of the RSA key are in big-endian format
|
||||
* Chinese Remainder Thereom(CRT) form of key
|
||||
* Used only for Decrypt, the encrypt form is typically Modulus-Exponent
|
||||
*
|
||||
*/
|
||||
#define MAX_BP_SIZE 136
|
||||
#define MAX_BQ_SIZE 128
|
||||
#define MAX_NP_SIZE 136
|
||||
#define MAX_NQ_SIZE 128
|
||||
#define MAX_QINV_SIZE 136
|
||||
#define MAX_RSACRT_SIZE (MAX_BP_SIZE+MAX_BQ_SIZE+MAX_NP_SIZE+MAX_NQ_SIZE+MAX_QINV_SIZE)
|
||||
* All data elements of the RSA key are in big-endian format
|
||||
* Chinese Remainder Thereom(CRT) form of key
|
||||
* Used only for Decrypt, the encrypt form is typically Modulus-Exponent
|
||||
*
|
||||
*/
|
||||
# define MAX_BP_SIZE 136
|
||||
# define MAX_BQ_SIZE 128
|
||||
# define MAX_NP_SIZE 136
|
||||
# define MAX_NQ_SIZE 128
|
||||
# define MAX_QINV_SIZE 136
|
||||
# define MAX_RSACRT_SIZE (MAX_BP_SIZE+MAX_BQ_SIZE+MAX_NP_SIZE+MAX_NQ_SIZE+MAX_QINV_SIZE)
|
||||
|
||||
#define RSA_GEN_OPERAND_MAX 256 /* bytes */
|
||||
# define RSA_GEN_OPERAND_MAX 256/* bytes */
|
||||
|
||||
typedef unsigned char ICA_KEY_RSA_CRT_REC[MAX_RSACRT_SIZE];
|
||||
/*------------------------------------------------*
|
||||
/* -----------------------------------------------*
|
||||
| RSA key token types |
|
||||
*------------------------------------------------*/
|
||||
|
||||
#define RSA_PUBLIC_MODULUS_EXPONENT 3
|
||||
#define RSA_PKCS_PRIVATE_CHINESE_REMAINDER 6
|
||||
# define RSA_PUBLIC_MODULUS_EXPONENT 3
|
||||
# define RSA_PKCS_PRIVATE_CHINESE_REMAINDER 6
|
||||
|
||||
#define KEYTYPE_MODEXPO 1
|
||||
#define KEYTYPE_PKCSCRT 2
|
||||
# define KEYTYPE_MODEXPO 1
|
||||
# define KEYTYPE_PKCSCRT 2
|
||||
|
||||
|
||||
/*------------------------------------------------*
|
||||
/* -----------------------------------------------*
|
||||
| RSA Key Token format |
|
||||
*------------------------------------------------*/
|
||||
|
||||
@@ -68,23 +67,23 @@ typedef unsigned char ICA_KEY_RSA_CRT_REC[MAX_RSACRT_SIZE];
|
||||
* stored in big-endian format
|
||||
*/
|
||||
|
||||
typedef struct _ICA_KEY_RSA_MODEXPO
|
||||
{ unsigned int keyType; /* RSA key type. */
|
||||
unsigned int keyLength; /* Total length of the token. */
|
||||
unsigned int modulusBitLength; /* Modulus n bit length. */
|
||||
/* -- Start of the data length.*/
|
||||
unsigned int nLength; /* Modulus n = p * q */
|
||||
unsigned int expLength; /* exponent (public or private)*/
|
||||
/* e = 1/d * mod(p-1)(q-1) */
|
||||
/* -- Start of the data offsets*/
|
||||
unsigned int nOffset; /* Modulus n . */
|
||||
unsigned int expOffset; /* exponent (public or private)*/
|
||||
unsigned char reserved[112]; /* reserved area */
|
||||
/* -- Start of the variable -- */
|
||||
/* -- length token data. -- */
|
||||
typedef struct _ICA_KEY_RSA_MODEXPO {
|
||||
unsigned int keyType; /* RSA key type. */
|
||||
unsigned int keyLength; /* Total length of the token. */
|
||||
unsigned int modulusBitLength; /* Modulus n bit length. */
|
||||
/* -- Start of the data length. */
|
||||
unsigned int nLength; /* Modulus n = p * q */
|
||||
unsigned int expLength; /* exponent (public or private) */
|
||||
/* e = 1/d * mod(p-1)(q-1) */
|
||||
/* -- Start of the data offsets */
|
||||
unsigned int nOffset; /* Modulus n . */
|
||||
unsigned int expOffset; /* exponent (public or private) */
|
||||
unsigned char reserved[112]; /* reserved area */
|
||||
/* -- Start of the variable -- */
|
||||
/* -- length token data. -- */
|
||||
ICA_KEY_RSA_MODEXPO_REC keyRecord;
|
||||
} ICA_KEY_RSA_MODEXPO;
|
||||
#define SZ_HEADER_MODEXPO (sizeof(ICA_KEY_RSA_MODEXPO) - sizeof(ICA_KEY_RSA_MODEXPO_REC))
|
||||
# define SZ_HEADER_MODEXPO (sizeof(ICA_KEY_RSA_MODEXPO) - sizeof(ICA_KEY_RSA_MODEXPO_REC))
|
||||
|
||||
/*-
|
||||
* NOTE: All the fields in the ICA_KEY_RSA_CRT structure
|
||||
@@ -92,98 +91,93 @@ typedef struct _ICA_KEY_RSA_MODEXPO
|
||||
* stored in big-endian format
|
||||
*/
|
||||
|
||||
typedef struct _ICA_KEY_RSA_CRT
|
||||
{ unsigned int keyType; /* RSA key type. */
|
||||
unsigned int keyLength; /* Total length of the token. */
|
||||
unsigned int modulusBitLength; /* Modulus n bit length. */
|
||||
/* -- Start of the data length.*/
|
||||
#if _AIX
|
||||
unsigned int nLength; /* Modulus n = p * q */
|
||||
#endif
|
||||
unsigned int pLength; /* Prime number p . */
|
||||
unsigned int qLength; /* Prime number q . */
|
||||
unsigned int dpLength; /* dp = d * mod(p-1) . */
|
||||
unsigned int dqLength; /* dq = d * mod(q-1) . */
|
||||
unsigned int qInvLength; /* PKCS: qInv = Ap/q */
|
||||
/* -- Start of the data offsets*/
|
||||
#if _AIX
|
||||
unsigned int nOffset; /* Modulus n . */
|
||||
#endif
|
||||
unsigned int pOffset; /* Prime number p . */
|
||||
unsigned int qOffset; /* Prime number q . */
|
||||
unsigned int dpOffset; /* dp . */
|
||||
unsigned int dqOffset; /* dq . */
|
||||
unsigned int qInvOffset; /* qInv for PKCS */
|
||||
#if _AIX
|
||||
unsigned char reserved[80]; /* reserved area */
|
||||
#else
|
||||
unsigned char reserved[88]; /* reserved area */
|
||||
#endif
|
||||
/* -- Start of the variable -- */
|
||||
/* -- length token data. -- */
|
||||
typedef struct _ICA_KEY_RSA_CRT {
|
||||
unsigned int keyType; /* RSA key type. */
|
||||
unsigned int keyLength; /* Total length of the token. */
|
||||
unsigned int modulusBitLength; /* Modulus n bit length. */
|
||||
/* -- Start of the data length. */
|
||||
# if _AIX
|
||||
unsigned int nLength; /* Modulus n = p * q */
|
||||
# endif
|
||||
unsigned int pLength; /* Prime number p . */
|
||||
unsigned int qLength; /* Prime number q . */
|
||||
unsigned int dpLength; /* dp = d * mod(p-1) . */
|
||||
unsigned int dqLength; /* dq = d * mod(q-1) . */
|
||||
unsigned int qInvLength; /* PKCS: qInv = Ap/q */
|
||||
/* -- Start of the data offsets */
|
||||
# if _AIX
|
||||
unsigned int nOffset; /* Modulus n . */
|
||||
# endif
|
||||
unsigned int pOffset; /* Prime number p . */
|
||||
unsigned int qOffset; /* Prime number q . */
|
||||
unsigned int dpOffset; /* dp . */
|
||||
unsigned int dqOffset; /* dq . */
|
||||
unsigned int qInvOffset; /* qInv for PKCS */
|
||||
# if _AIX
|
||||
unsigned char reserved[80]; /* reserved area */
|
||||
# else
|
||||
unsigned char reserved[88]; /* reserved area */
|
||||
# endif
|
||||
/* -- Start of the variable -- */
|
||||
/* -- length token data. -- */
|
||||
ICA_KEY_RSA_CRT_REC keyRecord;
|
||||
} ICA_KEY_RSA_CRT;
|
||||
#define SZ_HEADER_CRT (sizeof(ICA_KEY_RSA_CRT) - sizeof(ICA_KEY_RSA_CRT_REC))
|
||||
# define SZ_HEADER_CRT (sizeof(ICA_KEY_RSA_CRT) - sizeof(ICA_KEY_RSA_CRT_REC))
|
||||
|
||||
unsigned int
|
||||
icaOpenAdapter( unsigned int adapterId,
|
||||
ICA_ADAPTER_HANDLE *pAdapterHandle );
|
||||
icaOpenAdapter(unsigned int adapterId, ICA_ADAPTER_HANDLE * pAdapterHandle);
|
||||
|
||||
unsigned int icaCloseAdapter(ICA_ADAPTER_HANDLE adapterHandle);
|
||||
|
||||
unsigned int
|
||||
icaCloseAdapter( ICA_ADAPTER_HANDLE adapterHandle );
|
||||
icaRsaModExpo(ICA_ADAPTER_HANDLE hAdapterHandle,
|
||||
unsigned int inputDataLength,
|
||||
unsigned char *pInputData,
|
||||
ICA_KEY_RSA_MODEXPO *pKeyModExpo,
|
||||
unsigned int *pOutputDataLength, unsigned char *pOutputData);
|
||||
|
||||
unsigned int
|
||||
icaRsaModExpo( ICA_ADAPTER_HANDLE hAdapterHandle,
|
||||
unsigned int inputDataLength,
|
||||
unsigned char *pInputData,
|
||||
ICA_KEY_RSA_MODEXPO *pKeyModExpo,
|
||||
unsigned int *pOutputDataLength,
|
||||
unsigned char *pOutputData );
|
||||
icaRsaCrt(ICA_ADAPTER_HANDLE hAdapterHandle,
|
||||
unsigned int inputDataLength,
|
||||
unsigned char *pInputData,
|
||||
ICA_KEY_RSA_CRT *pKeyCrt,
|
||||
unsigned int *pOutputDataLength, unsigned char *pOutputData);
|
||||
|
||||
unsigned int
|
||||
icaRsaCrt( ICA_ADAPTER_HANDLE hAdapterHandle,
|
||||
unsigned int inputDataLength,
|
||||
unsigned char *pInputData,
|
||||
ICA_KEY_RSA_CRT *pKeyCrt,
|
||||
unsigned int *pOutputDataLength,
|
||||
unsigned char *pOutputData );
|
||||
icaRandomNumberGenerate(ICA_ADAPTER_HANDLE hAdapterHandle,
|
||||
unsigned int outputDataLength,
|
||||
unsigned char *pOutputData);
|
||||
|
||||
unsigned int
|
||||
icaRandomNumberGenerate( ICA_ADAPTER_HANDLE hAdapterHandle,
|
||||
unsigned int outputDataLength,
|
||||
unsigned char *pOutputData );
|
||||
|
||||
/* Specific macros and definitions to not have IFDEF;s all over the
|
||||
main code */
|
||||
|
||||
#if (_AIX)
|
||||
static const char *IBMCA_LIBNAME = "/lib/libica.a(shr.o)";
|
||||
#elif (WIN32)
|
||||
static const char *IBMCA_LIBNAME = "cryptica";
|
||||
#else
|
||||
static const char *IBMCA_LIBNAME = "ica";
|
||||
#endif
|
||||
|
||||
#if (WIN32)
|
||||
/*
|
||||
The ICA_KEY_RSA_MODEXPO & ICA_KEY_RSA_CRT lengths and
|
||||
offsets must be in big-endian format.
|
||||
* Specific macros and definitions to not have IFDEF;s all over the main code
|
||||
*/
|
||||
|
||||
*/
|
||||
#define CORRECT_ENDIANNESS(b) ( \
|
||||
# if (_AIX)
|
||||
static const char *IBMCA_LIBNAME = "/lib/libica.a(shr.o)";
|
||||
# elif (WIN32)
|
||||
static const char *IBMCA_LIBNAME = "cryptica";
|
||||
# else
|
||||
static const char *IBMCA_LIBNAME = "ica";
|
||||
# endif
|
||||
|
||||
# if (WIN32)
|
||||
/*
|
||||
* The ICA_KEY_RSA_MODEXPO & ICA_KEY_RSA_CRT lengths and offsets must be in
|
||||
* big-endian format.
|
||||
*
|
||||
*/
|
||||
# define CORRECT_ENDIANNESS(b) ( \
|
||||
(((unsigned long) (b) & 0x000000ff) << 24) | \
|
||||
(((unsigned long) (b) & 0x0000ff00) << 8) | \
|
||||
(((unsigned long) (b) & 0x00ff0000) >> 8) | \
|
||||
(((unsigned long) (b) & 0xff000000) >> 24) \
|
||||
)
|
||||
#define CRT_KEY_TYPE RSA_PKCS_PRIVATE_CHINESE_REMAINDER
|
||||
#define ME_KEY_TYPE RSA_PUBLIC_MODULUS_EXPONENT
|
||||
#else
|
||||
#define CORRECT_ENDIANNESS(b) (b)
|
||||
#define CRT_KEY_TYPE KEYTYPE_PKCSCRT
|
||||
#define ME_KEY_TYPE KEYTYPE_MODEXPO
|
||||
#endif
|
||||
# define CRT_KEY_TYPE RSA_PKCS_PRIVATE_CHINESE_REMAINDER
|
||||
# define ME_KEY_TYPE RSA_PUBLIC_MODULUS_EXPONENT
|
||||
# else
|
||||
# define CORRECT_ENDIANNESS(b) (b)
|
||||
# define CRT_KEY_TYPE KEYTYPE_PKCSCRT
|
||||
# define ME_KEY_TYPE KEYTYPE_MODEXPO
|
||||
# endif
|
||||
|
||||
|
||||
|
||||
#endif /* __ICA_OPENSSL_API_H__ */
|
||||
#endif /* __ICA_OPENSSL_API_H__ */
|
||||
|
Reference in New Issue
Block a user