[pypy-issue] [issue1374] AES encryption/decryption slower than cPython

Amaury Forgeot d Arc tracker at bugs.pypy.org
Sun Jan 20 17:45:47 CET 2013


Amaury Forgeot d Arc <amauryfa at gmail.com> added the comment:

The changes below fix M2Crypto for me, the module imports and I could run a few demos.

(I also had to drop the declaration of SSLv2_method(), but this is a different issue for M2Crypto:
https://code.google.com/p/grr/wiki/M2CryptoFromSource#Undefined_symbol:_SSLv2_method
)

PyPy could have an empty ceval.h and an implementation for PyInstance_New, though.


--- a/M2Crypto-0.21.1/SWIG/_lib.i~	2011-01-15 20:10:06.000000000 +0100
+++ b/M2Crypto-0.21.1/SWIG/_lib.i	2013-01-20 17:31:29.724931457 +0100
@@ -8,7 +8,6 @@
 #include <openssl/rsa.h>
 #include <openssl/ssl.h>
 #include <openssl/x509.h>
-#include <ceval.h>
 
 /* Blob interface. Deprecated. */
 
@@ -132,7 +131,7 @@
     
         _x509_store_ctx_swigptr = SWIG_NewPointerObj((void *)ctx, SWIGTYPE_p_X509_STORE_CTX, 0);
         _x509_store_ctx_obj = Py_BuildValue("(Oi)", _x509_store_ctx_swigptr, 0);
-        _x509_store_ctx_inst = PyInstance_New(_klass, _x509_store_ctx_obj, NULL);
+        _x509_store_ctx_inst = PyEval_CallObject(_klass, _x509_store_ctx_obj);
         argv = Py_BuildValue("(iO)", ok, _x509_store_ctx_inst);
     } else {
         if (PyErr_Warn(PyExc_DeprecationWarning, "Old style callback, use cb_func(ok, store) instead")) {

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1374>
________________________________________


More information about the pypy-issue mailing list