JHUISI / charm

Charm: A Framework for Rapidly Prototyping Cryptosystems
http://charm-crypto.io
GNU Lesser General Public License v3.0
541 stars 166 forks source link

Fix for Issue #260 #300

Closed terry-fee closed 11 months ago

terry-fee commented 11 months ago

The issue seems to be with the definition for PyMethodDef Integer_methods[] in integermodule.c. Somehow Python versions 3.8 and above do not like specifying METH_O | METH_NOARGS in the method testCoPrime. With this, when trying to finalise the type object through PyType_Ready(&IntegerType), it always returns a negative status code and fails silently.

A solution is to replace either METH_NOARGS or METH_O instead of the above. I also notice that no other file is using the method testCoPrime.

I have tested Python 3.7, 3.8, 3.9, and 3.10 on Ubuntu 22.04 WSL for Windows 11, Ubuntu 22.04 on Raspberry Pi, and Ubuntu 20.04. All worked except for Python 3.10 on Ubuntu 20.04, but the issue was with an outdated pip.