[PYTHON-CRYPTO] Python rijndael implementation

Rich Salz rsalz at ZOLERA.COM
Tue Apr 24 03:53:27 CEST 2001


> It appears that a Python mode implementation using C versions
> of these would spend most of it's time in the underlying C calls.

The thing that kills you is (needless) buffer copies.  In C it's pretty
easy to declare a couple of buffers (often, on the stack) and use them
repeatedly for the various chaining codes, e.g.  It's hard to do that in
python, at least in a way that's pythonic. :)  As a result, there's
PyString_FromStringAndSize calls, which are lots of malloc/memcpy's that
you'd really rather avoid.

I'd love to be proven wrong.
        /r$



More information about the python-crypto mailing list