X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/ddd4720bd8a7e04bb37ba6825b46f1bbdce9d3e7..cc36f2d8913cf55b43ed32d3f2f06622906038af:/pubkey.c diff --git a/pubkey.c b/pubkey.c index 05fc397..b1d32a5 100644 --- a/pubkey.c +++ b/pubkey.c @@ -1256,6 +1256,16 @@ EDDSAS(DEFEDDSA) /*----- Global stuff ------------------------------------------------------*/ +static const struct nameval consts[] = { + CONST(X25519_KEYSZ), CONST(X25519_PUBSZ), CONST(X25519_OUTSZ), + CONST(X448_KEYSZ), CONST(X448_PUBSZ), CONST(X448_OUTSZ), + CONST(ED25519_KEYSZ), CONST(ED25519_PUBSZ), CONST(ED25519_SIGSZ), + CONST(ED25519_MAXPERSOSZ), + CONST(ED448_KEYSZ), CONST(ED448_PUBSZ), CONST(ED448_SIGSZ), + CONST(ED448_MAXPERSOSZ), + { 0 } +}; + static const PyMethodDef methods[] = { #define METHNAME(name) meth_##name KWMETH(_p1crypt_encode, 0) @@ -1301,6 +1311,7 @@ void pubkey_pyinsert(PyObject *mod) INSERT("KCDSAPriv", kcdsapriv_pytype); INSERT("RSAPub", rsapub_pytype); INSERT("RSAPriv", rsapriv_pytype); + setconstants(mod, consts); } /*----- That's all, folks -------------------------------------------------*/