rsaz-x86_64.pl: add MULX/ADCX/ADOX code path.
[openssl.git] / crypto / bf / bf_skey.c
index 18ea37f7cc160da400b413eb26f8947769efd2bc..3673cdee6e26172c78a3de35da48eb62b4e26dee 100644 (file)
@@ -1,5 +1,5 @@
 /* crypto/bf/bf_skey.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  * This package is an SSL implementation written
 
 #include <stdio.h>
 #include <string.h>
-#include "blowfish.h"
+#include <openssl/blowfish.h>
 #include "bf_locl.h"
 #include "bf_pi.h"
 
-void BF_set_key(key,len,data)
-BF_KEY *key;
-int len;
-unsigned char *data;
+void BF_set_key(BF_KEY *key, int len, const unsigned char *data)
        {
        int i;
        BF_LONG *p,ri,in[2];
-       unsigned char *d,*end;
+       const unsigned char *d,*end;
 
 
-       memcpy((char *)key,(char *)&bf_init,sizeof(BF_KEY));
+       memcpy(key,&bf_init,sizeof(BF_KEY));
        p=key->P;
 
        if (len > ((BF_ROUNDS+2)*4)) len=(BF_ROUNDS+2)*4;
@@ -103,7 +100,7 @@ unsigned char *data;
        in[1]=0L;
        for (i=0; i<(BF_ROUNDS+2); i+=2)
                {
-               BF_encrypt(in,key,BF_ENCRYPT);
+               BF_encrypt(in,key);
                p[i  ]=in[0];
                p[i+1]=in[1];
                }
@@ -111,7 +108,7 @@ unsigned char *data;
        p=key->S;
        for (i=0; i<4*256; i+=2)
                {
-               BF_encrypt(in,key,BF_ENCRYPT);
+               BF_encrypt(in,key);
                p[i  ]=in[0];
                p[i+1]=in[1];
                }