# define WANTAUX(_) \
WANT_AT_HWCAP(_)
# define CAPMAP(_) \
+ _(ARM_NEON, "arm:neon") \
_(ARM_AES, "arm:aes") \
_(ARM_PMULL, "arm:pmull")
#endif
# 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
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);
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®F_FMTMASK));
dump_fpflags(lbl, map->fp->fpscr);
.endm
.macro _regfmt arg
- movw r2, #\arg&0xffff
- movt r2, #(\arg >> 16)&0xffff
+ movw r2, #(\arg)&0xffff
+ movt r2, #((\arg) >> 16)&0xffff
.endm
#endif
.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
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
(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
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
## 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
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
## 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
## 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
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
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
## 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
-- 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.
-- 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.
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
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)
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)
/*----- 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 ------------------------------------------------------*/
{
group *g = 0;
- switch (qd_enum(qd, "prime,ec")) {
+ switch (qd_enum(qd, "prime,bin,ec")) {
case 0: {
dh_param dp;
qd_delim(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;
testepilogue
ENDFUNC
+FUNC(test_mul4zc)
+ testprologue smul
+ testldcarry
+ testtop nil
+ call mul4zc
+ testtail
+ testcarryout
+ testepilogue
+ENDFUNC
+
FUNC(test_mla4)
testprologue smul
testldcarry
testepilogue
ENDFUNC
+FUNC(test_mla4zc)
+ testprologue smul
+ testldcarry
+ testtop nil
+ call mla4zc
+ testtail
+ testcarryout
+ testepilogue
+ENDFUNC
+
FUNC(test_mmul4)
testprologue mmul
testtop r11
_(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)
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]
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]
4309747041023999857206910900081
4309747041023999857206910900081;
+ 170141183460469231731687303715884105727
+ 2
+ 2
+ 4;
+
6277101735386680763835789423207666416083908700390324961279
2455155546008943817740293915197451784769108058161191238065
340282366920938463500268095579187314689
8745435676786567758678547
2439674515119108242643169132064;
+ 170141183460469231731687303715884105727
+ 2
+ 170141183460469231731687303715884105727
+ 2;
+
# --- Bizarre bug ---
#
# This was caused by omission of the test-and-subtract step in the
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
0002b2f3db03f8310002b880e3fffed70001d457394991000001d812a4ace8a80000ee0b505470500000efed0e0e2428; ## cc
}
+mul4zc {
+ e3e2e1e0e7e6e5e4ebeae9e8efeeedec # x
+ f3f2f1f0f7f6f5f4fbfaf9f8fffefdfc # y
+ 6117a200e13e737feee2b25cca449ed7 # zz
+ 0002b2f3db03f8300002b880e3fffed70001d457394991000001d812a4ace8a80000ee0b505470500000efed0e0e2428; # cc
+}
+
mla4 {
b3b2b1b0b7b6b5b4bbbab9b8bfbebdbc # a
0000a5a4a3a2a1a000009594939291900000abaaa9a8a7a600009b9a999897960000afaeadacabaa00009f9e9d9c9b9a # c
0002b2f3db03f8320002b880e3fffed70001d457394991000001d812a4ace8a80000ee0b505470500000efed0e0e2428; ## cc
}
+mla4zc {
+ b3b2b1b0b7b6b5b4bbbab9b8bfbebdbc # a
+ e3e2e1e0e7e6e5e4ebeae9e8efeeedec # x
+ f3f2f1f0f7f6f5f4fbfaf9f8fffefdfc # y
+ 14ca53b098f52934aa9d6c158a035c94 # zz
+ 0002b2f3db03f8310002b880e3fffed70001d457394991000001d812a4ace8a80000ee0b505470500000efed0e0e2428; # cc
+}
+
mmul4 {
c3c2c1c0c7c6c5c4cbcac9c8cfcecdcc # u
acadaeafa8a9aaaba4a5a6a7a0a1a2a3 # 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;
}
}
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)
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);
}
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);
}
c46ec1b18ce8a878725a37e780dfb735
1ada31d5cf688221 "" 0 ""
826abdd84460e2e9349f0ef4af5b179b426e4b2d109a9c5bb44000ae51bea90a496beeef62a76850ff3f0402c4ddc99f6db07f151c1c0dfac2e56565d62896255b23132e7b469c7bfb88fa95d44ca5ae3e45e848a4108e98bad7a9eb15512784a6a9e6e591dce674120acaf9040ff50ff3ac30ccfb5e14204f5e4268b90a8804;
+ c46ec1b18ce8a878725a37e780dfb7351f68ed2e194c79fbc6aebee1a667975d
+ 1ada31d5cf688221 "" 0 ""
+ f63a89b75c2271f9368816542ba52f06ed49241792302b00b5e8f80ae9a473afc25b218f519af0fdd406362e8d69de7f54c604a6e00f353f110f771bdca8ab92e5fbc34e60a1d9a9db17345b0a402736853bf910b060bdf1f897b6290f01d138ae2c4c90225ba9ea14d518f55929dea098ca7a6ccfe61227053c84e49a4a3332;
## Tests from RFC7539.
000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
.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)