summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rc4
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/rc4')
-rw-r--r--src/lib/libcrypto/rc4/Makefile44
-rw-r--r--src/lib/libcrypto/rc4/rc4test.c16
2 files changed, 25 insertions, 35 deletions
diff --git a/src/lib/libcrypto/rc4/Makefile b/src/lib/libcrypto/rc4/Makefile
index f0bd7678fc..264451a213 100644
--- a/src/lib/libcrypto/rc4/Makefile
+++ b/src/lib/libcrypto/rc4/Makefile
@@ -21,8 +21,8 @@ TEST=rc4test.c
21APPS= 21APPS=
22 22
23LIB=$(TOP)/libcrypto.a 23LIB=$(TOP)/libcrypto.a
24LIBSRC=rc4_skey.c rc4_enc.c rc4_fblk.c 24LIBSRC=rc4_skey.c rc4_enc.c
25LIBOBJ=$(RC4_ENC) rc4_fblk.o 25LIBOBJ=$(RC4_ENC)
26 26
27SRC= $(LIBSRC) 27SRC= $(LIBSRC)
28 28
@@ -37,26 +37,26 @@ top:
37all: lib 37all: lib
38 38
39lib: $(LIBOBJ) 39lib: $(LIBOBJ)
40 $(ARX) $(LIB) $(LIBOBJ) 40 $(AR) $(LIB) $(LIBOBJ)
41 $(RANLIB) $(LIB) || echo Never mind. 41 $(RANLIB) $(LIB) || echo Never mind.
42 @touch lib 42 @touch lib
43 43
44# ELF 44rc4-586.s: asm/rc4-586.pl ../perlasm/x86asm.pl
45rx86-elf.s: asm/rc4-586.pl ../perlasm/x86asm.pl 45 $(PERL) asm/rc4-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
46 (cd asm; $(PERL) rc4-586.pl elf $(CFLAGS) > ../$@)
47# COFF
48rx86-cof.s: asm/rc4-586.pl ../perlasm/x86asm.pl
49 (cd asm; $(PERL) rc4-586.pl coff $(CFLAGS) > ../$@)
50# a.out
51rx86-out.s: asm/rc4-586.pl ../perlasm/x86asm.pl
52 (cd asm; $(PERL) rc4-586.pl a.out $(CFLAGS) > ../$@)
53 46
54rc4-x86_64.s: asm/rc4-x86_64.pl; $(PERL) asm/rc4-x86_64.pl $@ 47rc4-x86_64.s: asm/rc4-x86_64.pl
48 $(PERL) asm/rc4-x86_64.pl $(PERLASM_SCHEME) > $@
55 49
56rc4-ia64.s: asm/rc4-ia64.S 50rc4-ia64.S: asm/rc4-ia64.pl
51 $(PERL) asm/rc4-ia64.pl $(CFLAGS) > $@
52
53rc4-s390x.s: asm/rc4-s390x.pl
54 $(PERL) asm/rc4-s390x.pl > $@
55
56rc4-ia64.s: rc4-ia64.S
57 @case `awk '/^#define RC4_INT/{print$$NF}' $(TOP)/include/openssl/opensslconf.h` in \ 57 @case `awk '/^#define RC4_INT/{print$$NF}' $(TOP)/include/openssl/opensslconf.h` in \
58 int) set -x; $(CC) $(CFLAGS) -DSZ=4 -E asm/rc4-ia64.S > $@ ;; \ 58 int) set -x; $(CC) $(CFLAGS) -DSZ=4 -E rc4-ia64.S > $@ ;; \
59 char) set -x; $(CC) $(CFLAGS) -DSZ=1 -E asm/rc4-ia64.S > $@ ;; \ 59 char) set -x; $(CC) $(CFLAGS) -DSZ=1 -E rc4-ia64.S > $@ ;; \
60 *) exit 1 ;; \ 60 *) exit 1 ;; \
61 esac 61 esac
62 62
@@ -105,20 +105,10 @@ rc4_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
105rc4_enc.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h 105rc4_enc.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h
106rc4_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 106rc4_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
107rc4_enc.o: ../cryptlib.h rc4_enc.c rc4_locl.h 107rc4_enc.o: ../cryptlib.h rc4_enc.c rc4_locl.h
108rc4_fblk.o: ../../e_os.h ../../include/openssl/bio.h
109rc4_fblk.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
110rc4_fblk.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
111rc4_fblk.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
112rc4_fblk.o: ../../include/openssl/opensslconf.h
113rc4_fblk.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
114rc4_fblk.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h
115rc4_fblk.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
116rc4_fblk.o: ../cryptlib.h rc4_fblk.c rc4_locl.h
117rc4_skey.o: ../../e_os.h ../../include/openssl/bio.h 108rc4_skey.o: ../../e_os.h ../../include/openssl/bio.h
118rc4_skey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 109rc4_skey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
119rc4_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 110rc4_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
120rc4_skey.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 111rc4_skey.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
121rc4_skey.o: ../../include/openssl/opensslconf.h
122rc4_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 112rc4_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
123rc4_skey.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h 113rc4_skey.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h
124rc4_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 114rc4_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
diff --git a/src/lib/libcrypto/rc4/rc4test.c b/src/lib/libcrypto/rc4/rc4test.c
index 54b597fa26..633a79e758 100644
--- a/src/lib/libcrypto/rc4/rc4test.c
+++ b/src/lib/libcrypto/rc4/rc4test.c
@@ -114,8 +114,8 @@ static unsigned char output[7][30]={
114 114
115int main(int argc, char *argv[]) 115int main(int argc, char *argv[])
116 { 116 {
117 int err=0; 117 int i,err=0;
118 unsigned int i, j; 118 int j;
119 unsigned char *p; 119 unsigned char *p;
120 RC4_KEY key; 120 RC4_KEY key;
121 unsigned char obuf[512]; 121 unsigned char obuf[512];
@@ -129,12 +129,12 @@ int main(int argc, char *argv[])
129 { 129 {
130 printf("error calculating RC4\n"); 130 printf("error calculating RC4\n");
131 printf("output:"); 131 printf("output:");
132 for (j=0; j<data_len[i]+1U; j++) 132 for (j=0; j<data_len[i]+1; j++)
133 printf(" %02x",obuf[j]); 133 printf(" %02x",obuf[j]);
134 printf("\n"); 134 printf("\n");
135 printf("expect:"); 135 printf("expect:");
136 p= &(output[i][0]); 136 p= &(output[i][0]);
137 for (j=0; j<data_len[i]+1U; j++) 137 for (j=0; j<data_len[i]+1; j++)
138 printf(" %02x",*(p++)); 138 printf(" %02x",*(p++));
139 printf("\n"); 139 printf("\n");
140 err++; 140 err++;
@@ -180,12 +180,12 @@ int main(int argc, char *argv[])
180 { 180 {
181 printf("error in RC4 multi-call processing\n"); 181 printf("error in RC4 multi-call processing\n");
182 printf("output:"); 182 printf("output:");
183 for (j=0; j<data_len[3]+1U; j++) 183 for (j=0; j<data_len[3]+1; j++)
184 printf(" %02x",obuf[j]); 184 printf(" %02x",obuf[j]);
185 printf("\n"); 185 printf("\n");
186 printf("expect:"); 186 printf("expect:");
187 p= &(output[3][0]); 187 p= &(output[3][0]);
188 for (j=0; j<data_len[3]+1U; j++) 188 for (j=0; j<data_len[3]+1; j++)
189 printf(" %02x",*(p++)); 189 printf(" %02x",*(p++));
190 err++; 190 err++;
191 } 191 }
@@ -216,11 +216,11 @@ int main(int argc, char *argv[])
216 if (memcmp(md,expected,sizeof(md))) { 216 if (memcmp(md,expected,sizeof(md))) {
217 printf("error in RC4 bulk test\n"); 217 printf("error in RC4 bulk test\n");
218 printf("output:"); 218 printf("output:");
219 for (j=0; j<sizeof(md); j++) 219 for (j=0; j<(int)sizeof(md); j++)
220 printf(" %02x",md[j]); 220 printf(" %02x",md[j]);
221 printf("\n"); 221 printf("\n");
222 printf("expect:"); 222 printf("expect:");
223 for (j=0; j<sizeof(md); j++) 223 for (j=0; j<(int)sizeof(md); j++)
224 printf(" %02x",expected[j]); 224 printf(" %02x",expected[j]);
225 printf("\n"); 225 printf("\n");
226 err++; 226 err++;