## -*-m4-*-
##
-## $Id: Makefile.m4,v 1.80 2004/04/08 01:36:15 mdw Exp $
+## $Id: Makefile.m4,v 1.81 2004/04/08 16:17:32 mdw Exp $
##
## Makefile for Catacomb
##
keycheck.c keycheck-mp.c keycheck-report.c \
bbs-rand.c bbs-gen.c bbs-jump.c bbs-fetch.c \
rsa-priv.c rsa-pub.c rsa-gen.c rsa-recover.c rsa-fetch.c \
+ oaep.c pkcs1.c pss.c \
dh-gen.c dh-limlee.c dh-check.c dh-fetch.c dh-param.c \
dsarand.c dsa-sign.c dsa-verify.c dsa-gen.c dsa-check.c \
gdsa.c gkcdsa.c \
lcrand.c fibrand.c rc4.c seal.c rand.c noise.c fipstest.c maurer.c \
arena.c \
passphrase.c pixie-client.c pixie-common.c lmem.c \
- oaep.c pkcs1.c pss.c tlsprf.c sslprf.c \
+ tlsprf.c sslprf.c \
gfshare.c \
MP_SOURCES karatsuba.h \
gciphertab.c ghashtab.c gmactab.c \
/* -*-c-*-
*
- * $Id: ec-info.c,v 1.5 2004/04/08 01:36:15 mdw Exp $
+ * $Id: ec-info.c,v 1.6 2004/04/08 16:17:32 mdw Exp $
*
* Elliptic curve information management
*
#include "fibrand.h"
-int main(void)
+int main(int argc, char *argv[])
{
const ecentry *ee;
const char *e;
int ok = 1;
+ int i;
grand *gr;
gr = fibrand_create(0);
- fputs("checking standard curves: ", stdout);
- for (ee = ectab; ee->name; ee++) {
- ec_info ei;
- getinfo(&ei, ee->data);
- e = ec_checkinfo(&ei, gr);
- ec_freeinfo(&ei);
- if (e) {
- fprintf(stderr, "\n*** curve %s fails: %s\n", ee->name, e);
- ok = 0;
+ if (argc > 1) {
+ for (i = 1; i < argc; i++) {
+ ec_info ei;
+ if ((e = ec_getinfo(&ei, argv[i])) != 0)
+ fprintf(stderr, "bad curve spec `%s': %s", argv[i], e);
+ else {
+ e = ec_checkinfo(&ei, gr);
+ ec_freeinfo(&ei);
+ if (!e)
+ printf("OK %s\n", argv[i]);
+ else {
+ printf("BAD %s: %s\n", argv[i], e);
+ ok = 0;
+ }
+ }
+ }
+ } else {
+ fputs("checking standard curves: ", stdout);
+ for (ee = ectab; ee->name; ee++) {
+ ec_info ei;
+ getinfo(&ei, ee->data);
+ e = ec_checkinfo(&ei, gr);
+ ec_freeinfo(&ei);
+ if (e) {
+ fprintf(stderr, "\n*** curve %s fails: %s\n", ee->name, e);
+ ok = 0;
+ }
+ putchar('.');
+ fflush(stdout);
}
- putchar('.');
- fflush(stdout);
+ fputs(ok ? " ok\n" : " failed\n", stdout);
}
gr->ops->destroy(gr);
- fputs(ok ? " ok\n" : " failed\n", stdout);
return (!ok);
}
/* -*-c-*-
*
- * $Id: ec-test.h,v 1.2 2004/04/08 01:36:15 mdw Exp $
+ * $Id: ec-test.h,v 1.3 2004/04/08 16:17:32 mdw Exp $
*
* Elliptic curve test functions
*
/*----- Test vector types -------------------------------------------------*/
-extern test_type type_ecurve, type_ec;
+extern const test_type type_ecurve, type_ec;
/*----- That's all, folks -------------------------------------------------*/
/* -*-c-*-
*
- * $Id: mp-mem.c,v 1.7 2004/04/08 01:36:15 mdw Exp $
+ * $Id: mp-mem.c,v 1.8 2004/04/08 16:17:32 mdw Exp $
*
* Memory management for multiprecision numbers
*
/* --- Otherwise check whether the destination is suitable --- */
if (m->ref > 1 || (m->f & MP_CONST) ||
- sz > m->sz || !((f & ~m->f) & MP_BURN)) {
+ sz > m->sz || ((f & ~m->f) & MP_BURN)) {
/* --- No -- allocate a new buffer --- *
*