- Timestamp:
- Feb 7, 2019, 8:36:33 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_arm/trunk/wolfssl-3.12.2/wolfssl/openssl/rsa.h
r352 r372 1 /* rsa.h 2 * 3 * Copyright (C) 2006-2017 wolfSSL Inc. 4 * 5 * This file is part of wolfSSL. 6 * 7 * wolfSSL is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * wolfSSL is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA 20 */ 21 1 22 /* rsa.h for openSSL */ 2 23 … … 12 33 #endif 13 34 14 15 enum { 16 RSA_PKCS1_PADDING = 1, 17 RSA_PKCS1_OAEP_PADDING = 4 18 }; 19 20 /* rsaTypes */ 21 enum { 22 NID_sha256 = 672, 23 NID_sha384 = 673, 24 NID_sha512 = 674 25 }; 35 /* Padding types */ 36 #define RSA_PKCS1_PADDING 0 37 #define RSA_PKCS1_OAEP_PADDING 1 26 38 27 39 #ifndef WOLFSSL_RSA_TYPE_DEFINED /* guard on redeclaration */ … … 33 45 34 46 struct WOLFSSL_RSA { 47 #ifdef WC_RSA_BLINDING 48 WC_RNG* rng; /* for PrivateDecrypt blinding */ 49 #endif 35 50 WOLFSSL_BIGNUM* n; 36 51 WOLFSSL_BIGNUM* e; … … 41 56 WOLFSSL_BIGNUM* dmq1; /* dQ */ 42 57 WOLFSSL_BIGNUM* iqmp; /* u */ 58 void* heap; 43 59 void* internal; /* our RSA */ 44 60 char inSet; /* internal set from external ? */ 45 61 char exSet; /* external set from internal ? */ 62 char ownRng; /* flag for if the rng should be free'd */ 46 63 }; 47 64 … … 58 75 WOLFSSL_API int wolfSSL_RSA_private_decrypt(int len, const unsigned char* fr, 59 76 unsigned char* to, WOLFSSL_RSA*, int padding); 77 WOLFSSL_API int wolfSSL_RSA_private_encrypt(int len, unsigned char* in, 78 unsigned char* out, WOLFSSL_RSA* rsa, int padding); 60 79 61 80 WOLFSSL_API int wolfSSL_RSA_size(const WOLFSSL_RSA*); … … 63 82 unsigned int mLen, unsigned char* sigRet, 64 83 unsigned int* sigLen, WOLFSSL_RSA*); 84 WOLFSSL_API int wolfSSL_RSA_sign_ex(int type, const unsigned char* m, 85 unsigned int mLen, unsigned char* sigRet, 86 unsigned int* sigLen, WOLFSSL_RSA*, int); 87 WOLFSSL_API int wolfSSL_RSA_verify(int type, const unsigned char* m, 88 unsigned int mLen, const unsigned char* sig, 89 unsigned int sigLen, WOLFSSL_RSA*); 65 90 WOLFSSL_API int wolfSSL_RSA_public_decrypt(int flen, const unsigned char* from, 66 91 unsigned char* to, WOLFSSL_RSA*, int padding); 67 92 WOLFSSL_API int wolfSSL_RSA_GenAdd(WOLFSSL_RSA*); 68 93 WOLFSSL_API int wolfSSL_RSA_LoadDer(WOLFSSL_RSA*, const unsigned char*, int sz); 94 WOLFSSL_API int wolfSSL_RSA_LoadDer_ex(WOLFSSL_RSA*, const unsigned char*, int sz, int opt); 69 95 96 #define WOLFSSL_RSA_LOAD_PRIVATE 1 97 #define WOLFSSL_RSA_LOAD_PUBLIC 2 98 #define WOLFSSL_RSA_F4 0x10001L 70 99 71 100 #define RSA_new wolfSSL_RSA_new … … 77 106 #define RSA_public_encrypt wolfSSL_RSA_public_encrypt 78 107 #define RSA_private_decrypt wolfSSL_RSA_private_decrypt 108 #define RSA_private_encrypt wolfSSL_RSA_private_encrypt 79 109 80 110 #define RSA_size wolfSSL_RSA_size 81 111 #define RSA_sign wolfSSL_RSA_sign 112 #define RSA_verify wolfSSL_RSA_verify 82 113 #define RSA_public_decrypt wolfSSL_RSA_public_decrypt 83 114 115 #define RSA_F4 WOLFSSL_RSA_F4 84 116 85 117 #ifdef __cplusplus
Note:
See TracChangeset
for help on using the changeset viewer.