summaryrefslogtreecommitdiff
path: root/lib/libcrypto/rc2
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/rc2')
-rw-r--r--lib/libcrypto/rc2/rc2.h26
-rw-r--r--lib/libcrypto/rc2/rc2_cbc.c2
-rw-r--r--lib/libcrypto/rc2/rc2_ecb.c4
-rw-r--r--lib/libcrypto/rc2/rc2_skey.c2
-rw-r--r--lib/libcrypto/rc2/rc2cfb64.c5
-rw-r--r--lib/libcrypto/rc2/rc2ofb64.c5
6 files changed, 24 insertions, 20 deletions
diff --git a/lib/libcrypto/rc2/rc2.h b/lib/libcrypto/rc2/rc2.h
index 9571efb7559..076c0a067ce 100644
--- a/lib/libcrypto/rc2/rc2.h
+++ b/lib/libcrypto/rc2/rc2.h
@@ -59,10 +59,6 @@
#ifndef HEADER_RC2_H
#define HEADER_RC2_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifdef NO_RC2
#error RC2 is disabled.
#endif
@@ -74,23 +70,29 @@ extern "C" {
#define RC2_BLOCK 8
#define RC2_KEY_LENGTH 16
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct rc2_key_st
{
RC2_INT data[64];
} RC2_KEY;
-void RC2_set_key(RC2_KEY *key, int len, unsigned char *data,int bits);
-void RC2_ecb_encrypt(unsigned char *in,unsigned char *out,RC2_KEY *key,
- int enc);
+void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits);
+void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key,
+ int enc);
void RC2_encrypt(unsigned long *data,RC2_KEY *key);
void RC2_decrypt(unsigned long *data,RC2_KEY *key);
-void RC2_cbc_encrypt(unsigned char *in, unsigned char *out, long length,
+void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
RC2_KEY *ks, unsigned char *iv, int enc);
-void RC2_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
- RC2_KEY *schedule, unsigned char *ivec, int *num, int enc);
-void RC2_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
- RC2_KEY *schedule, unsigned char *ivec, int *num);
+void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, RC2_KEY *schedule, unsigned char *ivec,
+ int *num, int enc);
+void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, RC2_KEY *schedule, unsigned char *ivec,
+ int *num);
#ifdef __cplusplus
}
diff --git a/lib/libcrypto/rc2/rc2_cbc.c b/lib/libcrypto/rc2/rc2_cbc.c
index 1202184e85e..74f48d3d87b 100644
--- a/lib/libcrypto/rc2/rc2_cbc.c
+++ b/lib/libcrypto/rc2/rc2_cbc.c
@@ -59,7 +59,7 @@
#include <openssl/rc2.h>
#include "rc2_locl.h"
-void RC2_cbc_encrypt(unsigned char *in, unsigned char *out, long length,
+void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
RC2_KEY *ks, unsigned char *iv, int encrypt)
{
register unsigned long tin0,tin1;
diff --git a/lib/libcrypto/rc2/rc2_ecb.c b/lib/libcrypto/rc2/rc2_ecb.c
index 7d77b9186ca..d3e8c2718a3 100644
--- a/lib/libcrypto/rc2/rc2_ecb.c
+++ b/lib/libcrypto/rc2/rc2_ecb.c
@@ -70,8 +70,8 @@ const char *RC2_version="RC2" OPENSSL_VERSION_PTEXT;
* Date: 11 Feb 1996 06:45:03 GMT
*/
-void RC2_ecb_encrypt(unsigned char *in, unsigned char *out, RC2_KEY *ks,
- int encrypt)
+void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out, RC2_KEY *ks,
+ int encrypt)
{
unsigned long l,d[2];
diff --git a/lib/libcrypto/rc2/rc2_skey.c b/lib/libcrypto/rc2/rc2_skey.c
index 7143c4e591a..cab3080c73d 100644
--- a/lib/libcrypto/rc2/rc2_skey.c
+++ b/lib/libcrypto/rc2/rc2_skey.c
@@ -90,7 +90,7 @@ static unsigned char key_table[256]={
* BSAFE uses the 'retarded' version. What I previously shipped is
* the same as specifying 1024 for the 'bits' parameter. Bsafe uses
* a version where the bits parameter is the same as len*8 */
-void RC2_set_key(RC2_KEY *key, int len, unsigned char *data, int bits)
+void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits)
{
int i,j;
unsigned char *k;
diff --git a/lib/libcrypto/rc2/rc2cfb64.c b/lib/libcrypto/rc2/rc2cfb64.c
index 5e3fa07d907..b3a0158a6e6 100644
--- a/lib/libcrypto/rc2/rc2cfb64.c
+++ b/lib/libcrypto/rc2/rc2cfb64.c
@@ -64,8 +64,9 @@
* 64bit block we have used is contained in *num;
*/
-void RC2_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
- RC2_KEY *schedule, unsigned char *ivec, int *num, int encrypt)
+void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, RC2_KEY *schedule, unsigned char *ivec,
+ int *num, int encrypt)
{
register unsigned long v0,v1,t;
register int n= *num;
diff --git a/lib/libcrypto/rc2/rc2ofb64.c b/lib/libcrypto/rc2/rc2ofb64.c
index 42cdd40cdd9..9e297867ed5 100644
--- a/lib/libcrypto/rc2/rc2ofb64.c
+++ b/lib/libcrypto/rc2/rc2ofb64.c
@@ -63,8 +63,9 @@
* used. The extra state information to record how much of the
* 64bit block we have used is contained in *num;
*/
-void RC2_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
- RC2_KEY *schedule, unsigned char *ivec, int *num)
+void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, RC2_KEY *schedule, unsigned char *ivec,
+ int *num)
{
register unsigned long v0,v1,t;
register int n= *num;