OT: Cypto Lib
Rajinder Yadav
devguy.ca-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Fri Oct 16 00:55:33 UTC 2009
Ed F. McCurdy wrote:
>>>>>> "Rajinder" == Rajinder Yadav <devguy.ca-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> writes:
>
> >> This project wraps openssl for use from python:
> >>
> >> http://chandlerproject.org/bin/view/Projects/MeTooCrypto
> >>
> >> It could be used as guide for how to build a similar interface
> >> for Ruby.
>
> Python and Ruby have similar mechanisms for calling code written in C.
> M2Crypto uses SWIG to generate the wrapper code to use openssl.
> SWIG can generate wrapper code for Ruby as well as Python.
>
> >> "M2Crypto's unit tests cover over 80% of the Python code."
>
> Rajinder> What does that mean, the code is written mostly in python?
> Rajinder> With Ruby I am planning on doing all the heavy lifting in
> Rajinder> C/C++ code and just writing Ruby wrappers.
>
> The Python code being tested is the wrapper code that makes
> openssl functions callable from Python, all the
> crypto work is done inside libssl.so and libcrypto.so from openssl.org.
>
> Rajinder> Would know have an idea how M2Crypto is coded, thanks!
>
> It is coded in much the same way as any typical Ruby Extension Module;
> a google search for "swig ruby" will turn up many similiar examples.
>
> Ed
Thanks ED,
I was hoping M2Crypto was using SWIG, because than it's just a matter of calling
swig with the -ruby switch and you have instant interface bindings for Ruby as
far as I understand.
I started to play around with SWIG and liked the fact that you can leverage SWIG
interfaces to map C/C++ code to other languages like Ruby, Perl, Python, over a
dozen other languages to pick.
Unfortunately the SWIG mailing list is pretty limp, great tool with good
document, but they need to build a more active community, then again maybe not
that many people get this deep into coding.
I am still waiting for a reply about memory allocation and GC behavior on C/C++
allocated memory and passed to Ruby, or vice versa.
--
Kind Regards,
Rajinder Yadav
http://DevMentor.org
Do Good ~ Share Freely
--
The Toronto Linux Users Group. Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
More information about the Legacy
mailing list