11#if defined(__cplusplus)
25#define GS_CRYPT_HASHSIZE GS_CRYPT_SHA1_HASHSIZE
27#define GS_CRYPT_SHA1_HASHSIZE 20
28#define GS_CRYPT_MD5_HASHSIZE 16
31#define GS_CRYPT_RSA_ES_PKCS1v1_5
33#ifndef GS_CRYPT_RSA_BINARY_SIZE
34#define GS_CRYPT_RSA_BINARY_SIZE 1024
37#define GS_CRYPT_RSA_BYTE_SIZE (GS_CRYPT_RSA_BINARY_SIZE/8)
39#define GS_CRYPT_RSA_DATABLOCKSIZE (GS_CRYPT_RSA_BYTE_SIZE-GS_CRYPT_HASHSIZE-1)
50 gsLargeInt_t exponent;
56 gsi_u8 maskedSeed[GS_CRYPT_HASHSIZE];
57 gsi_u8 maskedData[GS_CRYPT_RSA_DATABLOCKSIZE];
63 gsi_u8 data[GS_CRYPT_RSA_BYTE_SIZE-2];
71gsi_i32 gsCryptRSAEncryptBuffer(
const gsCryptRSAKey *publicKey,
const unsigned char *plainText, gsi_u32 len,
unsigned char cipherText[GS_CRYPT_RSA_BYTE_SIZE]);
72gsi_i32 gsCryptRSAVerifySignedHash(
const gsCryptRSAKey *publicKey,
const unsigned char *hash, gsi_u32 hashLen,
const unsigned char *sig, gsi_u32 sigLen);
76gsi_i32 gsCryptRSADecryptBuffer(
const gsCryptRSAKey *privateKey,
const unsigned char cipherText[GS_CRYPT_RSA_BYTE_SIZE],
unsigned char *plainTextOut, gsi_u32 *lenOut);
81gsi_i32 gsCryptRSASignData(
const gsCryptRSAKey *privateKey,
const unsigned char *plainText, gsi_u32 plainTextLen,
unsigned char *signedDataOut, gsi_u32 *lenOut);
82gsi_i32 gsCryptRSASignHash(
const gsCryptRSAKey *privateKey,
const unsigned char *hash, gsi_u32 hashLen,
unsigned char *signedDataOut, gsi_u32 *lenOut);
86#if defined(__cplusplus)