X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/266efb73ab5210542c29cede4c7cf921ef62267e..643eb1bbf91769f4f929173dd8452a94c36f1685:/progs/perftest.c diff --git a/progs/perftest.c b/progs/perftest.c index 33774879..b2722a4e 100644 --- a/progs/perftest.c +++ b/progs/perftest.c @@ -63,6 +63,7 @@ #include "ec.h" #include "group.h" #include "x25519.h" +#include "x448.h" #include "ed25519.h" #include "cc.h" @@ -289,6 +290,24 @@ static void *x25519_jobinit(opts *o) static void x25519_jobrun(void *cc) { x25519_jobctx *c = cc; octet z[X25519_OUTSZ]; x25519(z, c->k, c->p); } +/* --- x448 --- */ + +typedef struct x448_jobctx { + octet k[X448_KEYSZ]; + octet p[X448_PUBSZ]; +} x448_jobctx; + +static void *x448_jobinit(opts *o) +{ + x448_jobctx *c = CREATE(x448_jobctx); + rand_get(RAND_GLOBAL, c->k, sizeof(c->k)); + rand_get(RAND_GLOBAL, c->p, sizeof(c->p)); + return (c); +} + +static void x448_jobrun(void *cc) + { x448_jobctx *c = cc; octet z[X448_OUTSZ]; x448(z, c->k, c->p); } + /* --- Ed25519 --- */ typedef struct ed25519_signctx { @@ -556,6 +575,7 @@ static const jobops jobtab[] = { { "rsa-priv-blind", rsaprivblind_init, rsapriv_run }, { "rsa-pub", rsapub_init, rsapub_run }, { "x25519", x25519_jobinit, x25519_jobrun }, + { "x448", x448_jobinit, x448_jobrun }, { "ed25519-sign", ed25519_signinit, ed25519_signrun }, { "ed25519-vrf", ed25519_vrfinit, ed25519_vrfrun }, { "ksched", ksched_init, ksched_run },