duanhongyi / gmssl

a python crypto for sm2/sm3/sm4
MIT License
488 stars 141 forks source link

Can't run test SM4.py #9

Closed soloicesky closed 4 years ago

soloicesky commented 5 years ago

sl@sl-VirtualBox:~/workspace/golden_data$ python sm4test.py Traceback (most recent call last): File "sm4test.py", line 8, in crypt_sm4.set_key(key, SM4_ENCRYPT) File "/usr/local/lib/python2.7/dist-packages/gmssl/sm4.py", line 95, in set_key MK[0] = get_uint32_be(key[0:4]) File "/usr/local/lib/python2.7/dist-packages/gmssl/func.py", line 8, in get_uint32_be = lambda key_data:((key_data[0] << 24) | (key_data[1] << 16) | (key_data[2] << 8) | (key_data[3])) TypeError: unsupported operand type(s) for <<: 'str' and 'int'

duanhongyi commented 5 years ago

Python 2.7 is not supported