Avoid compiler warnings in hw_ubsec.c: unused static
[openssl.git] / crypto / engine / vendor_defns / atalla.h
1 /* This header declares the necessary definitions for using the exponentiation
2  * acceleration capabilities of Atalla cards. The only cryptographic operation
3  * is performed by "ASI_RSAPrivateKeyOpFn" and this takes a structure that
4  * defines an "RSA private key". However, it is really only performing a
5  * regular mod_exp using the supplied modulus and exponent - no CRT form is
6  * being used. Hence, it is a generic mod_exp function in disguise, and we use
7  * it as such.
8  *
9  * Thanks to the people at Atalla for letting me know these definitions are
10  * fine and that they can be reproduced here.
11  *
12  * Geoff.
13  */
14
15 typedef struct ItemStr
16         {
17         unsigned char *data;
18         int len;
19         } Item;
20
21 typedef struct RSAPrivateKeyStr
22         {
23         void *reserved;
24         Item version;
25         Item modulus;
26         Item publicExponent;
27         Item privateExponent;
28         Item prime[2];
29         Item exponent[2];
30         Item coefficient;
31         } RSAPrivateKey;
32
33 /* Predeclare the function pointer types that we dynamically load from the DSO.
34  * These use the same names and form that Ben's original support code had (in
35  * crypto/bn/bn_exp.c) unless of course I've inadvertently changed the style
36  * somewhere along the way!
37  */
38
39 typedef int tfnASI_GetPerformanceStatistics(int reset_flag,
40                                         unsigned int *ret_buf);
41
42 typedef int tfnASI_GetHardwareConfig(long card_num, unsigned int *ret_buf);
43
44 typedef int tfnASI_RSAPrivateKeyOpFn(RSAPrivateKey * rsaKey,
45                                         unsigned char *output,
46                                         unsigned char *input,
47                                         unsigned int modulus_len);
48
49 /* These are the static string constants for the DSO file name and the function
50  * symbol names to bind to. Regrettably, the DSO name on *nix appears to be
51  * "atasi.so" rather than something more consistent like "libatasi.so". At the
52  * time of writing, I'm not sure what the file name on win32 is but clearly
53  * native name translation is not possible (eg libatasi.so on *nix, and
54  * atasi.dll on win32). For the purposes of testing, I have created a symbollic
55  * link called "libatasi.so" so that we can use native name-translation - a
56  * better solution will be needed. */
57 static const char *ATALLA_LIBNAME = "atasi";
58 static const char *ATALLA_F1 = "ASI_GetHardwareConfig";
59 static const char *ATALLA_F2 = "ASI_RSAPrivateKeyOpFn";
60 static const char *ATALLA_F3 = "ASI_GetPerformanceStatistics";
61