*.c: Split the constant definitions into the various submodules.
[catacomb-python] / pubkey.c
index 05fc397..b1d32a5 100644 (file)
--- 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 -------------------------------------------------*/