atalla.h revision 160814
1160814Ssimon/* This header declares the necessary definitions for using the exponentiation
2160814Ssimon * acceleration capabilities of Atalla cards. The only cryptographic operation
3160814Ssimon * is performed by "ASI_RSAPrivateKeyOpFn" and this takes a structure that
4160814Ssimon * defines an "RSA private key". However, it is really only performing a
5160814Ssimon * regular mod_exp using the supplied modulus and exponent - no CRT form is
6160814Ssimon * being used. Hence, it is a generic mod_exp function in disguise, and we use
7160814Ssimon * it as such.
8160814Ssimon *
9160814Ssimon * Thanks to the people at Atalla for letting me know these definitions are
10160814Ssimon * fine and that they can be reproduced here.
11160814Ssimon *
12160814Ssimon * Geoff.
13160814Ssimon */
14160814Ssimon
15160814Ssimontypedef struct ItemStr
16160814Ssimon	{
17160814Ssimon	unsigned char *data;
18160814Ssimon	int len;
19160814Ssimon	} Item;
20160814Ssimon
21160814Ssimontypedef struct RSAPrivateKeyStr
22160814Ssimon	{
23160814Ssimon	void *reserved;
24160814Ssimon	Item version;
25160814Ssimon	Item modulus;
26160814Ssimon	Item publicExponent;
27160814Ssimon	Item privateExponent;
28160814Ssimon	Item prime[2];
29160814Ssimon	Item exponent[2];
30160814Ssimon	Item coefficient;
31160814Ssimon	} RSAPrivateKey;
32160814Ssimon
33160814Ssimon/* Predeclare the function pointer types that we dynamically load from the DSO.
34160814Ssimon * These use the same names and form that Ben's original support code had (in
35160814Ssimon * crypto/bn/bn_exp.c) unless of course I've inadvertently changed the style
36160814Ssimon * somewhere along the way!
37160814Ssimon */
38160814Ssimon
39160814Ssimontypedef int tfnASI_GetPerformanceStatistics(int reset_flag,
40160814Ssimon					unsigned int *ret_buf);
41160814Ssimon
42160814Ssimontypedef int tfnASI_GetHardwareConfig(long card_num, unsigned int *ret_buf);
43160814Ssimon
44160814Ssimontypedef int tfnASI_RSAPrivateKeyOpFn(RSAPrivateKey * rsaKey,
45160814Ssimon					unsigned char *output,
46160814Ssimon					unsigned char *input,
47160814Ssimon					unsigned int modulus_len);
48160814Ssimon
49