Merge branch '2.5.x'
authorMark Wooding <mdw@distorted.org.uk>
Sat, 9 May 2020 19:55:40 +0000 (20:55 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 9 May 2020 19:55:40 +0000 (20:55 +0100)
* 2.5.x:
  Release 2.5.2.
  base/regdump.c: Be helpful about VFP/NEON registers before `regdump_init'.
  base/regdump.h (ARM32, ARM64): Properly parenthesize `_regfmt' arguments.
  base/regdump.c: Dump ARM VFP/NEON registers with the correct source tag.
  debian/catacomb2.symbols: Bump versions for fixed functions.
  Release 2.4.5.
  math/group-parse.c (group-parse): Parse binary-group descriptions.
  math/group-parse.c: Fix copyright notice.
  *.c: Check for ARM64 SIMD before using the accelerated code.
  base/dispatch.c: Recognize `CPUFEAT_ARM_NEON' as requesting ARM64 SIMD.
  symm/t/chacha: Missing test from RFC8439.
  math/t/{mpx,mpmont}: Add some extra tests for flushing out `mul4' bugs.
  math/mpx-mul4-*: Test the `...zc' variants too.
  math/Makefile.am, symm/Makefile.am: Use `--no-install' on oddball tests.
  progs/pixie.c: Don't crash when trying to set an empty passphrase.
  configure.ac, vars.am: Use host-specific link options for test programs.

20 files changed:
base/dispatch.c
base/regdump.c
base/regdump.h
configure.ac
debian/catacomb2.symbols
debian/changelog
math/Makefile.am
math/group-parse.c
math/mpx-mul4-amd64-sse2.S
math/mpx-mul4-test.c
math/mpx-mul4-x86-sse2.S
math/t/mpmont
math/t/mpx
math/t/mpx-mul4
progs/pixie.c
symm/Makefile.am
symm/chacha.c
symm/salsa20.c
symm/t/chacha
vars.am

index 65ea2d2..db9c319 100644 (file)
@@ -226,6 +226,7 @@ static unsigned hwcaps = 0;
 #  define WANTAUX(_)                                                   \
        WANT_AT_HWCAP(_)
 #  define CAPMAP(_)                                                    \
+       _(ARM_NEON, "arm:neon")                                         \
        _(ARM_AES, "arm:aes")                                           \
        _(ARM_PMULL, "arm:pmull")
 #endif
@@ -346,6 +347,7 @@ static void probe_hwcaps(void)
 #  endif
 #endif
 #if CPUFAM_ARM64
+  if (probed.hwcap & HWCAP_ASIMD) hw |= HF_ARM_NEON;
   if (probed.hwcap & HWCAP_AES) hw |= HF_ARM_AES;
   if (probed.hwcap & HWCAP_PMULL) hw |= HF_ARM_PMULL;
 #endif
index d4f5fde..c591fd5 100644 (file)
@@ -659,7 +659,7 @@ void regdump_fp(const struct regmap *map)
     regdump(map, 0,
            REGF_HEX | REGF_UNSGN | REGF_SGN | REGF_FLT | REGF_CHR |
            REGF_64 | REGF_32 | REGF_16 | REGF_8 |
-           REGSRC_SIMD | i | (6 << REGF_WDSHIFT));
+           REGSRC_FP | i | (6 << REGF_WDSHIFT));
 
   printf(";; Floating-point state:\n");
   dump_fpflags(0, map->fp->fpscr);
@@ -857,6 +857,13 @@ void regdump(const void *base, const char *lbl, uint32 f)
     case REGSRC_FP:
     case REGSRC_SIMD:
       map = (const struct regmap *)base;
