hw_4758_cca.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /**********************************************************************/
  2. /* */
  3. /* Prototypes of the CCA verbs used by the 4758 CCA openssl driver */
  4. /* */
  5. /* Maurice Gittens <maurice@gittens.nl> */
  6. /* */
  7. /**********************************************************************/
  8. #ifndef __HW_4758_CCA__
  9. # define __HW_4758_CCA__
  10. /*
  11. * Only WIN32 support for now
  12. */
  13. # if defined(WIN32)
  14. # define CCA_LIB_NAME "CSUNSAPI"
  15. # define CSNDPKX "CSNDPKX_32"
  16. # define CSNDKRR "CSNDKRR_32"
  17. # define CSNDPKE "CSNDPKE_32"
  18. # define CSNDPKD "CSNDPKD_32"
  19. # define CSNDDSV "CSNDDSV_32"
  20. # define CSNDDSG "CSNDDSG_32"
  21. # define CSNBRNG "CSNBRNG_32"
  22. # define SECURITYAPI __stdcall
  23. # else
  24. /*
  25. * Fixme!! Find out the values of these constants for other platforms.
  26. */
  27. # define CCA_LIB_NAME "CSUNSAPI"
  28. # define CSNDPKX "CSNDPKX"
  29. # define CSNDKRR "CSNDKRR"
  30. # define CSNDPKE "CSNDPKE"
  31. # define CSNDPKD "CSNDPKD"
  32. # define CSNDDSV "CSNDDSV"
  33. # define CSNDDSG "CSNDDSG"
  34. # define CSNBRNG "CSNBRNG"
  35. # define SECURITYAPI
  36. # endif
  37. /*
  38. * security API prototypes
  39. */
  40. /* PKA Key Record Read */
  41. typedef void (SECURITYAPI * F_KEYRECORDREAD)
  42. (long *return_code,
  43. long *reason_code,
  44. long *exit_data_length,
  45. unsigned char *exit_data,
  46. long *rule_array_count,
  47. unsigned char *rule_array,
  48. unsigned char *key_label, long *key_token_length, unsigned char *key_token);
  49. /* Random Number Generate */
  50. typedef void (SECURITYAPI * F_RANDOMNUMBERGENERATE)
  51. (long *return_code,
  52. long *reason_code,
  53. long *exit_data_length,
  54. unsigned char *exit_data,
  55. unsigned char *form, unsigned char *random_number);
  56. /* Digital Signature Generate */
  57. typedef void (SECURITYAPI * F_DIGITALSIGNATUREGENERATE)
  58. (long *return_code,
  59. long *reason_code,
  60. long *exit_data_length,
  61. unsigned char *exit_data,
  62. long *rule_array_count,
  63. unsigned char *rule_array,
  64. long *PKA_private_key_id_length,
  65. unsigned char *PKA_private_key_id,
  66. long *hash_length,
  67. unsigned char *hash,
  68. long *signature_field_length,
  69. long *signature_bit_length, unsigned char *signature_field);
  70. /* Digital Signature Verify */
  71. typedef void (SECURITYAPI * F_DIGITALSIGNATUREVERIFY) (long *return_code,
  72. long *reason_code,
  73. long *exit_data_length,
  74. unsigned char
  75. *exit_data,
  76. long *rule_array_count,
  77. unsigned char
  78. *rule_array,
  79. long
  80. *PKA_public_key_id_length,
  81. unsigned char
  82. *PKA_public_key_id,
  83. long *hash_length,
  84. unsigned char *hash,
  85. long
  86. *signature_field_length,
  87. unsigned char
  88. *signature_field);
  89. /* PKA Public Key Extract */
  90. typedef void (SECURITYAPI * F_PUBLICKEYEXTRACT) (long *return_code,
  91. long *reason_code,
  92. long *exit_data_length,
  93. unsigned char *exit_data,
  94. long *rule_array_count,
  95. unsigned char *rule_array,
  96. long
  97. *source_key_identifier_length,
  98. unsigned char
  99. *source_key_identifier,
  100. long
  101. *target_key_token_length,
  102. unsigned char
  103. *target_key_token);
  104. /* PKA Encrypt */
  105. typedef void (SECURITYAPI * F_PKAENCRYPT)
  106. (long *return_code,
  107. long *reason_code,
  108. long *exit_data_length,
  109. unsigned char *exit_data,
  110. long *rule_array_count,
  111. unsigned char *rule_array,
  112. long *key_value_length,
  113. unsigned char *key_value,
  114. long *data_struct_length,
  115. unsigned char *data_struct,
  116. long *RSA_public_key_length,
  117. unsigned char *RSA_public_key,
  118. long *RSA_encipher_length, unsigned char *RSA_encipher);
  119. /* PKA Decrypt */
  120. typedef void (SECURITYAPI * F_PKADECRYPT)
  121. (long *return_code,
  122. long *reason_code,
  123. long *exit_data_length,
  124. unsigned char *exit_data,
  125. long *rule_array_count,
  126. unsigned char *rule_array,
  127. long *enciphered_key_length,
  128. unsigned char *enciphered_key,
  129. long *data_struct_length,
  130. unsigned char *data_struct,
  131. long *RSA_private_key_length,
  132. unsigned char *RSA_private_key,
  133. long *key_value_length, unsigned char *key_value);
  134. #endif