A few more constifications of some RSA routines that I forgot
[openssl.git] / rsaref / rsaref.h
index 817c6cec751df07cb2fa898ea32c3ea415254a15..198685d8c40d5149ab58088de9fc334ce30b583b 100644 (file)
 #ifndef NO_RSA
 #include <openssl/rsa.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 /* RSAeuro */
 /*#define  RSAref_MAX_BITS             2048*/
 
@@ -114,21 +118,30 @@ typedef struct RSARandomState_st
 #define RE_SIGNATURE_ENCODING 0x040c
 #define RE_ENCRYPTION_ALGORITHM 0x040d
 
-int RSAPrivateDecrypt(unsigned char *to, int *outlen, unsigned char *from,
+int RSAPrivateDecrypt(unsigned char *to, int *outlen,
+       const unsigned char *from,
        int len, RSArefPrivateKey *RSAkey);
-int RSAPrivateEncrypt(unsigned char *to, int *outlen, unsigned char *from,
+int RSAPrivateEncrypt(unsigned char *to, int *outlen,
+       const unsigned char *from,
        int len, RSArefPrivateKey *RSAkey);
-int RSAPublicDecrypt(unsigned char *to, int *outlen, unsigned char *from,
+int RSAPublicDecrypt(unsigned char *to, int *outlen,
+       const unsigned char *from,
        int len, RSArefPublicKey *RSAkey);
-int RSAPublicEncrypt(unsigned char *to, int *outlen, unsigned char *from,
+int RSAPublicEncrypt(unsigned char *to, int *outlen,
+       const unsigned char *from,
        int len, RSArefPublicKey *RSAkey,RSARandomState *rnd);
 int R_RandomInit(RSARandomState *rnd);
 int R_GetRandomBytesNeeded(unsigned int *,RSARandomState *rnd);
-int R_RandomUpdate(RSARandomState *rnd, unsigned char *data, unsigned int n);
+int R_RandomUpdate(RSARandomState *rnd,
+       const unsigned char *data, unsigned int n);
 int R_RandomFinal(RSARandomState *rnd);
 
 void ERR_load_RSAREF_strings(void );
-RSA_METHOD *RSA_PKCS1_RSAref(void );
+const RSA_METHOD *RSA_PKCS1_RSAref(void );
+
+#ifdef  __cplusplus
+}
+#endif
 #endif
 
 /* BEGIN ERROR CODES */
@@ -169,8 +182,4 @@ RSA_METHOD *RSA_PKCS1_RSAref(void );
 #define RSAREF_R_SIGNATURE                              0x040b
 #define RSAREF_R_SIGNATURE_ENCODING                     0x040c
 
-#ifdef  __cplusplus
-}
 #endif
-#endif
-