[pycrypto] Python 3 regression

Jonas Borgström jonas at borgstrom.se
Fri Jun 14 03:57:27 PDT 2013


Hi,

While porting an application to Python 3 I noticed that PyCrypto no
longer supports operations on buffer/memoryview-like objects.

With Python 2 you could do the following:

AES.new(...).decrypt(buffer(a_large_buffer, 32))

To efficiently decrypt a large buffer containing a few header bytes at
the beginning without having to do an expensive string slice/copy.

The buffer() object is not available in Python 3 and has been replaced
by memoryview() which has also been backported to python 2.7.

So the Python 2.7+ version of the above is:

AES.new(...).decrypt(memoryview(a_large_buffer)[32:])

I implemented memoryview support and sent a github pull request [1] two
weeks ago but I haven't received any feedback yet.
Is there anything I can do to help with the review process?

1. https://github.com/dlitz/pycrypto/pull/47

Cheers,
Jonas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: OpenPGP digital signature
URL: <http://lists.dlitz.net/pipermail/pycrypto/attachments/20130614/9f1a1e20/attachment.sig>


More information about the pycrypto mailing list