summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2005-05-10 14:03:23 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2005-05-10 14:03:23 +0000
commit6c1de6190dafcbf5e2bd8aaaf026963dfa1293c1 (patch)
treea1869cad3048a4dc706a86592dd19b91de2e47d3
parent57778661c190bdd7d05345a6a571d01b39df3e4c (diff)
import i386 AES asm code from openssl.org; ok and help with testing djm@
-rw-r--r--lib/libssl/crypto/Makefile9
-rw-r--r--lib/libssl/src/crypto/perlasm/x86unix.pl10
2 files changed, 16 insertions, 3 deletions
diff --git a/lib/libssl/crypto/Makefile b/lib/libssl/crypto/Makefile
index c349e5cd86a..26577285ccd 100644
--- a/lib/libssl/crypto/Makefile
+++ b/lib/libssl/crypto/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.42 2005/04/29 07:54:15 djm Exp $
+# $OpenBSD: Makefile,v 1.43 2005/05/10 14:03:22 markus Exp $
LIB= crypto
@@ -39,7 +39,7 @@ SRCS+= sha_dgst.c sha1dgst.c sha_one.c sha1_one.c
SRCS+= hmac.c
SRCS+= rmd_dgst.c rmd_one.c
SRCS+= acss_skey.c acss_enc.c
-SRCS+= aes_cbc.c aes_cfb.c aes_ctr.c aes_ecb.c aes_ofb.c aes_misc.c aes_core.c
+SRCS+= aes_cbc.c aes_cfb.c aes_ctr.c aes_ecb.c aes_ofb.c aes_misc.c
SRCS+= cbc_cksm.c cbc_enc.c cfb64enc.c cfb_enc.c \
ecb3_enc.c ecb_enc.c enc_read.c enc_writ.c \
ofb64enc.c ofb_enc.c pcbc_enc.c \
@@ -275,12 +275,14 @@ des_enc.po:
.endif
.if (${MACHINE_ARCH} == "i386")
+CFLAGS+= -DAES_ASM
CFLAGS+= -DMD5_ASM
CFLAGS+= -DSHA1_ASM
CFLAGS+= -DRMD160_ASM
CFLAGS+= -DOPENBSD_CAST_ASM
CFLAGS+= -DOPENBSD_DES_ASM
SSLASM=\
+ aes aes-586 \
bf bf-586 \
bn bn-586 \
bn co-586 \
@@ -300,15 +302,18 @@ ${f}.S: ${LCRYPTO_SRC}/${dir}/asm/${f}.pl ${LCRYPTO_SRC}/perlasm/x86unix.pl
SRCS+= bf_cbc.c
.else
.if (${MACHINE_ARCH} == "vax")
+SRCS+= aes_core.c
SRCS+= bf_enc.c
SRCS+= bn_asm_vax.S
SRCS+= rc4_enc.c
.else
.if (${MACHINE_ARCH} == "amd64")
+SRCS+= aes_core.c
SRCS+= bf_enc.c
SRCS+= x86_64-gcc.c
SRCS+= rc4_enc.c
.else
+SRCS+= aes_core.c
SRCS+= bf_enc.c
SRCS+= bn_asm.c
SRCS+= rc4_enc.c
diff --git a/lib/libssl/src/crypto/perlasm/x86unix.pl b/lib/libssl/src/crypto/perlasm/x86unix.pl
index 9717d185579..b61425e9519 100644
--- a/lib/libssl/src/crypto/perlasm/x86unix.pl
+++ b/lib/libssl/src/crypto/perlasm/x86unix.pl
@@ -179,7 +179,9 @@ sub main'not { &out1("notl",@_); }
sub main'call { &out1("call",($_[0]=~/^\.L/?'':$under).$_[0]); }
sub main'ret { &out0("ret"); }
sub main'nop { &out0("nop"); }
+sub main'test { &out2("testl",@_); }
sub main'movz { &out2("movzbl",@_); }
+sub main'neg { &out1("negl",@_); }
# The bswapl instruction is new for the 486. Emulate if i386.
sub main'bswap
@@ -462,6 +464,12 @@ sub main'comment
}
}
+sub main'public_label
+ {
+ $label{$_[0]}="${under}${_[0]}" if (!defined($label{$_[0]}));
+ push(@out,".globl\t$label{$_[0]}\n");
+ }
+
sub main'label
{
if (!defined($label{$_[0]}))
@@ -498,7 +506,7 @@ sub main'file_end
sub main'data_word
{
- push(@out,"\t.long $_[0]\n");
+ push(@out,"\t.long\t".join(',',@_)."\n");
}
# debug output functions: puts, putx, printf