diff --git a/src/_chacha20.c b/src/_chacha20.c index 71b5cda..98e61c2 100644 --- a/src/_chacha20.c +++ b/src/_chacha20.c @@ -130,11 +130,7 @@ static PyObject * _chacha20_cipher(PyObject *self, PyObject *args) { ChaCha20XOR(out, (unsigned char *)in, msgLen, (unsigned char *)key, (unsigned char *)nonce, counter); -#if PY_MAJOR_VERSION >= 3 return Py_BuildValue("y#", out, msgLen); -#else - return Py_BuildValue("s#", out, msgLen); -#endif } static PyMethodDef _chacha20__methods__[] = { @@ -142,8 +138,6 @@ static PyMethodDef _chacha20__methods__[] = { {NULL, NULL, 0, NULL} /* Sentinel */ }; - -#if PY_MAJOR_VERSION >= 3 static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, "_chacha20", @@ -160,10 +154,3 @@ PyMODINIT_FUNC PyInit__chacha20(void) { PyObject * m = PyModule_Create(&moduledef); return m; } - - -#else -PyMODINIT_FUNC init_chacha20(void) { - Py_InitModule("_chacha20", _chacha20__methods__); -} -#endif diff --git a/src/_poly1305.c b/src/_poly1305.c index 4cb4515..3e10998 100644 --- a/src/_poly1305.c +++ b/src/_poly1305.c @@ -278,11 +278,7 @@ static PyObject * _poly1305_tag(PyObject *self, PyObject *args) { Poly1305Update(&state, (unsigned char *)msg, msgLen); Poly1305Finish(&state, mac); -#if PY_MAJOR_VERSION >= 3 return Py_BuildValue("y#", mac, macSize); -#else - return Py_BuildValue("s#", mac, macSize); -#endif } static PyMethodDef _poly1305__methods__[] = { @@ -290,8 +286,6 @@ static PyMethodDef _poly1305__methods__[] = { {NULL, NULL, 0, NULL} /* Sentinel */ }; - -#if PY_MAJOR_VERSION >= 3 static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, "_poly1305", @@ -308,10 +302,3 @@ PyMODINIT_FUNC PyInit__poly1305(void) { PyObject * m = PyModule_Create(&moduledef); return m; } - - -#else -PyMODINIT_FUNC init_poly1305(void) { - Py_InitModule("_poly1305", _poly1305__methods__); -} -#endif