atalla.h revision 296465
1/*
2 * This header declares the necessary definitions for using the
3 * exponentiation acceleration capabilities of Atalla cards. The only
4 * cryptographic operation is performed by "ASI_RSAPrivateKeyOpFn" and this
5 * takes a structure that defines an "RSA private key". However, it is really
6 * only performing a regular mod_exp using the supplied modulus and exponent
7 * - no CRT form is being used. Hence, it is a generic mod_exp function in
8 * disguise, and we use it as such. Thanks to the people at Atalla for
9 * letting me know these definitions are fine and that they can be reproduced
10 * here. Geoff.
11 */
12
13typedef struct ItemStr {
14    unsigned char *data;
15    int len;
16} Item;
17
18typedef struct RSAPrivateKeyStr {
19    void *reserved;
20    Item version;
21    Item modulus;
22    Item publicExponent;
23    Item privateExponent;
24    Item prime[2];
25    Item exponent[2];
26    Item coefficient;
27} RSAPrivateKey;
28
29/*
30 * Predeclare the function pointer types that we dynamically load from the
31 * DSO. These use the same names and form that Ben's original support code
32 * had (in crypto/bn/bn_exp.c) unless of course I've inadvertently changed
33 * the style somewhere along the way!
34 */
35
36typedef int tfnASI_GetPerformanceStatistics(int reset_flag,
37                                            unsigned int *ret_buf);
38
39typedef int tfnASI_GetHardwareConfig(long card_num, unsigned int *ret_buf);
40
41typedef int tfnASI_RSAPrivateKeyOpFn(RSAPrivateKey * rsaKey,
42                                     unsigned char *output,
43                                     unsigned char *input,
44                                     unsigned int modulus_len);
45