chiark
/
gitweb
/
~mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7b6d64f
)
Export the code to transform DH or EC table entries into usable group specs.
author
mdw
<mdw>
Sat, 5 Mar 2005 16:42:06 +0000
(16:42 +0000)
committer
mdw
<mdw>
Sat, 5 Mar 2005 16:42:06 +0000
(16:42 +0000)
ec-info.c
patch
|
blob
|
blame
|
history
diff --git
a/ec-info.c
b/ec-info.c
index bf9607c82e3ace965bf2deef233dd578adfa027b..925ff07dcbbaab6b8f3b1c33eb22e78fa8c6895b 100644
(file)
--- a/
ec-info.c
+++ b/
ec-info.c
@@
-164,7
+164,7
@@
fail:
return (0);
}
return (0);
}
-/* --- @
getinfo
@ --- *
+/* --- @
ec_infofromdata
@ --- *
*
* Arguments: @ec_info *ei@ = where to write the information
* @ecdata *ed@ = raw data
*
* Arguments: @ec_info *ei@ = where to write the information
* @ecdata *ed@ = raw data
@@
-175,7
+175,7
@@
fail:
* curves.
*/
* curves.
*/
-
static void getinfo
(ec_info *ei, ecdata *ed)
+
void ec_infofromdata
(ec_info *ei, ecdata *ed)
{
field *f;
{
field *f;
@@
-234,8
+234,12
@@
int ec_infoparse(qd_parse *qd, ec_info *ei)
const ecentry *ee;
mp *r = MP_NEW, *h = MP_NEW;
const ecentry *ee;
mp *r = MP_NEW, *h = MP_NEW;
- for (ee = ectab; ee->name; ee++)
- if (qd_enum(qd, ee->name) >= 0) { getinfo(ei, ee->data); goto found; }
+ for (ee = ectab; ee->name; ee++) {
+ if (qd_enum(qd, ee->name) >= 0) {
+ ec_infofromdata(ei, ee->data);
+ goto found;
+ }
+ }
if ((c = ec_curveparse(qd)) == 0) goto fail;
qd_delim(qd, '/'); if (!ec_ptparse(qd, &g)) goto fail;
if ((c = ec_curveparse(qd)) == 0) goto fail;
qd_delim(qd, '/'); if (!ec_ptparse(qd, &g)) goto fail;
@@
-559,23
+563,21
@@
int main(int argc, char *argv[])
}
}
} else {
}
}
} else {
- fputs("checking standard curves...\n", stdout);
+ fputs("checking standard curves:", stdout);
+ fflush(stdout);
for (ee = ectab; ee->name; ee++) {
ec_info ei;
for (ee = ectab; ee->name; ee++) {
ec_info ei;
- printf(" %s: ", ee->name);
- fflush(stdout);
- getinfo(&ei, ee->data);
+ ec_infofromdata(&ei, ee->data);
e = ec_checkinfo(&ei, gr);
ec_freeinfo(&ei);
if (e) {
e = ec_checkinfo(&ei, gr);
ec_freeinfo(&ei);
if (e) {
- printf("
fails: %s\n"
, e);
+ printf("
[%s fails: %s]", ee->name
, e);
ok = 0;
} else
ok = 0;
} else
-
fputs("ok\n", stdout
);
+
printf(" %s", ee->name
);
fflush(stdout);
}
fflush(stdout);
}
- if (ok)
- fputs("all ok\n", stdout);
+ fputs(ok ? " ok\n" : " failed\n", stdout);
}
gr->ops->destroy(gr);
return (!ok);
}
gr->ops->destroy(gr);
return (!ok);