source: UsbWattMeter/trunk/wolfssl-3.7.0/wolfssl/openssl/rsa.h@ 164

Last change on this file since 164 was 164, checked in by coas-nagasima, 6 years ago

TOPPERS/ECNLサンプルアプリ「USB充電器電力計」を追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-chdr
File size: 2.3 KB
Line 
1/* rsa.h for openSSL */
2
3
4#ifndef WOLFSSL_RSA_H_
5#define WOLFSSL_RSA_H_
6
7#include <wolfssl/openssl/ssl.h>
8#include <wolfssl/openssl/bn.h>
9
10
11#ifdef __cplusplus
12 extern "C" {
13#endif
14
15
16enum {
17 RSA_PKCS1_PADDING = 1
18 };
19
20struct WOLFSSL_RSA {
21 WOLFSSL_BIGNUM* n;
22 WOLFSSL_BIGNUM* e;
23 WOLFSSL_BIGNUM* d;
24 WOLFSSL_BIGNUM* p;
25 WOLFSSL_BIGNUM* q;
26 WOLFSSL_BIGNUM* dmp1; /* dP */
27 WOLFSSL_BIGNUM* dmq1; /* dQ */
28 WOLFSSL_BIGNUM* iqmp; /* u */
29 void* internal; /* our RSA */
30 char inSet; /* internal set from external ? */
31 char exSet; /* external set from internal ? */
32};
33
34
35WOLFSSL_API WOLFSSL_RSA* wolfSSL_RSA_new(void);
36WOLFSSL_API void wolfSSL_RSA_free(WOLFSSL_RSA*);
37
38WOLFSSL_API int wolfSSL_RSA_generate_key_ex(WOLFSSL_RSA*, int bits, WOLFSSL_BIGNUM*,
39 void* cb);
40
41WOLFSSL_API int wolfSSL_RSA_blinding_on(WOLFSSL_RSA*, WOLFSSL_BN_CTX*);
42WOLFSSL_API int wolfSSL_RSA_public_encrypt(int len, unsigned char* fr,
43 unsigned char* to, WOLFSSL_RSA*, int padding);
44WOLFSSL_API int wolfSSL_RSA_private_decrypt(int len, unsigned char* fr,
45 unsigned char* to, WOLFSSL_RSA*, int padding);
46
47WOLFSSL_API int wolfSSL_RSA_size(const WOLFSSL_RSA*);
48WOLFSSL_API int wolfSSL_RSA_sign(int type, const unsigned char* m,
49 unsigned int mLen, unsigned char* sigRet,
50 unsigned int* sigLen, WOLFSSL_RSA*);
51WOLFSSL_API int wolfSSL_RSA_public_decrypt(int flen, unsigned char* from,
52 unsigned char* to, WOLFSSL_RSA*, int padding);
53WOLFSSL_API int wolfSSL_RSA_GenAdd(WOLFSSL_RSA*);
54WOLFSSL_API int wolfSSL_RSA_LoadDer(WOLFSSL_RSA*, const unsigned char*, int sz);
55
56
57#define RSA_new wolfSSL_RSA_new
58#define RSA_free wolfSSL_RSA_free
59
60#define RSA_generate_key_ex wolfSSL_RSA_generate_key_ex
61
62#define RSA_blinding_on wolfSSL_RSA_blinding_on
63#define RSA_public_encrypt wolfSSL_RSA_public_encrypt
64#define RSA_private_decrypt wolfSSL_RSA_private_decrypt
65
66#define RSA_size wolfSSL_RSA_size
67#define RSA_sign wolfSSL_RSA_sign
68#define RSA_public_decrypt wolfSSL_RSA_public_decrypt
69
70
71#ifdef __cplusplus
72 } /* extern "C" */
73#endif
74
75#endif /* header */
Note: See TracBrowser for help on using the repository browser.