/* 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));
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];
}
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];
}