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 #303 and some additional issues with PY_SSIZE_T_CLEAN macro #305

Closed terry-fee closed 4 months ago

terry-fee commented 4 months ago

While testing the fix for #303, I got more test errors with the familiar message "PY_SSIZE_T_CLEAN macro must be defined for '#' formats". After adding the macro definition to AES.c, some of the tests failed with the message "Unknown cipher feedback mode 0", when the expected mode should be 1 to 6. It turned out that the data type for mode should be long int or something similar instead of int. So I make additional fixes.

Tested OK for Python versions 3.8 to 3.10 on Ubuntu, WSL, and Ubuntu on Raspberry Pi.