hw_4758_cca.h
上传用户:yisoukefu
上传日期:2020-08-09
资源大小:39506k
文件大小:5k
源码类别:

其他游戏

开发平台:

Visual C++

  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.     /* Fixme!!         
  25.       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,
  49.               long          * key_token_length,
  50.               unsigned char * key_token);
  51. /* Random Number Generate */
  52. typedef void (SECURITYAPI *F_RANDOMNUMBERGENERATE)
  53.              (long          * return_code,
  54.               long          * reason_code,
  55.               long          * exit_data_length,
  56.               unsigned char * exit_data,
  57.               unsigned char * form,
  58.               unsigned char * random_number);
  59. /* Digital Signature Generate */
  60. typedef void (SECURITYAPI *F_DIGITALSIGNATUREGENERATE)
  61.              (long          * return_code,
  62.               long          * reason_code,
  63.               long          * exit_data_length,
  64.               unsigned char * exit_data,
  65.               long          * rule_array_count,
  66.               unsigned char * rule_array,
  67.               long          * PKA_private_key_id_length,
  68.               unsigned char * PKA_private_key_id,
  69.               long          * hash_length,
  70.               unsigned char * hash,
  71.               long          * signature_field_length,
  72.               long          * signature_bit_length,
  73.               unsigned char * signature_field);
  74. /* Digital Signature Verify */
  75. typedef void (SECURITYAPI *F_DIGITALSIGNATUREVERIFY)(
  76.               long          * return_code,
  77.               long          * reason_code,
  78.               long          * exit_data_length,
  79.               unsigned char * exit_data,
  80.               long          * rule_array_count,
  81.               unsigned char * rule_array,
  82.               long          * PKA_public_key_id_length,
  83.               unsigned char * PKA_public_key_id,
  84.               long          * hash_length,
  85.               unsigned char * hash,
  86.               long          * signature_field_length,
  87.               unsigned char * signature_field);
  88. /* PKA Public Key Extract */
  89. typedef void (SECURITYAPI *F_PUBLICKEYEXTRACT)(
  90.               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          * source_key_identifier_length,
  97.               unsigned char * source_key_identifier,
  98.               long          * target_key_token_length,
  99.               unsigned char * target_key_token);
  100. /* PKA Encrypt */
  101. typedef void   (SECURITYAPI *F_PKAENCRYPT)
  102.                (long          *  return_code,
  103.                  long          *  reason_code,
  104.                  long          *  exit_data_length,
  105.                  unsigned char *  exit_data,
  106.                  long          *  rule_array_count,
  107.                  unsigned char *  rule_array,
  108.                  long          *  key_value_length,
  109.                  unsigned char *  key_value,
  110.                  long          *  data_struct_length,
  111.                  unsigned char *  data_struct,
  112.                  long          *  RSA_public_key_length,
  113.                  unsigned char *  RSA_public_key,
  114.                  long          *  RSA_encipher_length,
  115.                  unsigned char *  RSA_encipher );
  116. /* PKA Decrypt */
  117. typedef void    (SECURITYAPI *F_PKADECRYPT)
  118.                 (long          *  return_code,
  119.                  long          *  reason_code,
  120.                  long          *  exit_data_length,
  121.                  unsigned char *  exit_data,
  122.                  long          *  rule_array_count,
  123.                  unsigned char *  rule_array,
  124.                  long          *  enciphered_key_length,
  125.                  unsigned char *  enciphered_key,
  126.                  long          *  data_struct_length,
  127.                  unsigned char *  data_struct,
  128.                  long          *  RSA_private_key_length,
  129.                  unsigned char *  RSA_private_key,
  130.                  long          *  key_value_length,
  131.                  unsigned char *  key_value    );
  132. #endif