CyaSSL 3.0.0
Dependents: HTTPClient-SSL HTTPClient HTTPClient-SSL http_access ... more
cyassl/openssl/rsa.h@3:64d4f7cb83d5, 2014-12-03 (annotated)
- Committer:
- wolfSSL
- Date:
- Wed Dec 03 05:24:18 2014 +0000
- Revision:
- 3:64d4f7cb83d5
- Parent:
- 0:1239e9b70ca2
added IGNORE_KEY_EXTENSIONS
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wolfSSL | 0:1239e9b70ca2 | 1 | /* rsa.h for openSSL */ |
wolfSSL | 0:1239e9b70ca2 | 2 | |
wolfSSL | 0:1239e9b70ca2 | 3 | |
wolfSSL | 0:1239e9b70ca2 | 4 | #ifndef CYASSL_RSA_H_ |
wolfSSL | 0:1239e9b70ca2 | 5 | #define CYASSL_RSA_H_ |
wolfSSL | 0:1239e9b70ca2 | 6 | |
wolfSSL | 0:1239e9b70ca2 | 7 | #include <cyassl/openssl/ssl.h> |
wolfSSL | 0:1239e9b70ca2 | 8 | #include <cyassl/openssl/bn.h> |
wolfSSL | 0:1239e9b70ca2 | 9 | |
wolfSSL | 0:1239e9b70ca2 | 10 | |
wolfSSL | 0:1239e9b70ca2 | 11 | #ifdef __cplusplus |
wolfSSL | 0:1239e9b70ca2 | 12 | extern "C" { |
wolfSSL | 0:1239e9b70ca2 | 13 | #endif |
wolfSSL | 0:1239e9b70ca2 | 14 | |
wolfSSL | 0:1239e9b70ca2 | 15 | |
wolfSSL | 0:1239e9b70ca2 | 16 | enum { |
wolfSSL | 0:1239e9b70ca2 | 17 | RSA_PKCS1_PADDING = 1 |
wolfSSL | 0:1239e9b70ca2 | 18 | }; |
wolfSSL | 0:1239e9b70ca2 | 19 | |
wolfSSL | 0:1239e9b70ca2 | 20 | struct CYASSL_RSA { |
wolfSSL | 0:1239e9b70ca2 | 21 | CYASSL_BIGNUM* n; |
wolfSSL | 0:1239e9b70ca2 | 22 | CYASSL_BIGNUM* e; |
wolfSSL | 0:1239e9b70ca2 | 23 | CYASSL_BIGNUM* d; |
wolfSSL | 0:1239e9b70ca2 | 24 | CYASSL_BIGNUM* p; |
wolfSSL | 0:1239e9b70ca2 | 25 | CYASSL_BIGNUM* q; |
wolfSSL | 0:1239e9b70ca2 | 26 | CYASSL_BIGNUM* dmp1; /* dP */ |
wolfSSL | 0:1239e9b70ca2 | 27 | CYASSL_BIGNUM* dmq1; /* dQ */ |
wolfSSL | 0:1239e9b70ca2 | 28 | CYASSL_BIGNUM* iqmp; /* u */ |
wolfSSL | 0:1239e9b70ca2 | 29 | void* internal; /* our RSA */ |
wolfSSL | 0:1239e9b70ca2 | 30 | char inSet; /* internal set from external ? */ |
wolfSSL | 0:1239e9b70ca2 | 31 | char exSet; /* external set from internal ? */ |
wolfSSL | 0:1239e9b70ca2 | 32 | }; |
wolfSSL | 0:1239e9b70ca2 | 33 | |
wolfSSL | 0:1239e9b70ca2 | 34 | |
wolfSSL | 0:1239e9b70ca2 | 35 | CYASSL_API CYASSL_RSA* CyaSSL_RSA_new(void); |
wolfSSL | 0:1239e9b70ca2 | 36 | CYASSL_API void CyaSSL_RSA_free(CYASSL_RSA*); |
wolfSSL | 0:1239e9b70ca2 | 37 | |
wolfSSL | 0:1239e9b70ca2 | 38 | CYASSL_API int CyaSSL_RSA_generate_key_ex(CYASSL_RSA*, int bits, CYASSL_BIGNUM*, |
wolfSSL | 0:1239e9b70ca2 | 39 | void* cb); |
wolfSSL | 0:1239e9b70ca2 | 40 | |
wolfSSL | 0:1239e9b70ca2 | 41 | CYASSL_API int CyaSSL_RSA_blinding_on(CYASSL_RSA*, CYASSL_BN_CTX*); |
wolfSSL | 0:1239e9b70ca2 | 42 | CYASSL_API int CyaSSL_RSA_public_encrypt(int len, unsigned char* fr, |
wolfSSL | 0:1239e9b70ca2 | 43 | unsigned char* to, CYASSL_RSA*, int padding); |
wolfSSL | 0:1239e9b70ca2 | 44 | CYASSL_API int CyaSSL_RSA_private_decrypt(int len, unsigned char* fr, |
wolfSSL | 0:1239e9b70ca2 | 45 | unsigned char* to, CYASSL_RSA*, int padding); |
wolfSSL | 0:1239e9b70ca2 | 46 | |
wolfSSL | 0:1239e9b70ca2 | 47 | CYASSL_API int CyaSSL_RSA_size(const CYASSL_RSA*); |
wolfSSL | 0:1239e9b70ca2 | 48 | CYASSL_API int CyaSSL_RSA_sign(int type, const unsigned char* m, |
wolfSSL | 0:1239e9b70ca2 | 49 | unsigned int mLen, unsigned char* sigRet, |
wolfSSL | 0:1239e9b70ca2 | 50 | unsigned int* sigLen, CYASSL_RSA*); |
wolfSSL | 0:1239e9b70ca2 | 51 | CYASSL_API int CyaSSL_RSA_public_decrypt(int flen, unsigned char* from, |
wolfSSL | 0:1239e9b70ca2 | 52 | unsigned char* to, CYASSL_RSA*, int padding); |
wolfSSL | 0:1239e9b70ca2 | 53 | CYASSL_API int CyaSSL_RSA_GenAdd(CYASSL_RSA*); |
wolfSSL | 0:1239e9b70ca2 | 54 | CYASSL_API int CyaSSL_RSA_LoadDer(CYASSL_RSA*, const unsigned char*, int sz); |
wolfSSL | 0:1239e9b70ca2 | 55 | |
wolfSSL | 0:1239e9b70ca2 | 56 | |
wolfSSL | 0:1239e9b70ca2 | 57 | #define RSA_new CyaSSL_RSA_new |
wolfSSL | 0:1239e9b70ca2 | 58 | #define RSA_free CyaSSL_RSA_free |
wolfSSL | 0:1239e9b70ca2 | 59 | |
wolfSSL | 0:1239e9b70ca2 | 60 | #define RSA_generate_key_ex CyaSSL_RSA_generate_key_ex |
wolfSSL | 0:1239e9b70ca2 | 61 | |
wolfSSL | 0:1239e9b70ca2 | 62 | #define RSA_blinding_on CyaSSL_RSA_blinding_on |
wolfSSL | 0:1239e9b70ca2 | 63 | #define RSA_public_encrypt CyaSSL_RSA_public_encrypt |
wolfSSL | 0:1239e9b70ca2 | 64 | #define RSA_private_decrypt CyaSSL_RSA_private_decrypt |
wolfSSL | 0:1239e9b70ca2 | 65 | |
wolfSSL | 0:1239e9b70ca2 | 66 | #define RSA_size CyaSSL_RSA_size |
wolfSSL | 0:1239e9b70ca2 | 67 | #define RSA_sign CyaSSL_RSA_sign |
wolfSSL | 0:1239e9b70ca2 | 68 | #define RSA_public_decrypt CyaSSL_RSA_public_decrypt |
wolfSSL | 0:1239e9b70ca2 | 69 | |
wolfSSL | 0:1239e9b70ca2 | 70 | |
wolfSSL | 0:1239e9b70ca2 | 71 | #ifdef __cplusplus |
wolfSSL | 0:1239e9b70ca2 | 72 | } /* extern "C" */ |
wolfSSL | 0:1239e9b70ca2 | 73 | #endif |
wolfSSL | 0:1239e9b70ca2 | 74 | |
wolfSSL | 0:1239e9b70ca2 | 75 | #endif /* header */ |
wolfSSL | 0:1239e9b70ca2 | 76 |