Deprecate the recursive includes of bn.h from various API headers (asn1.h,
[openssl.git] / crypto / rsa / rsa.h
index 12689fc22dd5b2fac339cabaf72f9fe27809119e..00a7873f921afb72fcd704f75ce725acd9c3816e 100644 (file)
 #ifndef OPENSSL_NO_BIO
 #include <openssl/bio.h>
 #endif
-#include <openssl/bn.h>
 #include <openssl/crypto.h>
 #include <openssl/ossl_typ.h>
+#ifndef OPENSSL_NO_DEPRECATED
+#include <openssl/bn.h>
+#endif
 
 #ifdef OPENSSL_NO_RSA
 #error RSA is disabled.
 extern "C" {
 #endif
 
-typedef struct rsa_st RSA;
+/* Declared already in ossl_typ.h */
+/* typedef struct rsa_st RSA; */
+/* typedef struct rsa_meth_st RSA_METHOD; */
 
-typedef struct rsa_meth_st
+struct rsa_meth_st
        {
        const char *name;
        int (*rsa_pub_enc)(int flen,const unsigned char *from,
@@ -93,7 +97,7 @@ typedef struct rsa_meth_st
        int (*rsa_priv_dec)(int flen,const unsigned char *from,
                            unsigned char *to,
                            RSA *rsa,int padding);
-       int (*rsa_mod_exp)(BIGNUM *r0,const BIGNUM *I,RSA *rsa); /* Can be null */
+       int (*rsa_mod_exp)(BIGNUM *r0,const BIGNUM *I,RSA *rsa,BN_CTX *ctx); /* Can be null */
        int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
                          const BIGNUM *m, BN_CTX *ctx,
                          BN_MONT_CTX *m_ctx); /* Can be null */
@@ -118,8 +122,8 @@ typedef struct rsa_meth_st
  * is for behavioural compatibility whilst the code gets rewired, but one day
  * it would be nice to assume there are no such things as "builtin software"
  * implementations. */
-       int (*rsa_keygen)(RSA *rsa, int bits, unsigned long e, BN_GENCB *cb);
-       } RSA_METHOD;
+       int (*rsa_keygen)(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
+       };
 
 struct rsa_st
        {
@@ -201,7 +205,7 @@ RSA *       RSA_generate_key(int bits, unsigned long e,void
 #endif /* !defined(OPENSSL_NO_DEPRECATED) */
 
 /* New version */
-int    RSA_generate_key_ex(RSA *rsa, int bits, unsigned long e, BN_GENCB *cb);
+int    RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
 
 int    RSA_check_key(const RSA *);
        /* next 4 return -1 on error */