duanhongyi / gmssl

a python crypto for sm2/sm3/sm4
MIT License
474 stars 139 forks source link

用某些特定公钥加密的时候会报错,其他语言能正常加密 #78

Open binghc opened 10 months ago

binghc commented 10 months ago

报错密钥

prvKeyHex = 'd26929ec5626686a2fae8e3b3ca3fe9899041ce7999aed48f80263f0277f2ab6'

pubKeyHex = '0440f13559863508ad419e34ab2499c9c777edfff6128e54a4ce044fee232cf0b70d3c55dd7d4e2b7319800ee6b57c33eec28617a542cb7ea3a898b730e330b741'

报错密钥2

prvKeyHex = 'bcfac492fde0edcb646fb6f50e4f3ef390d2f766a4b1bc64f35516ba1c6cde77' pubKeyHex = '0404d09f362fa4464c6ff541da6ba621a161ca46ea4148d1eb66cd7cba794dd36d5e1137cadf03530a86cd8330877fd9cb1d2430e138920a30681e180f2050aada'

用公钥加密的时候会报错 TypeError: object of type 'NoneType' has no len() TypeError: 'NoneType' object is not subscriptable

PrimumMobile commented 10 months ago

去掉公钥开头的04试一下