+      if (!map->fp) {
+       printf(";;");
+       if (lbl) printf(" %s:", lbl);
+       if (reg) printf(" %s =", reg);
+       printf(" #<not available -- regdump_init?>\n");
+       return;
+      }
       if (ix == REGIX_FPSCR) {
        assert(!(f&REGF_FMTMASK));
        dump_fpflags(lbl, map->fp->fpscr);
index bbbd5bd..f5b3306 100644 (file)
@@ -643,8 +643,8 @@ DO16(REGDEF_NEONQ)
 .endm
 
 .macro _regfmt arg
-       movw    r2, #\arg&0xffff
-       movt    r2, #(\arg >> 16)&0xffff
+       movw    r2, #(\arg)&0xffff
+       movt    r2, #((\arg) >> 16)&0xffff
 .endm
 
 #endif
@@ -794,8 +794,8 @@ DO32(REGDEF_FP)
 .endm
 
 .macro _regfmt arg
-       movz    w2, #\arg&0xffff
-       movk    w2, #(\arg >> 16)&0xffff, lsl #16
+       movz    w2, #(\arg)&0xffff
+       movk    w2, #((\arg) >> 16)&0xffff, lsl #16
 .endm
 
 #endif
index b4f7389..e5bf8d8 100644 (file)
@@ -39,6 +39,13 @@ AC_PROG_CC
 AX_CFLAGS_WARN_ALL
 AM_PROG_LIBTOOL
 mdw_LIBTOOL_VERSION_INFO
+case $host_os in
+  cygwin* | mingw* | pw32* | os2* | darwin* | cegcc*)
+    TEST_LDFLAGS=-no-fast-install ;;
+  *)
+    TEST_LDFLAGS=-no-install ;;
+esac
+AC_SUBST([TEST_LDFLAGS])
 
 AM_PROG_AS
 
index 33d5915..b6ffba1 100644 (file)
@@ -32,7 +32,7 @@ libcatacomb.so.2 catacomb2 #MINVER#
        (optional)regdump@Base 2.5.0
        (optional)regdump_freshline@Base 2.5.0
        (optional)regdump_gp@Base 2.5.0
-       (optional)regdump_fp@Base 2.5.0
+       (optional)regdump_fp@Base 2.5.2
        (optional)regdump_simd@Base 2.5.0
        (optional)regdump_gprstr@Base 2.5.0
        (optional)regdump_gpsave@Base 2.5.0
@@ -422,8 +422,8 @@ libcatacomb.so.2 catacomb2 #MINVER#
        strongprime@Base 2.3.1
 
 ## limlee
-       limlee_step@Base 2.5.1+
-       limlee@Base 2.5.1+
+       limlee_step@Base 2.5.2
+       limlee@Base 2.5.2
 
 ## gfx
        gfx_acc@Base 2.0.0
@@ -466,7 +466,7 @@ libcatacomb.so.2 catacomb2 #MINVER#
 
 ## group
        group_fromstring@Base 2.1.1
-       group_parse@Base 2.1.1
+       group_parse@Base 2.5.2
        group_check@Base 2.1.1
        group_samep@Base 2.1.1
        group_stdcheck@Base 2.1.1
@@ -513,10 +513,10 @@ libcatacomb.so.2 catacomb2 #MINVER#
        ec_dbl@Base 2.2.0
        ec_neg@Base 2.2.0
        ec_sub@Base 2.2.0
-       ec_imul@Base 2.5.1+
-       ec_mul@Base 2.5.1+
-       ec_immul@Base 2.5.1+
-       ec_mmul@Base 2.5.1+
+       ec_imul@Base 2.5.2
+       ec_mul@Base 2.5.2
+       ec_immul@Base 2.5.2
+       ec_mmul@Base 2.5.2
        ec_check@Base 2.2.0
        ec_destroycurve@Base 2.2.0
        ec_idfix@Base 2.2.0
@@ -638,22 +638,22 @@ libcatacomb.so.2 catacomb2 #MINVER#
 
 ## lcrand
        lcrand@Base 2.0.0
-       lcrand_create@Base 2.5.1+
+       lcrand_create@Base 2.5.2
        lcrand_range@Base 2.0.0
 
 ## rand
        rand_init@Base 2.2.3
        rand_noisesrc@Base 2.2.3
        rand_seed@Base 2.2.3
-       rand_quick@Base 2.2.3
+       rand_quick@Base 2.5.2
        (optional|arch=i386 amd64)rand_quick_x86ish_rdrand@Base 2.5.0
