--- /dev/null
+/* -*-c-*-
+ *
+ * Python binding to Kalyna reference implementation
+ *
+ * (c) 2017 Mark Wooding
+ */
+
+/*----- Licensing notice --------------------------------------------------*
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*----- Header files ------------------------------------------------------*/
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+
+/*----- Utilities ---------------------------------------------------------*/
+
+#define INSERT(name, ob) do { \
+ PyObject *_o = (PyObject *)(ob); \
+ Py_INCREF(_o); \
+ PyModule_AddObject(mod, name, _o); \
+} while (0)
+
+/*----- Main code ---------------------------------------------------------*/
+
+void initkalyna(void)
+{
+ PyObject *mod = Py_InitModule("kalyna", 0);
+ INSERT("version", PyString_FromString(VERSION));
+}
+
+/*----- That's all, folks -------------------------------------------------*/
--- /dev/null
+#! /usr/bin/python
+
+import distutils.core as DC
+import mdwsetup as MS
+
+cat = DC.Extension('kalyna', ['kalyna-python.c'],
+ extra_compile_args = ['-DVERSION="%s"' %
+ MS.auto_version()])
+
+MS.setup(name = 'kalyna-python',
+ description = 'Python binding to Kalyna reference implementation',
+ url = 'https://git.distorted.org.uk/~mdw/kalyna-python/',
+ author = 'Mark Wooding',
+ author_email = 'mdw@distorted.org.uk',
+ license = 'Alas unclear',
+ ext_modules = [cat])