summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/cast/c_skey.c
diff options
context:
space:
mode:
authorbeck <>1999-09-29 04:37:45 +0000
committerbeck <>1999-09-29 04:37:45 +0000
commitde8f24ea083384bb66b32ec105dc4743c5663cdf (patch)
tree1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/cast/c_skey.c
parentcb929d29896bcb87c2a97417fbd03e50078fc178 (diff)
downloadopenbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/cast/c_skey.c')
-rw-r--r--src/lib/libcrypto/cast/c_skey.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/libcrypto/cast/c_skey.c b/src/lib/libcrypto/cast/c_skey.c
index 2fc3363dcd..acf2c3eeb5 100644
--- a/src/lib/libcrypto/cast/c_skey.c
+++ b/src/lib/libcrypto/cast/c_skey.c
@@ -56,7 +56,7 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include "cast.h" 59#include <openssl/cast.h>
60#include "cast_lcl.h" 60#include "cast_lcl.h"
61#include "cast_s.h" 61#include "cast_s.h"
62 62
@@ -72,10 +72,7 @@
72#define S6 CAST_S_table6 72#define S6 CAST_S_table6
73#define S7 CAST_S_table7 73#define S7 CAST_S_table7
74 74
75void CAST_set_key(key,len,data) 75void CAST_set_key(CAST_KEY *key, int len, unsigned char *data)
76CAST_KEY *key;
77int len;
78unsigned char *data;
79 { 76 {
80 CAST_LONG x[16]; 77 CAST_LONG x[16];
81 CAST_LONG z[16]; 78 CAST_LONG z[16];
@@ -88,6 +85,10 @@ unsigned char *data;
88 if (len > 16) len=16; 85 if (len > 16) len=16;
89 for (i=0; i<len; i++) 86 for (i=0; i<len; i++)
90 x[i]=data[i]; 87 x[i]=data[i];
88 if(len <= 10)
89 key->short_key=1;
90 else
91 key->short_key=0;
91 92
92 K= &k[0]; 93 K= &k[0];
93 X[0]=((x[ 0]<<24)|(x[ 1]<<16)|(x[ 2]<<8)|x[ 3])&0xffffffffL; 94 X[0]=((x[ 0]<<24)|(x[ 1]<<16)|(x[ 2]<<8)|x[ 3])&0xffffffffL;