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
9 * Thanks to the people at Atalla for letting me know these definitions are
10 * fine and that they can be reproduced here.
15 typedef struct ItemStr
21 typedef struct RSAPrivateKeyStr
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!
39 typedef int tfnASI_GetPerformanceStatistics(int reset_flag,
40 unsigned int *ret_buf);
42 typedef int tfnASI_GetHardwareConfig(long card_num, unsigned int *ret_buf);
44 typedef int tfnASI_RSAPrivateKeyOpFn(RSAPrivateKey * rsaKey,
45 unsigned char *output,
47 unsigned int modulus_len);
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";