2 * This header declares the necessary definitions for using the
3 * exponentiation acceleration capabilities, and rnd number generation of the
14 * Successful return value
16 #define AEP_R_OK 0x00000000
19 * Miscelleanous unsuccessful return value
21 #define AEP_R_GENERAL_ERROR 0x10000001
24 * Insufficient host memory
26 #define AEP_R_HOST_MEMORY 0x10000002
28 #define AEP_R_FUNCTION_FAILED 0x10000006
31 * Invalid arguments in function call
33 #define AEP_R_ARGUMENTS_BAD 0x10020000
35 #define AEP_R_NO_TARGET_RESOURCES 0x10030000
38 * Error occuring on socket operation
40 #define AEP_R_SOCKERROR 0x10000010
43 * Socket has been closed from the other end
45 #define AEP_R_SOCKEOF 0x10000011
50 #define AEP_R_CONNECTION_HANDLE_INVALID 0x100000B3
52 #define AEP_R_TRANSACTION_HANDLE_INVALID 0x10040000
55 * Transaction has not yet returned from accelerator
57 #define AEP_R_TRANSACTION_NOT_READY 0x00010000
60 * There is already a thread waiting on this transaction
62 #define AEP_R_TRANSACTION_CLAIMED 0x10050000
65 * The transaction timed out
67 #define AEP_R_TIMED_OUT 0x10060000
69 #define AEP_R_FXN_NOT_IMPLEMENTED 0x10070000
71 #define AEP_R_TARGET_ERROR 0x10080000
74 * Error in the AEP daemon process
76 #define AEP_R_DAEMON_ERROR 0x10090000
81 #define AEP_R_INVALID_CTX_ID 0x10009000
83 #define AEP_R_NO_KEY_MANAGER 0x1000a000
86 * Error obtaining a mutex
88 #define AEP_R_MUTEX_BAD 0x000001A0
91 * Fxn call before AEP_Initialise ot after AEP_Finialise
93 #define AEP_R_AEPAPI_NOT_INITIALIZED 0x10000190
96 * AEP_Initialise has already been called
98 #define AEP_R_AEPAPI_ALREADY_INITIALIZED 0x10000191
101 * Maximum number of connections to daemon reached
103 #define AEP_R_NO_MORE_CONNECTION_HNDLS 0x10000200
107 * Some AEP Type definitions
111 /* an unsigned 8-bit value */
112 typedef unsigned char AEP_U8
;
114 /* an unsigned 8-bit character */
115 typedef char AEP_CHAR
;
117 /* a BYTE-sized Boolean flag */
118 typedef AEP_U8 AEP_BBOOL
;
121 * Unsigned value, at least 16 bits long
123 typedef unsigned short AEP_U16
;
125 /* an unsigned value, at least 32 bits long */
126 #ifdef SIXTY_FOUR_BIT_LONG
127 typedef unsigned int AEP_U32
;
129 typedef unsigned long AEP_U32
;
132 #ifdef SIXTY_FOUR_BIT_LONG
133 typedef unsigned long AEP_U64
;
136 unsigned long l1
, l2
;
140 /* at least 32 bits; each bit is a Boolean flag */
141 typedef AEP_U32 AEP_FLAGS
;
143 typedef AEP_U8
*AEP_U8_PTR
;
144 typedef AEP_CHAR
*AEP_CHAR_PTR
;
145 typedef AEP_U32
*AEP_U32_PTR
;
146 typedef AEP_U64
*AEP_U64_PTR
;
147 typedef void *AEP_VOID_PTR
;
149 /* Pointer to a AEP_VOID_PTR-- i.e., pointer to pointer to void */
150 typedef AEP_VOID_PTR
*AEP_VOID_PTR_PTR
;
153 * Used to identify an AEP connection handle
155 typedef AEP_U32 AEP_CONNECTION_HNDL
;
158 * Pointer to an AEP connection handle
160 typedef AEP_CONNECTION_HNDL
*AEP_CONNECTION_HNDL_PTR
;
163 * Used by an application (in conjunction with the apps process id) to
164 * identify an individual transaction
166 typedef AEP_U32 AEP_TRANSACTION_ID
;
169 * Pointer to an applications transaction identifier
171 typedef AEP_TRANSACTION_ID
*AEP_TRANSACTION_ID_PTR
;
176 typedef AEP_U32 AEP_RV
;
178 #define MAX_PROCESS_CONNECTIONS 256
180 #define RAND_BLK_SIZE 1024
186 } AEP_CONNECTION_STATE
;
188 typedef struct AEP_CONNECTION_ENTRY
{
189 AEP_CONNECTION_STATE conn_state
;
190 AEP_CONNECTION_HNDL conn_hndl
;
191 } AEP_CONNECTION_ENTRY
;
193 typedef AEP_RV
t_AEP_OpenConnection(AEP_CONNECTION_HNDL_PTR phConnection
);
194 typedef AEP_RV
t_AEP_CloseConnection(AEP_CONNECTION_HNDL hConnection
);
196 typedef AEP_RV
t_AEP_ModExp(AEP_CONNECTION_HNDL hConnection
,
197 AEP_VOID_PTR pA
, AEP_VOID_PTR pP
,
199 AEP_VOID_PTR pResult
,
200 AEP_TRANSACTION_ID
*pidTransID
);
202 typedef AEP_RV
t_AEP_ModExpCrt(AEP_CONNECTION_HNDL hConnection
,
203 AEP_VOID_PTR pA
, AEP_VOID_PTR pP
,
205 AEP_VOID_PTR pDmp1
, AEP_VOID_PTR pDmq1
,
207 AEP_VOID_PTR pResult
,
208 AEP_TRANSACTION_ID
*pidTransID
);
211 typedef AEP_RV
t_AEP_GenRandom(AEP_CONNECTION_HNDL hConnection
,
214 AEP_VOID_PTR pResult
,
215 AEP_TRANSACTION_ID
*pidTransID
);
218 typedef AEP_RV
t_AEP_Initialize(AEP_VOID_PTR pInitArgs
);
219 typedef AEP_RV
t_AEP_Finalize(void);
220 typedef AEP_RV
t_AEP_SetBNCallBacks(AEP_RV (*GetBigNumSizeFunc
)
221 (AEP_VOID_PTR ArbBigNum
,
222 AEP_U32
*BigNumSize
),
223 AEP_RV (*MakeAEPBigNumFunc
) (AEP_VOID_PTR
229 AEP_RV (*ConverAEPBigNumFunc
) (void