X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fbf%2Fbf_skey.c;h=3673cdee6e26172c78a3de35da48eb62b4e26dee;hp=18ea37f7cc160da400b413eb26f8947769efd2bc;hb=87954638a691b3188ae4bd07f2612b534055da78;hpb=d02b48c63a58ea4367a0e905979f140b7d090f86;ds=sidebyside diff --git a/crypto/bf/bf_skey.c b/crypto/bf/bf_skey.c index 18ea37f7cc..3673cdee6e 100644 --- a/crypto/bf/bf_skey.c +++ b/crypto/bf/bf_skey.c @@ -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 @@ -58,21 +58,18 @@ #include #include -#include "blowfish.h" +#include #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]; }