-       rand_key@Base 2.5.1+
+       rand_key@Base 2.5.2
        rand_add@Base 2.2.3
        rand_goodbits@Base 2.2.3
        rand_get@Base 2.2.3
        rand_getgood@Base 2.2.3
-       rand_gate@Base 2.2.3
-       rand_stretch@Base 2.2.3
+       rand_gate@Base 2.5.2
+       rand_stretch@Base 2.5.2
        rand_generation@Base 2.2.3
        rand_create@Base 2.2.3
        rand_global@Base 2.2.3
@@ -4222,8 +4222,8 @@ libcatacomb.so.2 catacomb2 #MINVER#
 
 ## dh
        dh_gen@Base 2.1.1
-       dh_kcdsagen@Base 2.5.1+
-       dh_limlee@Base 2.5.1+
+       dh_kcdsagen@Base 2.5.2
+       dh_limlee@Base 2.5.2
        dh_checkparam@Base 2.1.1
        dh_parse@Base 2.1.1
        dhbin_parse@Base 2.1.1
@@ -4354,9 +4354,9 @@ libcatacomb.so.2 catacomb2 #MINVER#
        key_structsteal@Base 2.1.1
        key_mksubkeyiter@Base 2.1.1
        key_nextsubkey@Base 2.1.1
-       key_copydata@Base 2.5.1+
+       key_copydata@Base 2.5.2
        key_incref@Base 2.1.1
-       key_split@Base 2.5.1+
+       key_split@Base 2.5.2
        key_drop@Base 2.1.1
        key_destroy@Base 2.1.1
        key_do@Base 2.1.1
@@ -4405,7 +4405,7 @@ libcatacomb.so.2 catacomb2 #MINVER#
        key_strerror@Base 2.1.1
 
 ## key-io
-       key_new@Base 2.1.1
+       key_new@Base 2.5.2
        key_open@Base 2.3.1
        key_close@Base 2.1.1
        key_discard@Base 2.1.1
@@ -4414,7 +4414,7 @@ libcatacomb.so.2 catacomb2 #MINVER#
 
 ## key-misc
        key_byid@Base 2.1.1
-       key_bytag@Base 2.5.1+
+       key_bytag@Base 2.5.2
        key_bytype@Base 2.1.1
        key_qtag@Base 2.1.1
        key_expired@Base 2.1.1
index db77dc1..3d5f005 100644 (file)
@@ -4,6 +4,13 @@ catacomb (2.5.99~) experimental; urgency=medium
 
  -- Mark Wooding <mdw@distorted.org.uk>  Mon, 30 Sep 2019 02:15:20 +0100
 
+catacomb (2.5.2) experimental; urgency=medium
+
+  * Merge changes from 2.4.5.
+  * catacomb-dev: Fix ARM32 FP/SIMD register dumping.
+
+ -- Mark Wooding <mdw@distorted.org.uk>  Sat, 09 May 2020 20:50:57 +0100
+
 catacomb (2.5.1) experimental; urgency=medium
 
   * Merge changes from 2.4.4.
@@ -29,6 +36,45 @@ catacomb (2.5.0) experimental; urgency=medium
 
  -- Mark Wooding <mdw@distorted.org.uk>  Sat, 21 Sep 2019 21:26:44 +0100
 
