source: asp3_tinet_ecnl_arm/trunk/wolfssl-3.12.2/wolfssl/openssl/rsa.h@ 352

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

arm向けASP3版ECNLを追加

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