nucypher / nucypher-pre-python

NuCypher proxy re-encryption library in Python
28 stars 15 forks source link

Key serialization sometimes returns a bytestring of length 31 #15

Open tuxxy opened 7 years ago

tuxxy commented 7 years ago

When serializing a key, sometimes it will return a bytestring of length 31.

This could be because a key generator returns a key that will fit in 31 bytes.

See stacktrace:

tests/crypto/test_api.py:179 (TestCrypto.test_priv_bytes2ec)
self = <test_api.TestCrypto testMethod=test_priv_bytes2ec>

   def test_priv_bytes2ec(self):
       privkey_bytes = ec.serialize(self.privkey_a)[1:]
       self.assertEqual(bytes, type(privkey_bytes))
>       self.assertEqual(32, len(privkey_bytes))
E       AssertionError: 32 != 31

crypto/test_api.py:183: AssertionError