+catacomb (2.4.5) experimental; urgency=medium
+
+  * catacomb: Fix memory leak in key-file error handling.
+  * catacomb: Don't leak internal `exptime' symbol into the global
+    namespace.
+  * catacomb: Check that the X86 `rdrand' instruction actually works
+    before leaning on it.  This is in response to the well-publicized AMD
+    bug which always returns all-bits-set with the carry /set/ (indicating
+    success).
+  * catacomb: Mix in the random pool key during `rand_gate' and
+    `rand_stretch' operations.
+  * catacomb: Fix by-tag key lookups: if the query string looks like a hex
+    number, it's treated as a search by id; but if no such id is found,
+    the search wouldn't continue to look for a key by type or tag.
+  * catacomb: Fix reference leak in `key_split'.
+  * catacomb: Fix bug which completely broke `key_copydata'.
+  * catacomb: Fix segfault from `pgen', if it fails before setting up the
+    prime tester.
+  * catacomb: Propagate failure from `pgen' during Lim--Lee prime
+    generation, rather than immediately retrying.
+  * catacomb: Fix memory leak of factor vector from failed Lim--Lee prime
+    generation.
+  * catacomb: Fix segfault when multiplying the identity elliptic-curve
+    point.
+  * catacomb: Fix the `lcrand' descriptor, so that it's not advertised as
+    being cryptographically strong, and to fix a bias in its output.
+  * catacomb: Fix a memory leak in the error case of KCDSA prime
+    generation.
+  * catacomb-bin: Fix segfault from `pixie', if given an empty passphrase
+    to remember.
+  * catacomb: Check SIMD feature bit on ARM64 before using the optimized
+    code.  I don't know of any ARM64 implementations which lack SIMD
+    instructions, but the bit must be there for a reason, so I might as
+    well use it.
+  * catacomb: Support parsing binary-group descriptions.  This is a long-
+    standing lacuna that I've only recently noticed.
+
+ -- Mark Wooding <mdw@distorted.org.uk>  Sat, 09 May 2020 17:46:24 +0100
+
 catacomb (2.4.4) experimental; urgency=medium
 
   * debian: Bump to Debhelper 10.
index dd48057..7c4ffed 100644 (file)
@@ -197,6 +197,7 @@ mpx_mul4_t_SOURCES   = mpx-mul4-test.c $(MPX_MUL4_SOURCES)
 mpx_mul4_t_CPPFLAGS     = \
        $(AM_CPPFLAGS) \
        -DTEST_MUL4 -DSRCDIR="\"$(srcdir)\""
+mpx_mul4_t_LDFLAGS      = $(TEST_LDFLAGS)
 mpx_mul4_t_LDADD        = $(top_builddir)/libcatacomb.la $(mLib_LIBS)
 EXTRA_DIST             += t/mpx-mul4
 
@@ -429,6 +430,7 @@ check_PROGRAMS              += f25519-p10.t
 f25519_p10_t_SOURCES    = f25519.c
 f25519_p10_t_CPPFLAGS   = $(AM_CPPFLAGS) -DTEST_RIG -DSRCDIR="\"$(srcdir)\""
 f25519_p10_t_CPPFLAGS  += -DF25519_IMPL=10
+f25519_p10_t_LDFLAGS    = $(TEST_LDFLAGS)
 f25519_p10_t_LDADD      = $(TEST_LIBS) $(top_builddir)/libcatacomb.la
 f25519_p10_t_LDADD     += $(mLib_LIBS) $(CATACOMB_LIBS) $(LIBS)
 
@@ -442,6 +444,7 @@ check_PROGRAMS              += fgoldi-p12.t
 fgoldi_p12_t_SOURCES    = fgoldi.c
 fgoldi_p12_t_CPPFLAGS   = $(AM_CPPFLAGS) -DTEST_RIG -DSRCDIR="\"$(srcdir)\""
 fgoldi_p12_t_CPPFLAGS  += -DFGOLDI_IMPL=12
+fgoldi_p12_t_LDFLAGS    = $(TEST_LDFLAGS)
 fgoldi_p12_t_LDADD      = $(TEST_LIBS) $(top_builddir)/libcatacomb.la
 fgoldi_p12_t_LDADD     += $(mLib_LIBS) $(CATACOMB_LIBS) $(LIBS)
 
index b46898d..61371f0 100644 (file)
@@ -7,21 +7,22 @@
 
 /*----- Licensing notice --------------------------------------------------*
  *
- * This file is part of Trivial IP Encryption (TrIPE).
+ * This file is part of Catacomb.
  *
- * TrIPE is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Catacomb is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
  *
- * TrIPE is distributed in the hope that it will be useful,
+ * Catacomb is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * GNU Library General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with TrIPE; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Library General Public
+ * License along with Catacomb; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
  */
 
 /*----- Header files ------------------------------------------------------*/
@@ -47,7 +48,7 @@ group *group_parse(qd_parse *qd)
 {
   group *g = 0;
 
-  switch (qd_enum(qd, "prime,ec")) {
+  switch (qd_enum(qd, "prime,bin,ec")) {
     case 0: {
       dh_param dp;
       qd_delim(qd, '{');
@@ -57,6 +58,14 @@ group *group_parse(qd_parse *qd)
       dh_paramfree(&dp);
     } break;
     case 1: {
+      gbin_param dp;
+      qd_delim(qd, '{');
+      if (dhbin_parse(qd, &dp)) goto ouch;
+      qd_delim(qd, '}');
+      g = group_binary(&dp);
+      dh_paramfree(&dp);
+    } break;
+    case 2: {
       ec_info ei;
       qd_delim(qd, '{');
       if (ec_infoparse(qd, &ei)) goto ouch;
index 03e466c..d313765 100644 (file)
@@ -1548,6 +1548,16 @@ FUNC(test_mul4)
        testepilogue
 ENDFUNC
 
+FUNC(test_mul4zc)
+       testprologue smul
+       testldcarry
+       testtop nil
+       call    mul4zc
+       testtail
+       testcarryout
+       testepilogue
+ENDFUNC
+
 FUNC(test_mla4)
        testprologue smul
        testldcarry
@@ -1558,6 +1568,16 @@ FUNC(test_mla4)
        testepilogue
 ENDFUNC
 
+FUNC(test_mla4zc)
+       testprologue smul
+       testldcarry
+       testtop nil
+       call    mla4zc
+       testtail
+       testcarryout
+       testepilogue
+ENDFUNC
+
 FUNC(test_mmul4)
        testprologue mmul
        testtop r11
index 5d5b4d5..414974b 100644 (file)
@@ -80,7 +80,9 @@ typedef struct { mpd w[6]; } carry;
   _(dmul4, NIL,  CARRY, P128, P128, P128, P128, P128, NIL,  CARRY)     \
   _(dmla4, P128, CARRY, P128, P128, P128, P128, P128, NIL,  CARRY)     \
   _(mul4,  NIL,         CARRY, NIL,  P128, NIL,  P128, P128, NIL,  CARRY)      \
+  _(mul4zc,NIL,         NIL,   NIL,  P128, NIL,  P128, P128, NIL,  CARRY)      \
   _(mla4,  P128, CARRY, NIL,  P128, NIL,  P128, P128, NIL,  CARRY)     \
+  _(mla4zc,P128, NIL,  NIL,  P128, NIL,  P128, P128, NIL,  CARRY)      \
   _(mmul4, NIL,         NIL,   P128, P128, P128, P128, P128, X128, CARRY)      \
   _(mmla4, P128, NIL,  P128, P128, P128, P128, P128, X128, CARRY)      \
   _(mont4, P128, NIL,  NIL,  P128, NIL,  P128, P128, X128, CARRY)
index 9d664b4..904c0d0 100644 (file)
@@ -1212,6 +1212,18 @@ FUNC(test_mul4)
        testepilogue
 ENDFUNC
 
+FUNC(test_mul4zc)
+       testprologue [ebp + 36]
+       testldcarry [ebp + 24]
+       testexpand nil, [ebp + 32]
+       mov     edi, [ebp + 20]
+       testtop nil, [ebp + 28]
+       call    mul4zc
+       testtail [ebp + 40]
+       testcarryout [ebp + 24]
+       testepilogue
+ENDFUNC
+
 FUNC(test_mla4)
        testprologue [ebp + 36]
        testldcarry [ebp + 24]
@@ -1224,6 +1236,18 @@ FUNC(test_mla4)
        testepilogue
 ENDFUNC
 
+FUNC(test_mla4zc)
+       testprologue [ebp + 36]
+       testldcarry [ebp + 24]
+       testexpand nil, [ebp + 32]
+       mov     edi, [ebp + 20]
+       testtop nil, [ebp + 28]
+       call    mla4zc
+       testtail [ebp + 40]
+       testcarryout [ebp + 24]
+       testepilogue
+ENDFUNC
+
 FUNC(test_mmul4)
        testprologue [ebp + 48]
        testexpand [ebp + 40], [ebp + 44]
index d653963..eef6a23 100644 (file)
@@ -30,6 +30,11 @@ mul {
   4309747041023999857206910900081
   4309747041023999857206910900081;
 
+  170141183460469231731687303715884105727
+  2
+  2
+  4;
+
   6277101735386680763835789423207666416083908700390324961279
   2455155546008943817740293915197451784769108058161191238065
   340282366920938463500268095579187314689
@@ -50,6 +55,11 @@ exp {
   8745435676786567758678547
   2439674515119108242643169132064;
 
+  170141183460469231731687303715884105727
+  2
+  170141183460469231731687303715884105727
+  2;
+
   # --- Bizarre bug ---
   #
   # This was caused by omission of the test-and-subtract step in the
index f5caed2..39a58cc 100644 (file)
@@ -637,6 +637,12 @@ umul {
   6c03f5958677efd383509141bf257375
   03bbd76f19ba19e3f255c24063f6384d4ac913d9e582392589a525195bcc547c;
 
+  # --- Slightly larger test for mul4 ---
+
+  b9d339d524b35abfa21cb0c129ca1800c2286025af766b8b3296495bf1013104
+  c8c7133a4bc7978ef439dc5607715d7f0f23d3d6d6bc704535bef33bb1dff7f0
+  91bd86557783557ba3fa69cfff6453f930b4db501c21317c8bd10c76c321ee2736b6a565c36bd42e2a6ea27495d182f0c4730b604a1e5c01c82a56938de4cfc0;
+
   # --- Karatsuba regression ---
   #
   # This bug was caused by kmul (a) choosing the split point too low on
index 1373215..69ea238 100644 (file)
@@ -29,6 +29,13 @@ mul4 {
     0002b2f3db03f8310002b880e3fffed70001d457394991000001d812a4ace8a80000ee0b505470500000efed0e0e2428; ## cc
 }
 
+mul4zc {
+  e3e2e1e0e7e6e5e4ebeae9e8efeeedec # x
+    f3f2f1f0f7f6f5f4fbfaf9f8fffefdfc # y
+    6117a200e13e737feee2b25cca449ed7 # zz
+    0002b2f3db03f8300002b880e3fffed70001d457394991000001d812a4ace8a80000ee0b505470500000efed0e0e2428; # cc
+}
+
 mla4 {
   b3b2b1b0b7b6b5b4bbbab9b8bfbebdbc # a
     0000a5a4a3a2a1a000009594939291900000abaaa9a8a7a600009b9a999897960000afaeadacabaa00009f9e9d9c9b9a # c
@@ -38,6 +45,14 @@ mla4 {
     0002b2f3db03f8320002b880e3fffed70001d457394991000001d812a4ace8a80000ee0b505470500000efed0e0e2428; ## cc
 }
 
+mla4zc {
+  b3b2b1b0b7b6b5b4bbbab9b8bfbebdbc # a
+    e3e2e1e0e7e6e5e4ebeae9e8efeeedec # x
+    f3f2f1f0f7f6f5f4fbfaf9f8fffefdfc # y
+    14ca53b098f52934aa9d6c158a035c94 # zz
+    0002b2f3db03f8310002b880e3fffed70001d457394991000001d812a4ace8a80000ee0b505470500000efed0e0e2428; # cc
+}
+
 mmul4 {
   c3c2c1c0c7c6c5c4cbcac9c8cfcecdcc # u
     acadaeafa8a9aaaba4a5a6a7a0a1a2a3 # n
index 7694d74..3fd3208 100644 (file)
@@ -775,7 +775,7 @@ OK\n\
          goto close;
       } else {
        p_flush(tag);
-       p_add(tag, s, t);
+       p_add(tag, s ? s : "", t);
        if (pixserv_write(px, "OK\n")) goto close;
       }
     }
index 2a43f07..68d9267 100644 (file)
@@ -593,6 +593,7 @@ check_PROGRAMS              += poly1305-p11.t
 poly1305_p11_t_SOURCES  = poly1305.c
 poly1305_p11_t_CPPFLAGS         = $(AM_CPPFLAGS) -DTEST_RIG -DSRCDIR="\"$(srcdir)\""
 poly1305_p11_t_CPPFLAGS        += -DPOLY1305_IMPL=11
+poly1305_p11_t_LDFLAGS  = $(TEST_LDFLAGS)
 poly1305_p11_t_LDADD    = $(TEST_LIBS) $(top_builddir)/libcatacomb.la
 poly1305_p11_t_LDADD   += $(mLib_LIBS) $(CATACOMB_LIBS) $(LIBS)
 
index 983f58c..90a4c67 100644 (file)
@@ -97,7 +97,8 @@ static core__functype *pick_core(void)
                     cpu_feature_p(CPUFEAT_ARM_NEON));
 #endif
 #if CPUFAM_ARM64
-  DISPATCH_PICK_COND(chacha_core, chacha_core_arm64, 1);
+  DISPATCH_PICK_COND(chacha_core, chacha_core_arm64,
+                    cpu_feature_p(CPUFEAT_ARM_NEON));
 #endif
   DISPATCH_PICK_FALLBACK(chacha_core, simple_core);
 }
index 0303d8b..e7c35f4 100644 (file)
@@ -97,7 +97,8 @@ static core__functype *pick_core(void)
                     cpu_feature_p(CPUFEAT_ARM_NEON));
 #endif
 #if CPUFAM_ARM64
-  DISPATCH_PICK_COND(salsa20_core, salsa20_core_arm64, 1);
+  DISPATCH_PICK_COND(salsa20_core, salsa20_core_arm64,
+                    cpu_feature_p(CPUFEAT_ARM_NEON));
 #endif
   DISPATCH_PICK_FALLBACK(salsa20_core, simple_core);
 }
index f7b19a6..c771554 100644 (file)
@@ -194,6 +194,9 @@ chacha20 {
   c46ec1b18ce8a878725a37e780dfb735
   1ada31d5cf688221 "" 0 ""
   826abdd84460e2e9349f0ef4af5b179b426e4b2d109a9c5bb44000ae51bea90a496beeef62a76850ff3f0402c4ddc99f6db07f151c1c0dfac2e56565d62896255b23132e7b469c7bfb88fa95d44ca5ae3e45e848a4108e98bad7a9eb15512784a6a9e6e591dce674120acaf9040ff50ff3ac30ccfb5e14204f5e4268b90a8804;
+  c46ec1b18ce8a878725a37e780dfb7351f68ed2e194c79fbc6aebee1a667975d
+  1ada31d5cf688221 "" 0 ""
+  f63a89b75c2271f9368816542ba52f06ed49241792302b00b5e8f80ae9a473afc25b218f519af0fdd406362e8d69de7f54c604a6e00f353f110f771bdca8ab92e5fbc34e60a1d9a9db17345b0a402736853bf910b060bdf1f897b6290f01d138ae2c4c90225ba9ea14d518f55929dea098ca7a6ccfe61227053c84e49a4a3332;
 
   ## Tests from RFC7539.
   000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
diff --git a/vars.am b/vars.am
index 115cb31..223f2ba 100644 (file)
--- a/vars.am
+++ b/vars.am
@@ -120,13 +120,13 @@ SUFFIXES          += .c .t$(EXEEXT) .to
 .c.to:
        $(AM_V_CC)$(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $< -o $@
 .to.t$(EXEEXT):
-       $(AM_V_CCLD)$(LINK) -no-install $< \
+       $(AM_V_CCLD)$(LINK) $(TEST_LDFLAGS) $< \
                $(TEST_LIBS) $(top_builddir)/libcatacomb.la \
                $(mLib_LIBS) $(CATACOMB_LIBS) $(LIBS)
 %.to: %.c %.lo
        $(AM_V_CC)$(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $< -o $@
 %.t$(EXEEXT): %.to $(TEST_LIBS) $(top_builddir)/libcatacomb.la
-       $(AM_V_CCLD)$(LINK) -no-install $+ \
+       $(AM_V_CCLD)$(LINK) $(TEST_LDFLAGS) $+ \
                $(mLib_LIBS) $(CATACOMB_LIBS) $(LIBS)
 
 .PRECIOUS: %.to %.t$(EXEEXT)