#ifdef SILC_DIST_TOOLKIT
include_HEADERS = \
- aes.h \
- blowfish.h \
- cast.h \
- ciphers_def.h \
- ciphers.h \
- md5.h \
- none.h \
- rc5.h \
- rsa.h \
- sha1.h \
- sha1_internal.h \
- sha256.h \
- sha256_internal.h \
silccipher.h \
- silcdh.h \
silchash.h \
silchmac.h \
silcpkcs.h \
silcrng.h \
silcpkcs1.h \
- twofish.h \
silcpk.h
SILC_EXTRA_DIST = tests
#define d_4(t,n,b,e,f,g,h) ALIGN const XP_DIR t n[4][256] = { b(e), b(f), b(g), b(h) }
ALIGN const uint_32t t_dec(r,c)[RC_LENGTH] = rc_data(w0);
-#ifdef SILC_ASM_AES
+#ifdef SILC_AES_ASM
d_1(uint_8t, t_dec(i,box), isb_data, h0);
-#endif /* SILC_ASM_AES */
+#endif /* SILC_AES_ASM */
d_4(uint_32t, t_dec(f,n), sb_data, u0, u1, u2, u3);
d_4(uint_32t, t_dec(f,l), sb_data, w0, w1, w2, w3);
d_4(uint_32t, t_dec(i,n), isb_data, v0, v1, v2, v3);
}
}
-#ifndef SILC_ASM_AES
+#ifndef SILC_AES_ASM
/* C version of AES */
#define si(y,x,k,c) (s(y,c) = word_in(x, c) ^ (k)[c])
}
#endif
-#endif /* SILC_ASM_AES */
+#endif /* SILC_AES_ASM */
%define eltab_2(x) [t_fl+2048+4*x]
%define eltab_3(x) [t_fl+3072+4*x]
-%else
-
-%define etab_b(x) byte [t_fn+3072+4*x]
-
%endif
; ROUND FUNCTION. Build column[2] on ESI and column[3] on EDI that have the
mov %1,eltab_%3(%4)
%endmacro
-%else
-
- %macro lr_xor 4
- movzx %4,%2
- movzx %4,etab_b(%4)
- %if %3 != 0
- shl %4,8*%3
- %endif
- xor %1,%4
- %endmacro
-
- %macro lr_mov 4
- movzx %4,%2
- movzx %1,etab_b(%4)
- %if %3 != 0
- shl %1,8*%3
- %endif
- %endmacro
-
%endif
%macro enc_round 0
%define dltab_2(x) [t_il+2048+4*x]
%define dltab_3(x) [t_il+3072+4*x]
-%else
-
- extern t_ibox
-
-%define dtab_x(x) byte [t_ibox+x]
-
%endif
%macro irn_fun 2
mov %1,dltab_%3(%4)
%endmacro
-%else
-
- %macro li_xor 4
- movzx %4,%2
- movzx %4,dtab_x(%4)
- %if %3 != 0
- shl %4,8*%3
- %endif
- xor %1,%4
- %endmacro
-
- %macro li_mov 4
- movzx %4,%2
- movzx %1,dtab_x(%4)
- %if %3 != 0
- shl %1,8*%3
- %endif
- %endmacro
-
%endif
%macro dec_round 0
+#ifdef SILC_DIST_CRYPTO
#
# lib/silccrypt/configure.ad
#
# Author: Pekka Riikonen <priikone@silcnet.org>
#
-# Copyright (C) 2006 Pekka Riikonen
+# Copyright (C) 2006 - 2007 Pekka Riikonen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
aes_asm=false
case "$host_cpu" in
i?86)
- if test x$have_assembler = xtrue; then
+ # Don't enable ASM AES with shared libs as the code doesn't support PIC.
+ if test x$have_assembler = xtrue -a "$enable_shared" != "yes"; then
aes_asm=true
AC_DEFINE([SILC_AES_ASM], [], [SILC_AES_ASM])
fi
;;
x86_64)
- if test x$have_assembler = xtrue; then
+ if test x$have_assembler = xtrue -a "$enable_shared" != "yes"; then
aes_asm=true
AC_DEFINE([SILC_AES_ASM], [], [SILC_AES_ASM])
fi
aes_asm=false
;;
esac
-AM_CONDITIONAL(SILC_AES_ASM, test x$aes_asm = xtrue)
SILC_ADD_CC_FLAGS(SILC_CRYPTO, -fno-regmove)
if test x$summary_debug = xno; then
)
fi # compile_libs
+
+# AM_CONDITIONAL is so bad that it itself cannot be defined in conditional
+AM_CONDITIONAL(SILC_AES_ASM, test x$aes_asm = xtrue)
+
+#endif SILC_DIST_CRYPTO