summaryrefslogtreecommitdiffstats
path: root/src/configure.in
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2013-05-04 21:52:21 -0400
committerGreg Hudson <ghudson@mit.edu>2013-05-24 14:20:36 -0400
commit898c0f677d573a7882bb02459082501939fac435 (patch)
tree48c6e08758708dba29c99fd8cc51f9a6339df8c1 /src/configure.in
parent0231309631acb59cc8b22227ca461005f38cc668 (diff)
downloadkrb5-898c0f677d573a7882bb02459082501939fac435.tar.gz
krb5-898c0f677d573a7882bb02459082501939fac435.tar.xz
krb5-898c0f677d573a7882bb02459082501939fac435.zip
Add AES-NI support on Linux
If yasm and cpuid.h are present on a Linux i686 or x64 system, compile the modified Intel AES-NI assembly sources. In the builtin AES enc provider, check at runtime whether the CPU supports AES-NI instructions and use the assembly functions if so.
Diffstat (limited to 'src/configure.in')
-rw-r--r--src/configure.in33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/configure.in b/src/configure.in
index 42a5fd5714..489b82ad7e 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -233,6 +233,39 @@ AC_SUBST(PKINIT_CRYPTO_IMPL)
AC_SUBST(PKINIT_CRYPTO_IMPL_CFLAGS)
AC_SUBST(PKINIT_CRYPTO_IMPL_LIBS)
+AC_ARG_ENABLE([aesni],
+AC_HELP_STRING([--disable-aesni],[Do not build with AES-NI support]), ,
+enable_aesni=check)
+if test "$CRYPTO_IMPL" = builtin -a "x$enable_aesni" != xno; then
+ case "$host" in
+ i686-*)
+ aesni_flags="-f elf32"
+ aesni_obj=iaesx86.o
+ ;;
+ x86_64-*)
+ # All Unix-like platforms need -D__linux__ for iaesx64.s to
+ # handle the System V x86-64 calling convention.
+ aesni_flags="-D__linux__ -f elf64"
+ aesni_obj=iaesx64.o
+ ;;
+ esac
+ if test "x$aesni_obj" != x; then
+ AC_CHECK_PROG(YASM,yasm,yasm)
+ AC_CHECK_HEADERS(cpuid.h)
+ if test x"$YASM" != x -a "x$ac_cv_header_cpuid_h" = xyes; then
+ AESNI_OBJ=$aesni_obj
+ AESNI_FLAGS=$aesni_flags
+ AC_DEFINE(AESNI,1,[Define if AES-NI support is enabled])
+ AC_MSG_NOTICE([Building with AES-NI support])
+ fi
+ fi
+ if test "x$enable_aesni" = xyes -a "x$AESNI_OBJ" = x; then
+ AC_MSG_ERROR([AES-NI support requested but cannot be built])
+ fi
+fi
+AC_SUBST(AESNI_OBJ)
+AC_SUBST(AESNI_FLAGS)
+
# --with-kdc-kdb-update makes the KDC update the database with last request
# information and failure information.