1ebfedea0SLionel Sambuc /* crypto/rsa/rsa.h */ 2ebfedea0SLionel Sambuc /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3ebfedea0SLionel Sambuc * All rights reserved. 4ebfedea0SLionel Sambuc * 5ebfedea0SLionel Sambuc * This package is an SSL implementation written 6ebfedea0SLionel Sambuc * by Eric Young (eay@cryptsoft.com). 7ebfedea0SLionel Sambuc * The implementation was written so as to conform with Netscapes SSL. 8ebfedea0SLionel Sambuc * 9ebfedea0SLionel Sambuc * This library is free for commercial and non-commercial use as long as 10ebfedea0SLionel Sambuc * the following conditions are aheared to. The following conditions 11ebfedea0SLionel Sambuc * apply to all code found in this distribution, be it the RC4, RSA, 12ebfedea0SLionel Sambuc * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13ebfedea0SLionel Sambuc * included with this distribution is covered by the same copyright terms 14ebfedea0SLionel Sambuc * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15ebfedea0SLionel Sambuc * 16ebfedea0SLionel Sambuc * Copyright remains Eric Young's, and as such any Copyright notices in 17ebfedea0SLionel Sambuc * the code are not to be removed. 18ebfedea0SLionel Sambuc * If this package is used in a product, Eric Young should be given attribution 19ebfedea0SLionel Sambuc * as the author of the parts of the library used. 20ebfedea0SLionel Sambuc * This can be in the form of a textual message at program startup or 21ebfedea0SLionel Sambuc * in documentation (online or textual) provided with the package. 22ebfedea0SLionel Sambuc * 23ebfedea0SLionel Sambuc * Redistribution and use in source and binary forms, with or without 24ebfedea0SLionel Sambuc * modification, are permitted provided that the following conditions 25ebfedea0SLionel Sambuc * are met: 26ebfedea0SLionel Sambuc * 1. Redistributions of source code must retain the copyright 27ebfedea0SLionel Sambuc * notice, this list of conditions and the following disclaimer. 28ebfedea0SLionel Sambuc * 2. Redistributions in binary form must reproduce the above copyright 29ebfedea0SLionel Sambuc * notice, this list of conditions and the following disclaimer in the 30ebfedea0SLionel Sambuc * documentation and/or other materials provided with the distribution. 31ebfedea0SLionel Sambuc * 3. All advertising materials mentioning features or use of this software 32ebfedea0SLionel Sambuc * must display the following acknowledgement: 33ebfedea0SLionel Sambuc * "This product includes cryptographic software written by 34ebfedea0SLionel Sambuc * Eric Young (eay@cryptsoft.com)" 35ebfedea0SLionel Sambuc * The word 'cryptographic' can be left out if the rouines from the library 36ebfedea0SLionel Sambuc * being used are not cryptographic related :-). 37ebfedea0SLionel Sambuc * 4. If you include any Windows specific code (or a derivative thereof) from 38ebfedea0SLionel Sambuc * the apps directory (application code) you must include an acknowledgement: 39ebfedea0SLionel Sambuc * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40ebfedea0SLionel Sambuc * 41ebfedea0SLionel Sambuc * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42ebfedea0SLionel Sambuc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43ebfedea0SLionel Sambuc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44ebfedea0SLionel Sambuc * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45ebfedea0SLionel Sambuc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46ebfedea0SLionel Sambuc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47ebfedea0SLionel Sambuc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48ebfedea0SLionel Sambuc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49ebfedea0SLionel Sambuc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50ebfedea0SLionel Sambuc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51ebfedea0SLionel Sambuc * SUCH DAMAGE. 52ebfedea0SLionel Sambuc * 53ebfedea0SLionel Sambuc * The licence and distribution terms for any publically available version or 54ebfedea0SLionel Sambuc * derivative of this code cannot be changed. i.e. this code cannot simply be 55ebfedea0SLionel Sambuc * copied and put under another distribution licence 56ebfedea0SLionel Sambuc * [including the GNU Public Licence.] 57ebfedea0SLionel Sambuc */ 58ebfedea0SLionel Sambuc 59ebfedea0SLionel Sambuc #ifndef HEADER_RSA_H 60ebfedea0SLionel Sambuc # define HEADER_RSA_H 61ebfedea0SLionel Sambuc 62ebfedea0SLionel Sambuc # include <openssl/asn1.h> 63ebfedea0SLionel Sambuc 64ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_BIO 65ebfedea0SLionel Sambuc # include <openssl/bio.h> 66ebfedea0SLionel Sambuc # endif 67ebfedea0SLionel Sambuc # include <openssl/crypto.h> 68ebfedea0SLionel Sambuc # include <openssl/ossl_typ.h> 69ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_DEPRECATED 70ebfedea0SLionel Sambuc # include <openssl/bn.h> 71ebfedea0SLionel Sambuc # endif 72ebfedea0SLionel Sambuc 73ebfedea0SLionel Sambuc # ifdef OPENSSL_NO_RSA 74ebfedea0SLionel Sambuc # error RSA is disabled. 75ebfedea0SLionel Sambuc # endif 76ebfedea0SLionel Sambuc 77ebfedea0SLionel Sambuc #ifdef __cplusplus 78ebfedea0SLionel Sambuc extern "C" { 79ebfedea0SLionel Sambuc #endif 80ebfedea0SLionel Sambuc 81ebfedea0SLionel Sambuc /* Declared already in ossl_typ.h */ 82ebfedea0SLionel Sambuc /* typedef struct rsa_st RSA; */ 83ebfedea0SLionel Sambuc /* typedef struct rsa_meth_st RSA_METHOD; */ 84ebfedea0SLionel Sambuc 85*0a6a1f1dSLionel Sambuc struct rsa_meth_st { 86ebfedea0SLionel Sambuc const char *name; 87ebfedea0SLionel Sambuc int (*rsa_pub_enc) (int flen, const unsigned char *from, 88*0a6a1f1dSLionel Sambuc unsigned char *to, RSA *rsa, int padding); 89ebfedea0SLionel Sambuc int (*rsa_pub_dec) (int flen, const unsigned char *from, 90*0a6a1f1dSLionel Sambuc unsigned char *to, RSA *rsa, int padding); 91ebfedea0SLionel Sambuc int (*rsa_priv_enc) (int flen, const unsigned char *from, 92*0a6a1f1dSLionel Sambuc unsigned char *to, RSA *rsa, int padding); 93ebfedea0SLionel Sambuc int (*rsa_priv_dec) (int flen, const unsigned char *from, 94*0a6a1f1dSLionel Sambuc unsigned char *to, RSA *rsa, int padding); 95*0a6a1f1dSLionel Sambuc /* Can be null */ 96*0a6a1f1dSLionel Sambuc int (*rsa_mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx); 97*0a6a1f1dSLionel Sambuc /* Can be null */ 98ebfedea0SLionel Sambuc int (*bn_mod_exp) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 99*0a6a1f1dSLionel Sambuc const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); 100*0a6a1f1dSLionel Sambuc /* called at new */ 101*0a6a1f1dSLionel Sambuc int (*init) (RSA *rsa); 102*0a6a1f1dSLionel Sambuc /* called at free */ 103*0a6a1f1dSLionel Sambuc int (*finish) (RSA *rsa); 104*0a6a1f1dSLionel Sambuc /* RSA_METHOD_FLAG_* things */ 105*0a6a1f1dSLionel Sambuc int flags; 106*0a6a1f1dSLionel Sambuc /* may be needed! */ 107*0a6a1f1dSLionel Sambuc char *app_data; 108*0a6a1f1dSLionel Sambuc /* 109*0a6a1f1dSLionel Sambuc * New sign and verify functions: some libraries don't allow arbitrary 110*0a6a1f1dSLionel Sambuc * data to be signed/verified: this allows them to be used. Note: for 111*0a6a1f1dSLionel Sambuc * this to work the RSA_public_decrypt() and RSA_private_encrypt() should 112*0a6a1f1dSLionel Sambuc * *NOT* be used RSA_sign(), RSA_verify() should be used instead. Note: 113*0a6a1f1dSLionel Sambuc * for backwards compatibility this functionality is only enabled if the 114*0a6a1f1dSLionel Sambuc * RSA_FLAG_SIGN_VER option is set in 'flags'. 115ebfedea0SLionel Sambuc */ 116ebfedea0SLionel Sambuc int (*rsa_sign) (int type, 117ebfedea0SLionel Sambuc const unsigned char *m, unsigned int m_length, 118*0a6a1f1dSLionel Sambuc unsigned char *sigret, unsigned int *siglen, 119ebfedea0SLionel Sambuc const RSA *rsa); 120*0a6a1f1dSLionel Sambuc int (*rsa_verify) (int dtype, const unsigned char *m, 121*0a6a1f1dSLionel Sambuc unsigned int m_length, const unsigned char *sigbuf, 122*0a6a1f1dSLionel Sambuc unsigned int siglen, const RSA *rsa); 123*0a6a1f1dSLionel Sambuc /* 124*0a6a1f1dSLionel Sambuc * If this callback is NULL, the builtin software RSA key-gen will be 125*0a6a1f1dSLionel Sambuc * used. This is for behavioural compatibility whilst the code gets 126*0a6a1f1dSLionel Sambuc * rewired, but one day it would be nice to assume there are no such 127*0a6a1f1dSLionel Sambuc * things as "builtin software" implementations. 128*0a6a1f1dSLionel Sambuc */ 129ebfedea0SLionel Sambuc int (*rsa_keygen) (RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); 130ebfedea0SLionel Sambuc }; 131ebfedea0SLionel Sambuc 132*0a6a1f1dSLionel Sambuc struct rsa_st { 133*0a6a1f1dSLionel Sambuc /* 134*0a6a1f1dSLionel Sambuc * The first parameter is used to pickup errors where this is passed 135*0a6a1f1dSLionel Sambuc * instead of aEVP_PKEY, it is set to 0 136*0a6a1f1dSLionel Sambuc */ 137ebfedea0SLionel Sambuc int pad; 138ebfedea0SLionel Sambuc long version; 139ebfedea0SLionel Sambuc const RSA_METHOD *meth; 140ebfedea0SLionel Sambuc /* functional reference if 'meth' is ENGINE-provided */ 141ebfedea0SLionel Sambuc ENGINE *engine; 142ebfedea0SLionel Sambuc BIGNUM *n; 143ebfedea0SLionel Sambuc BIGNUM *e; 144ebfedea0SLionel Sambuc BIGNUM *d; 145ebfedea0SLionel Sambuc BIGNUM *p; 146ebfedea0SLionel Sambuc BIGNUM *q; 147ebfedea0SLionel Sambuc BIGNUM *dmp1; 148ebfedea0SLionel Sambuc BIGNUM *dmq1; 149ebfedea0SLionel Sambuc BIGNUM *iqmp; 150ebfedea0SLionel Sambuc /* be careful using this if the RSA structure is shared */ 151ebfedea0SLionel Sambuc CRYPTO_EX_DATA ex_data; 152ebfedea0SLionel Sambuc int references; 153ebfedea0SLionel Sambuc int flags; 154ebfedea0SLionel Sambuc /* Used to cache montgomery values */ 155ebfedea0SLionel Sambuc BN_MONT_CTX *_method_mod_n; 156ebfedea0SLionel Sambuc BN_MONT_CTX *_method_mod_p; 157ebfedea0SLionel Sambuc BN_MONT_CTX *_method_mod_q; 158*0a6a1f1dSLionel Sambuc /* 159*0a6a1f1dSLionel Sambuc * all BIGNUM values are actually in the following data, if it is not 160*0a6a1f1dSLionel Sambuc * NULL 161*0a6a1f1dSLionel Sambuc */ 162ebfedea0SLionel Sambuc char *bignum_data; 163ebfedea0SLionel Sambuc BN_BLINDING *blinding; 164ebfedea0SLionel Sambuc BN_BLINDING *mt_blinding; 165ebfedea0SLionel Sambuc }; 166ebfedea0SLionel Sambuc 167ebfedea0SLionel Sambuc # ifndef OPENSSL_RSA_MAX_MODULUS_BITS 168ebfedea0SLionel Sambuc # define OPENSSL_RSA_MAX_MODULUS_BITS 16384 169ebfedea0SLionel Sambuc # endif 170ebfedea0SLionel Sambuc 171ebfedea0SLionel Sambuc # ifndef OPENSSL_RSA_SMALL_MODULUS_BITS 172ebfedea0SLionel Sambuc # define OPENSSL_RSA_SMALL_MODULUS_BITS 3072 173ebfedea0SLionel Sambuc # endif 174ebfedea0SLionel Sambuc # ifndef OPENSSL_RSA_MAX_PUBEXP_BITS 175*0a6a1f1dSLionel Sambuc 176*0a6a1f1dSLionel Sambuc /* exponent limit enforced for "large" modulus only */ 177*0a6a1f1dSLionel Sambuc # define OPENSSL_RSA_MAX_PUBEXP_BITS 64 178ebfedea0SLionel Sambuc # endif 179ebfedea0SLionel Sambuc 180ebfedea0SLionel Sambuc # define RSA_3 0x3L 181ebfedea0SLionel Sambuc # define RSA_F4 0x10001L 182ebfedea0SLionel Sambuc 183*0a6a1f1dSLionel Sambuc # define RSA_METHOD_FLAG_NO_CHECK 0x0001/* don't check pub/private 184*0a6a1f1dSLionel Sambuc * match */ 185ebfedea0SLionel Sambuc 186ebfedea0SLionel Sambuc # define RSA_FLAG_CACHE_PUBLIC 0x0002 187ebfedea0SLionel Sambuc # define RSA_FLAG_CACHE_PRIVATE 0x0004 188ebfedea0SLionel Sambuc # define RSA_FLAG_BLINDING 0x0008 189ebfedea0SLionel Sambuc # define RSA_FLAG_THREAD_SAFE 0x0010 190*0a6a1f1dSLionel Sambuc /* 191*0a6a1f1dSLionel Sambuc * This flag means the private key operations will be handled by rsa_mod_exp 192ebfedea0SLionel Sambuc * and that they do not depend on the private key components being present: 193*0a6a1f1dSLionel Sambuc * for example a key stored in external hardware. Without this flag 194*0a6a1f1dSLionel Sambuc * bn_mod_exp gets called when private key components are absent. 195ebfedea0SLionel Sambuc */ 196ebfedea0SLionel Sambuc # define RSA_FLAG_EXT_PKEY 0x0020 197ebfedea0SLionel Sambuc 198*0a6a1f1dSLionel Sambuc /* 199*0a6a1f1dSLionel Sambuc * This flag in the RSA_METHOD enables the new rsa_sign, rsa_verify 200*0a6a1f1dSLionel Sambuc * functions. 201ebfedea0SLionel Sambuc */ 202ebfedea0SLionel Sambuc # define RSA_FLAG_SIGN_VER 0x0040 203ebfedea0SLionel Sambuc 204*0a6a1f1dSLionel Sambuc /* 205*0a6a1f1dSLionel Sambuc * new with 0.9.6j and 0.9.7b; the built-in 206ebfedea0SLionel Sambuc * RSA implementation now uses blinding by 207ebfedea0SLionel Sambuc * default (ignoring RSA_FLAG_BLINDING), 208ebfedea0SLionel Sambuc * but other engines might not need it 209ebfedea0SLionel Sambuc */ 210*0a6a1f1dSLionel Sambuc # define RSA_FLAG_NO_BLINDING 0x0080 211*0a6a1f1dSLionel Sambuc /* 212*0a6a1f1dSLionel Sambuc * new with 0.9.8f; the built-in RSA 213ebfedea0SLionel Sambuc * implementation now uses constant time 214ebfedea0SLionel Sambuc * operations by default in private key operations, 215ebfedea0SLionel Sambuc * e.g., constant time modular exponentiation, 216ebfedea0SLionel Sambuc * modular inverse without leaking branches, 217ebfedea0SLionel Sambuc * division without leaking branches. This 218ebfedea0SLionel Sambuc * flag disables these constant time 219ebfedea0SLionel Sambuc * operations and results in faster RSA 220ebfedea0SLionel Sambuc * private key operations. 221ebfedea0SLionel Sambuc */ 222*0a6a1f1dSLionel Sambuc # define RSA_FLAG_NO_CONSTTIME 0x0100 223*0a6a1f1dSLionel Sambuc # ifdef OPENSSL_USE_DEPRECATED 224*0a6a1f1dSLionel Sambuc /* deprecated name for the flag*/ 225*0a6a1f1dSLionel Sambuc /* 226*0a6a1f1dSLionel Sambuc * new with 0.9.7h; the built-in RSA 227ebfedea0SLionel Sambuc * implementation now uses constant time 228ebfedea0SLionel Sambuc * modular exponentiation for secret exponents 229ebfedea0SLionel Sambuc * by default. This flag causes the 230ebfedea0SLionel Sambuc * faster variable sliding window method to 231ebfedea0SLionel Sambuc * be used for all exponents. 232ebfedea0SLionel Sambuc */ 233*0a6a1f1dSLionel Sambuc # define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME 234ebfedea0SLionel Sambuc # endif 235ebfedea0SLionel Sambuc 236ebfedea0SLionel Sambuc # define EVP_PKEY_CTX_set_rsa_padding(ctx, pad) \ 237ebfedea0SLionel Sambuc EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, EVP_PKEY_CTRL_RSA_PADDING, \ 238ebfedea0SLionel Sambuc pad, NULL) 239ebfedea0SLionel Sambuc 240ebfedea0SLionel Sambuc # define EVP_PKEY_CTX_get_rsa_padding(ctx, ppad) \ 241ebfedea0SLionel Sambuc EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, \ 242ebfedea0SLionel Sambuc EVP_PKEY_CTRL_GET_RSA_PADDING, 0, ppad) 243ebfedea0SLionel Sambuc 244ebfedea0SLionel Sambuc # define EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, len) \ 245ebfedea0SLionel Sambuc EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \ 246ebfedea0SLionel Sambuc (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \ 247ebfedea0SLionel Sambuc EVP_PKEY_CTRL_RSA_PSS_SALTLEN, \ 248ebfedea0SLionel Sambuc len, NULL) 249ebfedea0SLionel Sambuc 250ebfedea0SLionel Sambuc # define EVP_PKEY_CTX_get_rsa_pss_saltlen(ctx, plen) \ 251ebfedea0SLionel Sambuc EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \ 252ebfedea0SLionel Sambuc (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \ 253ebfedea0SLionel Sambuc EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN, \ 254ebfedea0SLionel Sambuc 0, plen) 255ebfedea0SLionel Sambuc 256ebfedea0SLionel Sambuc # define EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, bits) \ 257ebfedea0SLionel Sambuc EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \ 258ebfedea0SLionel Sambuc EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL) 259ebfedea0SLionel Sambuc 260ebfedea0SLionel Sambuc # define EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx, pubexp) \ 261ebfedea0SLionel Sambuc EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \ 262ebfedea0SLionel Sambuc EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp) 263ebfedea0SLionel Sambuc 264ebfedea0SLionel Sambuc # define EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, md) \ 265ebfedea0SLionel Sambuc EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_SIG, \ 266ebfedea0SLionel Sambuc EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)md) 267ebfedea0SLionel Sambuc 268ebfedea0SLionel Sambuc # define EVP_PKEY_CTX_get_rsa_mgf1_md(ctx, pmd) \ 269ebfedea0SLionel Sambuc EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_SIG, \ 270ebfedea0SLionel Sambuc EVP_PKEY_CTRL_GET_RSA_MGF1_MD, 0, (void *)pmd) 271ebfedea0SLionel Sambuc 272ebfedea0SLionel Sambuc # define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1) 273ebfedea0SLionel Sambuc # define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2) 274ebfedea0SLionel Sambuc 275ebfedea0SLionel Sambuc # define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3) 276ebfedea0SLionel Sambuc # define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4) 277ebfedea0SLionel Sambuc # define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 5) 278ebfedea0SLionel Sambuc 279ebfedea0SLionel Sambuc # define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 6) 280ebfedea0SLionel Sambuc # define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 7) 281ebfedea0SLionel Sambuc # define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 8) 282ebfedea0SLionel Sambuc 283ebfedea0SLionel Sambuc # define RSA_PKCS1_PADDING 1 284ebfedea0SLionel Sambuc # define RSA_SSLV23_PADDING 2 285ebfedea0SLionel Sambuc # define RSA_NO_PADDING 3 286ebfedea0SLionel Sambuc # define RSA_PKCS1_OAEP_PADDING 4 287ebfedea0SLionel Sambuc # define RSA_X931_PADDING 5 288ebfedea0SLionel Sambuc /* EVP_PKEY_ only */ 289ebfedea0SLionel Sambuc # define RSA_PKCS1_PSS_PADDING 6 290ebfedea0SLionel Sambuc 291ebfedea0SLionel Sambuc # define RSA_PKCS1_PADDING_SIZE 11 292ebfedea0SLionel Sambuc 293ebfedea0SLionel Sambuc # define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg) 294ebfedea0SLionel Sambuc # define RSA_get_app_data(s) RSA_get_ex_data(s,0) 295ebfedea0SLionel Sambuc 296ebfedea0SLionel Sambuc RSA *RSA_new(void); 297ebfedea0SLionel Sambuc RSA *RSA_new_method(ENGINE *engine); 298ebfedea0SLionel Sambuc int RSA_size(const RSA *rsa); 299ebfedea0SLionel Sambuc 300ebfedea0SLionel Sambuc /* Deprecated version */ 301ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_DEPRECATED 302ebfedea0SLionel Sambuc RSA *RSA_generate_key(int bits, unsigned long e, void 303ebfedea0SLionel Sambuc (*callback) (int, int, void *), void *cb_arg); 304ebfedea0SLionel Sambuc # endif /* !defined(OPENSSL_NO_DEPRECATED) */ 305ebfedea0SLionel Sambuc 306ebfedea0SLionel Sambuc /* New version */ 307ebfedea0SLionel Sambuc int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); 308ebfedea0SLionel Sambuc 309ebfedea0SLionel Sambuc int RSA_check_key(const RSA *); 310ebfedea0SLionel Sambuc /* next 4 return -1 on error */ 311ebfedea0SLionel Sambuc int RSA_public_encrypt(int flen, const unsigned char *from, 312ebfedea0SLionel Sambuc unsigned char *to, RSA *rsa, int padding); 313ebfedea0SLionel Sambuc int RSA_private_encrypt(int flen, const unsigned char *from, 314ebfedea0SLionel Sambuc unsigned char *to, RSA *rsa, int padding); 315ebfedea0SLionel Sambuc int RSA_public_decrypt(int flen, const unsigned char *from, 316ebfedea0SLionel Sambuc unsigned char *to, RSA *rsa, int padding); 317ebfedea0SLionel Sambuc int RSA_private_decrypt(int flen, const unsigned char *from, 318ebfedea0SLionel Sambuc unsigned char *to, RSA *rsa, int padding); 319ebfedea0SLionel Sambuc void RSA_free(RSA *r); 320ebfedea0SLionel Sambuc /* "up" the RSA object's reference count */ 321ebfedea0SLionel Sambuc int RSA_up_ref(RSA *r); 322ebfedea0SLionel Sambuc 323ebfedea0SLionel Sambuc int RSA_flags(const RSA *r); 324ebfedea0SLionel Sambuc 325ebfedea0SLionel Sambuc void RSA_set_default_method(const RSA_METHOD *meth); 326ebfedea0SLionel Sambuc const RSA_METHOD *RSA_get_default_method(void); 327ebfedea0SLionel Sambuc const RSA_METHOD *RSA_get_method(const RSA *rsa); 328ebfedea0SLionel Sambuc int RSA_set_method(RSA *rsa, const RSA_METHOD *meth); 329ebfedea0SLionel Sambuc 330ebfedea0SLionel Sambuc /* This function needs the memory locking malloc callbacks to be installed */ 331ebfedea0SLionel Sambuc int RSA_memory_lock(RSA *r); 332ebfedea0SLionel Sambuc 333ebfedea0SLionel Sambuc /* these are the actual SSLeay RSA functions */ 334ebfedea0SLionel Sambuc const RSA_METHOD *RSA_PKCS1_SSLeay(void); 335ebfedea0SLionel Sambuc 336ebfedea0SLionel Sambuc const RSA_METHOD *RSA_null_method(void); 337ebfedea0SLionel Sambuc 338ebfedea0SLionel Sambuc DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey) 339ebfedea0SLionel Sambuc DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey) 340ebfedea0SLionel Sambuc 341*0a6a1f1dSLionel Sambuc typedef struct rsa_pss_params_st { 342ebfedea0SLionel Sambuc X509_ALGOR *hashAlgorithm; 343ebfedea0SLionel Sambuc X509_ALGOR *maskGenAlgorithm; 344ebfedea0SLionel Sambuc ASN1_INTEGER *saltLength; 345ebfedea0SLionel Sambuc ASN1_INTEGER *trailerField; 346ebfedea0SLionel Sambuc } RSA_PSS_PARAMS; 347ebfedea0SLionel Sambuc 348ebfedea0SLionel Sambuc DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS) 349ebfedea0SLionel Sambuc 350ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_FP_API 351ebfedea0SLionel Sambuc int RSA_print_fp(FILE *fp, const RSA *r, int offset); 352ebfedea0SLionel Sambuc # endif 353ebfedea0SLionel Sambuc 354ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_BIO 355ebfedea0SLionel Sambuc int RSA_print(BIO *bp, const RSA *r, int offset); 356ebfedea0SLionel Sambuc # endif 357ebfedea0SLionel Sambuc 358ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_RC4 359ebfedea0SLionel Sambuc int i2d_RSA_NET(const RSA *a, unsigned char **pp, 360*0a6a1f1dSLionel Sambuc int (*cb) (char *buf, int len, const char *prompt, 361*0a6a1f1dSLionel Sambuc int verify), int sgckey); 362ebfedea0SLionel Sambuc RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length, 363*0a6a1f1dSLionel Sambuc int (*cb) (char *buf, int len, const char *prompt, 364*0a6a1f1dSLionel Sambuc int verify), int sgckey); 365ebfedea0SLionel Sambuc 366ebfedea0SLionel Sambuc int i2d_Netscape_RSA(const RSA *a, unsigned char **pp, 367ebfedea0SLionel Sambuc int (*cb) (char *buf, int len, const char *prompt, 368ebfedea0SLionel Sambuc int verify)); 369ebfedea0SLionel Sambuc RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length, 370ebfedea0SLionel Sambuc int (*cb) (char *buf, int len, const char *prompt, 371ebfedea0SLionel Sambuc int verify)); 372ebfedea0SLionel Sambuc # endif 373ebfedea0SLionel Sambuc 374*0a6a1f1dSLionel Sambuc /* 375*0a6a1f1dSLionel Sambuc * The following 2 functions sign and verify a X509_SIG ASN1 object inside 376*0a6a1f1dSLionel Sambuc * PKCS#1 padded RSA encryption 377*0a6a1f1dSLionel Sambuc */ 378ebfedea0SLionel Sambuc int RSA_sign(int type, const unsigned char *m, unsigned int m_length, 379ebfedea0SLionel Sambuc unsigned char *sigret, unsigned int *siglen, RSA *rsa); 380ebfedea0SLionel Sambuc int RSA_verify(int type, const unsigned char *m, unsigned int m_length, 381ebfedea0SLionel Sambuc const unsigned char *sigbuf, unsigned int siglen, RSA *rsa); 382ebfedea0SLionel Sambuc 383*0a6a1f1dSLionel Sambuc /* 384*0a6a1f1dSLionel Sambuc * The following 2 function sign and verify a ASN1_OCTET_STRING object inside 385*0a6a1f1dSLionel Sambuc * PKCS#1 padded RSA encryption 386*0a6a1f1dSLionel Sambuc */ 387ebfedea0SLionel Sambuc int RSA_sign_ASN1_OCTET_STRING(int type, 388ebfedea0SLionel Sambuc const unsigned char *m, unsigned int m_length, 389*0a6a1f1dSLionel Sambuc unsigned char *sigret, unsigned int *siglen, 390*0a6a1f1dSLionel Sambuc RSA *rsa); 391*0a6a1f1dSLionel Sambuc int RSA_verify_ASN1_OCTET_STRING(int type, const unsigned char *m, 392*0a6a1f1dSLionel Sambuc unsigned int m_length, unsigned char *sigbuf, 393*0a6a1f1dSLionel Sambuc unsigned int siglen, RSA *rsa); 394ebfedea0SLionel Sambuc 395ebfedea0SLionel Sambuc int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); 396ebfedea0SLionel Sambuc void RSA_blinding_off(RSA *rsa); 397ebfedea0SLionel Sambuc BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx); 398ebfedea0SLionel Sambuc 399ebfedea0SLionel Sambuc int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen, 400ebfedea0SLionel Sambuc const unsigned char *f, int fl); 401ebfedea0SLionel Sambuc int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen, 402*0a6a1f1dSLionel Sambuc const unsigned char *f, int fl, 403*0a6a1f1dSLionel Sambuc int rsa_len); 404ebfedea0SLionel Sambuc int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen, 405ebfedea0SLionel Sambuc const unsigned char *f, int fl); 406ebfedea0SLionel Sambuc int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, 407*0a6a1f1dSLionel Sambuc const unsigned char *f, int fl, 408*0a6a1f1dSLionel Sambuc int rsa_len); 409*0a6a1f1dSLionel Sambuc int PKCS1_MGF1(unsigned char *mask, long len, const unsigned char *seed, 410*0a6a1f1dSLionel Sambuc long seedlen, const EVP_MD *dgst); 411ebfedea0SLionel Sambuc int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, 412ebfedea0SLionel Sambuc const unsigned char *f, int fl, 413ebfedea0SLionel Sambuc const unsigned char *p, int pl); 414ebfedea0SLionel Sambuc int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, 415ebfedea0SLionel Sambuc const unsigned char *f, int fl, int rsa_len, 416ebfedea0SLionel Sambuc const unsigned char *p, int pl); 417ebfedea0SLionel Sambuc int RSA_padding_add_SSLv23(unsigned char *to, int tlen, 418ebfedea0SLionel Sambuc const unsigned char *f, int fl); 419ebfedea0SLionel Sambuc int RSA_padding_check_SSLv23(unsigned char *to, int tlen, 420ebfedea0SLionel Sambuc const unsigned char *f, int fl, int rsa_len); 421*0a6a1f1dSLionel Sambuc int RSA_padding_add_none(unsigned char *to, int tlen, const unsigned char *f, 422*0a6a1f1dSLionel Sambuc int fl); 423ebfedea0SLionel Sambuc int RSA_padding_check_none(unsigned char *to, int tlen, 424ebfedea0SLionel Sambuc const unsigned char *f, int fl, int rsa_len); 425*0a6a1f1dSLionel Sambuc int RSA_padding_add_X931(unsigned char *to, int tlen, const unsigned char *f, 426*0a6a1f1dSLionel Sambuc int fl); 427ebfedea0SLionel Sambuc int RSA_padding_check_X931(unsigned char *to, int tlen, 428ebfedea0SLionel Sambuc const unsigned char *f, int fl, int rsa_len); 429ebfedea0SLionel Sambuc int RSA_X931_hash_id(int nid); 430ebfedea0SLionel Sambuc 431ebfedea0SLionel Sambuc int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash, 432*0a6a1f1dSLionel Sambuc const EVP_MD *Hash, const unsigned char *EM, 433*0a6a1f1dSLionel Sambuc int sLen); 434ebfedea0SLionel Sambuc int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM, 435*0a6a1f1dSLionel Sambuc const unsigned char *mHash, const EVP_MD *Hash, 436*0a6a1f1dSLionel Sambuc int sLen); 437ebfedea0SLionel Sambuc 438ebfedea0SLionel Sambuc int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash, 439ebfedea0SLionel Sambuc const EVP_MD *Hash, const EVP_MD *mgf1Hash, 440ebfedea0SLionel Sambuc const unsigned char *EM, int sLen); 441ebfedea0SLionel Sambuc 442ebfedea0SLionel Sambuc int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM, 443ebfedea0SLionel Sambuc const unsigned char *mHash, 444*0a6a1f1dSLionel Sambuc const EVP_MD *Hash, const EVP_MD *mgf1Hash, 445*0a6a1f1dSLionel Sambuc int sLen); 446ebfedea0SLionel Sambuc 447ebfedea0SLionel Sambuc int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 448ebfedea0SLionel Sambuc CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); 449ebfedea0SLionel Sambuc int RSA_set_ex_data(RSA *r, int idx, void *arg); 450ebfedea0SLionel Sambuc void *RSA_get_ex_data(const RSA *r, int idx); 451ebfedea0SLionel Sambuc 452ebfedea0SLionel Sambuc RSA *RSAPublicKey_dup(RSA *rsa); 453ebfedea0SLionel Sambuc RSA *RSAPrivateKey_dup(RSA *rsa); 454ebfedea0SLionel Sambuc 455*0a6a1f1dSLionel Sambuc /* 456*0a6a1f1dSLionel Sambuc * If this flag is set the RSA method is FIPS compliant and can be used in 457*0a6a1f1dSLionel Sambuc * FIPS mode. This is set in the validated module method. If an application 458*0a6a1f1dSLionel Sambuc * sets this flag in its own methods it is its responsibility to ensure the 459*0a6a1f1dSLionel Sambuc * result is compliant. 460ebfedea0SLionel Sambuc */ 461ebfedea0SLionel Sambuc 462ebfedea0SLionel Sambuc # define RSA_FLAG_FIPS_METHOD 0x0400 463ebfedea0SLionel Sambuc 464*0a6a1f1dSLionel Sambuc /* 465*0a6a1f1dSLionel Sambuc * If this flag is set the operations normally disabled in FIPS mode are 466ebfedea0SLionel Sambuc * permitted it is then the applications responsibility to ensure that the 467ebfedea0SLionel Sambuc * usage is compliant. 468ebfedea0SLionel Sambuc */ 469ebfedea0SLionel Sambuc 470ebfedea0SLionel Sambuc # define RSA_FLAG_NON_FIPS_ALLOW 0x0400 471*0a6a1f1dSLionel Sambuc /* 472*0a6a1f1dSLionel Sambuc * Application has decided PRNG is good enough to generate a key: don't 473ebfedea0SLionel Sambuc * check. 474ebfedea0SLionel Sambuc */ 475ebfedea0SLionel Sambuc # define RSA_FLAG_CHECKED 0x0800 476ebfedea0SLionel Sambuc 477ebfedea0SLionel Sambuc /* BEGIN ERROR CODES */ 478*0a6a1f1dSLionel Sambuc /* 479*0a6a1f1dSLionel Sambuc * The following lines are auto generated by the script mkerr.pl. Any changes 480ebfedea0SLionel Sambuc * made after this point may be overwritten when the script is next run. 481ebfedea0SLionel Sambuc */ 482ebfedea0SLionel Sambuc void ERR_load_RSA_strings(void); 483ebfedea0SLionel Sambuc 484ebfedea0SLionel Sambuc /* Error codes for the RSA functions. */ 485ebfedea0SLionel Sambuc 486ebfedea0SLionel Sambuc /* Function codes. */ 487ebfedea0SLionel Sambuc # define RSA_F_CHECK_PADDING_MD 140 488ebfedea0SLionel Sambuc # define RSA_F_DO_RSA_PRINT 146 489ebfedea0SLionel Sambuc # define RSA_F_INT_RSA_VERIFY 145 490ebfedea0SLionel Sambuc # define RSA_F_MEMORY_LOCK 100 491ebfedea0SLionel Sambuc # define RSA_F_OLD_RSA_PRIV_DECODE 147 492ebfedea0SLionel Sambuc # define RSA_F_PKEY_RSA_CTRL 143 493ebfedea0SLionel Sambuc # define RSA_F_PKEY_RSA_CTRL_STR 144 494ebfedea0SLionel Sambuc # define RSA_F_PKEY_RSA_SIGN 142 495ebfedea0SLionel Sambuc # define RSA_F_PKEY_RSA_VERIFY 154 496ebfedea0SLionel Sambuc # define RSA_F_PKEY_RSA_VERIFYRECOVER 141 497ebfedea0SLionel Sambuc # define RSA_F_RSA_BUILTIN_KEYGEN 129 498ebfedea0SLionel Sambuc # define RSA_F_RSA_CHECK_KEY 123 499ebfedea0SLionel Sambuc # define RSA_F_RSA_EAY_PRIVATE_DECRYPT 101 500ebfedea0SLionel Sambuc # define RSA_F_RSA_EAY_PRIVATE_ENCRYPT 102 501ebfedea0SLionel Sambuc # define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103 502ebfedea0SLionel Sambuc # define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104 503ebfedea0SLionel Sambuc # define RSA_F_RSA_GENERATE_KEY 105 504ebfedea0SLionel Sambuc # define RSA_F_RSA_GENERATE_KEY_EX 155 505ebfedea0SLionel Sambuc # define RSA_F_RSA_ITEM_VERIFY 156 506ebfedea0SLionel Sambuc # define RSA_F_RSA_MEMORY_LOCK 130 507ebfedea0SLionel Sambuc # define RSA_F_RSA_NEW_METHOD 106 508ebfedea0SLionel Sambuc # define RSA_F_RSA_NULL 124 509ebfedea0SLionel Sambuc # define RSA_F_RSA_NULL_MOD_EXP 131 510ebfedea0SLionel Sambuc # define RSA_F_RSA_NULL_PRIVATE_DECRYPT 132 511ebfedea0SLionel Sambuc # define RSA_F_RSA_NULL_PRIVATE_ENCRYPT 133 512ebfedea0SLionel Sambuc # define RSA_F_RSA_NULL_PUBLIC_DECRYPT 134 513ebfedea0SLionel Sambuc # define RSA_F_RSA_NULL_PUBLIC_ENCRYPT 135 514ebfedea0SLionel Sambuc # define RSA_F_RSA_PADDING_ADD_NONE 107 515ebfedea0SLionel Sambuc # define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121 516ebfedea0SLionel Sambuc # define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125 517ebfedea0SLionel Sambuc # define RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 148 518ebfedea0SLionel Sambuc # define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108 519ebfedea0SLionel Sambuc # define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109 520ebfedea0SLionel Sambuc # define RSA_F_RSA_PADDING_ADD_SSLV23 110 521ebfedea0SLionel Sambuc # define RSA_F_RSA_PADDING_ADD_X931 127 522ebfedea0SLionel Sambuc # define RSA_F_RSA_PADDING_CHECK_NONE 111 523ebfedea0SLionel Sambuc # define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 122 524ebfedea0SLionel Sambuc # define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 112 525ebfedea0SLionel Sambuc # define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 113 526ebfedea0SLionel Sambuc # define RSA_F_RSA_PADDING_CHECK_SSLV23 114 527ebfedea0SLionel Sambuc # define RSA_F_RSA_PADDING_CHECK_X931 128 528ebfedea0SLionel Sambuc # define RSA_F_RSA_PRINT 115 529ebfedea0SLionel Sambuc # define RSA_F_RSA_PRINT_FP 116 530ebfedea0SLionel Sambuc # define RSA_F_RSA_PRIVATE_DECRYPT 150 531ebfedea0SLionel Sambuc # define RSA_F_RSA_PRIVATE_ENCRYPT 151 532ebfedea0SLionel Sambuc # define RSA_F_RSA_PRIV_DECODE 137 533ebfedea0SLionel Sambuc # define RSA_F_RSA_PRIV_ENCODE 138 534ebfedea0SLionel Sambuc # define RSA_F_RSA_PUBLIC_DECRYPT 152 535ebfedea0SLionel Sambuc # define RSA_F_RSA_PUBLIC_ENCRYPT 153 536ebfedea0SLionel Sambuc # define RSA_F_RSA_PUB_DECODE 139 537ebfedea0SLionel Sambuc # define RSA_F_RSA_SETUP_BLINDING 136 538ebfedea0SLionel Sambuc # define RSA_F_RSA_SIGN 117 539ebfedea0SLionel Sambuc # define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118 540ebfedea0SLionel Sambuc # define RSA_F_RSA_VERIFY 119 541ebfedea0SLionel Sambuc # define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120 542ebfedea0SLionel Sambuc # define RSA_F_RSA_VERIFY_PKCS1_PSS 126 543ebfedea0SLionel Sambuc # define RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 149 544ebfedea0SLionel Sambuc 545ebfedea0SLionel Sambuc /* Reason codes. */ 546ebfedea0SLionel Sambuc # define RSA_R_ALGORITHM_MISMATCH 100 547ebfedea0SLionel Sambuc # define RSA_R_BAD_E_VALUE 101 548ebfedea0SLionel Sambuc # define RSA_R_BAD_FIXED_HEADER_DECRYPT 102 549ebfedea0SLionel Sambuc # define RSA_R_BAD_PAD_BYTE_COUNT 103 550ebfedea0SLionel Sambuc # define RSA_R_BAD_SIGNATURE 104 551ebfedea0SLionel Sambuc # define RSA_R_BLOCK_TYPE_IS_NOT_01 106 552ebfedea0SLionel Sambuc # define RSA_R_BLOCK_TYPE_IS_NOT_02 107 553ebfedea0SLionel Sambuc # define RSA_R_DATA_GREATER_THAN_MOD_LEN 108 554ebfedea0SLionel Sambuc # define RSA_R_DATA_TOO_LARGE 109 555ebfedea0SLionel Sambuc # define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110 556ebfedea0SLionel Sambuc # define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132 557ebfedea0SLionel Sambuc # define RSA_R_DATA_TOO_SMALL 111 558ebfedea0SLionel Sambuc # define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122 559ebfedea0SLionel Sambuc # define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112 560ebfedea0SLionel Sambuc # define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124 561ebfedea0SLionel Sambuc # define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125 562ebfedea0SLionel Sambuc # define RSA_R_D_E_NOT_CONGRUENT_TO_1 123 563ebfedea0SLionel Sambuc # define RSA_R_FIRST_OCTET_INVALID 133 564ebfedea0SLionel Sambuc # define RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 144 565ebfedea0SLionel Sambuc # define RSA_R_INVALID_DIGEST_LENGTH 143 566ebfedea0SLionel Sambuc # define RSA_R_INVALID_HEADER 137 567ebfedea0SLionel Sambuc # define RSA_R_INVALID_KEYBITS 145 568ebfedea0SLionel Sambuc # define RSA_R_INVALID_MESSAGE_LENGTH 131 569ebfedea0SLionel Sambuc # define RSA_R_INVALID_MGF1_MD 156 570ebfedea0SLionel Sambuc # define RSA_R_INVALID_PADDING 138 571ebfedea0SLionel Sambuc # define RSA_R_INVALID_PADDING_MODE 141 572ebfedea0SLionel Sambuc # define RSA_R_INVALID_PSS_PARAMETERS 149 573ebfedea0SLionel Sambuc # define RSA_R_INVALID_PSS_SALTLEN 146 574ebfedea0SLionel Sambuc # define RSA_R_INVALID_SALT_LENGTH 150 575ebfedea0SLionel Sambuc # define RSA_R_INVALID_TRAILER 139 576ebfedea0SLionel Sambuc # define RSA_R_INVALID_X931_DIGEST 142 577ebfedea0SLionel Sambuc # define RSA_R_IQMP_NOT_INVERSE_OF_Q 126 578ebfedea0SLionel Sambuc # define RSA_R_KEY_SIZE_TOO_SMALL 120 579ebfedea0SLionel Sambuc # define RSA_R_LAST_OCTET_INVALID 134 580ebfedea0SLionel Sambuc # define RSA_R_MODULUS_TOO_LARGE 105 581ebfedea0SLionel Sambuc # define RSA_R_NON_FIPS_RSA_METHOD 157 582ebfedea0SLionel Sambuc # define RSA_R_NO_PUBLIC_EXPONENT 140 583ebfedea0SLionel Sambuc # define RSA_R_NULL_BEFORE_BLOCK_MISSING 113 584ebfedea0SLionel Sambuc # define RSA_R_N_DOES_NOT_EQUAL_P_Q 127 585ebfedea0SLionel Sambuc # define RSA_R_OAEP_DECODING_ERROR 121 586ebfedea0SLionel Sambuc # define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 158 587ebfedea0SLionel Sambuc # define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148 588ebfedea0SLionel Sambuc # define RSA_R_PADDING_CHECK_FAILED 114 589*0a6a1f1dSLionel Sambuc # define RSA_R_PKCS_DECODING_ERROR 159 590ebfedea0SLionel Sambuc # define RSA_R_P_NOT_PRIME 128 591ebfedea0SLionel Sambuc # define RSA_R_Q_NOT_PRIME 129 592ebfedea0SLionel Sambuc # define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130 593ebfedea0SLionel Sambuc # define RSA_R_SLEN_CHECK_FAILED 136 594ebfedea0SLionel Sambuc # define RSA_R_SLEN_RECOVERY_FAILED 135 595ebfedea0SLionel Sambuc # define RSA_R_SSLV3_ROLLBACK_ATTACK 115 596ebfedea0SLionel Sambuc # define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116 597ebfedea0SLionel Sambuc # define RSA_R_UNKNOWN_ALGORITHM_TYPE 117 598ebfedea0SLionel Sambuc # define RSA_R_UNKNOWN_MASK_DIGEST 151 599ebfedea0SLionel Sambuc # define RSA_R_UNKNOWN_PADDING_TYPE 118 600ebfedea0SLionel Sambuc # define RSA_R_UNKNOWN_PSS_DIGEST 152 601ebfedea0SLionel Sambuc # define RSA_R_UNSUPPORTED_MASK_ALGORITHM 153 602ebfedea0SLionel Sambuc # define RSA_R_UNSUPPORTED_MASK_PARAMETER 154 603ebfedea0SLionel Sambuc # define RSA_R_UNSUPPORTED_SIGNATURE_TYPE 155 604ebfedea0SLionel Sambuc # define RSA_R_VALUE_MISSING 147 605ebfedea0SLionel Sambuc # define RSA_R_WRONG_SIGNATURE_LENGTH 119 606ebfedea0SLionel Sambuc 607ebfedea0SLionel Sambuc #ifdef __cplusplus 608ebfedea0SLionel Sambuc } 609ebfedea0SLionel Sambuc #endif 610ebfedea0SLionel Sambuc #endif 611