Ignore:
Timestamp:
Feb 7, 2019, 8:36:33 AM (5 years ago)
Author:
coas-nagasima
Message:

wolfsslを3.15.7にバージョンアップ

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
    122/* rsa.h for openSSL */
    223
     
    1233#endif
    1334
    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
    2638
    2739#ifndef WOLFSSL_RSA_TYPE_DEFINED /* guard on redeclaration */
     
    3345
    3446struct WOLFSSL_RSA {
     47#ifdef WC_RSA_BLINDING
     48    WC_RNG* rng;              /* for PrivateDecrypt blinding */
     49#endif
    3550        WOLFSSL_BIGNUM* n;
    3651        WOLFSSL_BIGNUM* e;
     
    4156        WOLFSSL_BIGNUM* dmq1;      /* dQ */
    4257        WOLFSSL_BIGNUM* iqmp;      /* u */
     58    void*          heap;
    4359    void*          internal;  /* our RSA */
    4460    char           inSet;     /* internal set from external ? */
    4561    char           exSet;     /* external set from internal ? */
     62    char           ownRng;    /* flag for if the rng should be free'd */
    4663};
    4764
     
    5875WOLFSSL_API int wolfSSL_RSA_private_decrypt(int len, const unsigned char* fr,
    5976                                 unsigned char* to, WOLFSSL_RSA*, int padding);
     77WOLFSSL_API int wolfSSL_RSA_private_encrypt(int len, unsigned char* in,
     78                            unsigned char* out, WOLFSSL_RSA* rsa, int padding);
    6079
    6180WOLFSSL_API int wolfSSL_RSA_size(const WOLFSSL_RSA*);
     
    6382                               unsigned int mLen, unsigned char* sigRet,
    6483                               unsigned int* sigLen, WOLFSSL_RSA*);
     84WOLFSSL_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);
     87WOLFSSL_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*);
    6590WOLFSSL_API int wolfSSL_RSA_public_decrypt(int flen, const unsigned char* from,
    6691                                  unsigned char* to, WOLFSSL_RSA*, int padding);
    6792WOLFSSL_API int wolfSSL_RSA_GenAdd(WOLFSSL_RSA*);
    6893WOLFSSL_API int wolfSSL_RSA_LoadDer(WOLFSSL_RSA*, const unsigned char*, int sz);
     94WOLFSSL_API int wolfSSL_RSA_LoadDer_ex(WOLFSSL_RSA*, const unsigned char*, int sz, int opt);
    6995
     96#define WOLFSSL_RSA_LOAD_PRIVATE 1
     97#define WOLFSSL_RSA_LOAD_PUBLIC  2
     98#define WOLFSSL_RSA_F4           0x10001L
    7099
    71100#define RSA_new  wolfSSL_RSA_new
     
    77106#define RSA_public_encrypt  wolfSSL_RSA_public_encrypt
    78107#define RSA_private_decrypt wolfSSL_RSA_private_decrypt
     108#define RSA_private_encrypt wolfSSL_RSA_private_encrypt
    79109
    80110#define RSA_size           wolfSSL_RSA_size
    81111#define RSA_sign           wolfSSL_RSA_sign
     112#define RSA_verify          wolfSSL_RSA_verify
    82113#define RSA_public_decrypt wolfSSL_RSA_public_decrypt
    83114
     115#define RSA_F4             WOLFSSL_RSA_F4
    84116
    85117#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.