Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ww-rm committed Apr 13, 2024
1 parent d9d8c60 commit a8ccdf3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gmalglib/coremodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ static PyTypeObject py_type_SM3 = {
static int PyModule_AddSM3(PyObject* py_module)
{
PyObject* py_long_SM3_MAX_MSG_BITLEN = NULL;
PyObject* py_long_SM3_KDF_MAX_LENGTH = NULL;

if (PyType_Ready(&py_type_SM3) < 0) return 0;

Expand All @@ -169,7 +170,8 @@ static int PyModule_AddSM3(PyObject* py_module)
if (!(py_long_SM3_MAX_MSG_BITLEN = PyLong_FromUnsignedLongLong(SM3_MAX_MSG_BITLEN))) goto error;
if (PyModule_AddObject(py_module, "SM3_MAX_MSG_BITLEN", py_long_SM3_MAX_MSG_BITLEN) < 0) goto error;
if (PyModule_AddIntMacro(py_module, SM3_DIGEST_LENGTH) < 0) goto error;
if (PyModule_AddIntMacro(py_module, SM3_KDF_MAX_LENGTH) < 0) goto error;
if (!(py_long_SM3_KDF_MAX_LENGTH = PyLong_FromUnsignedLongLong(SM3_KDF_MAX_LENGTH))) goto error;
if (PyModule_AddObject(py_module, "SM3_KDF_MAX_LENGTH", py_long_SM3_KDF_MAX_LENGTH) < 0) goto error;
if (PyModule_AddIntMacro(py_module, SM3_MAC_LENGTH) < 0) goto error;

return 1;
Expand Down

0 comments on commit a8ccdf3

Please sign in to comment.