[Cryptodev-linux-devel] Python bindings for the cryptodev module.

2015-03-04 Thread Tilemachos Charalampous
Hello. I'm an undergraduate student studying electrical and computer 
engineering at the NTUA.
As part of an Operating Systems course, I worked a bit on the cryptodev 
module, and needed it to use it in a Pyhton project. After searching a 
bit on the Internet I couldn't find any cryptodev bindings, so I decided 
to develop them myself. I was encouraged by my instructor (Vangelis 
Koukis, Cc:ed) to develop the bindings to something more general, that 
supports the whole cryprtodev module.


I have created two types of bindings. Static bindings and semi automated 
bindings. Static bindings are created based on cryptodev.h and ioctl.h 
(from my Linux system). Semi automated bindings are created using 
ctypesgen for python. I have created a simple makefile in which 
ctypesgen is used to create ioctl.py and cryptodev.py automatically into 
a Python module. The reason that I could not build fully automated 
bindings is because of a bug in ctypesgen, in which it cannot parse 
sizeof if the argument is defined in a different header file. You can 
see a more detailed explanation in README.md of the ctypesgen branch on 
my repository under Why not fully automated way? (links provided at 
the end). Also I have implemented some of your tests into Python that 
use the bindings.


If you are interested, I would like to get this code included in 
mainline cryptodev. All my changes currently live at 
https://github.com/tchar/cryptodev-python/.
Also the link for README.md, which explains the ctypesgen bug I 
mentioned is 
https://github.com/tchar/cryptodev-python/blob/ctypesgen/README.md

The link for the ctypesgen module is https://code.google.com/p/ctypesgen/

Looking forward to your comments,
Tilemachos.
--
Tilemachos Charalampous
Undergraduate Student
School of Electrical and Computer Engineering
National Technical University of Athens
tilemachos.charalamp...@gmail.com

___
Cryptodev-linux-devel mailing list
Cryptodev-linux-devel@gna.org
https://mail.gna.org/listinfo/cryptodev-linux-devel


Re: [Cryptodev-linux-devel] Python bindings for the cryptodev module.

2015-03-04 Thread Phil Sutter
Hi,

On Wed, Mar 04, 2015 at 05:50:35PM +0200, Tilemachos Charalampous wrote:
 Hello. I'm an undergraduate student studying electrical and computer 
 engineering at the NTUA.
 As part of an Operating Systems course, I worked a bit on the cryptodev 
 module, and needed it to use it in a Pyhton project. After searching a 
 bit on the Internet I couldn't find any cryptodev bindings, so I decided 
 to develop them myself. I was encouraged by my instructor (Vangelis 
 Koukis, Cc:ed) to develop the bindings to something more general, that 
 supports the whole cryprtodev module.

Forgot the Cc or was it blind?

 I have created two types of bindings. Static bindings and semi automated 
 bindings. Static bindings are created based on cryptodev.h and ioctl.h 
 (from my Linux system). Semi automated bindings are created using 
 ctypesgen for python. I have created a simple makefile in which 
 ctypesgen is used to create ioctl.py and cryptodev.py automatically into 
 a Python module. The reason that I could not build fully automated 
 bindings is because of a bug in ctypesgen, in which it cannot parse 
 sizeof if the argument is defined in a different header file. You can 
 see a more detailed explanation in README.md of the ctypesgen branch on 
 my repository under Why not fully automated way? (links provided at 
 the end). Also I have implemented some of your tests into Python that 
 use the bindings.
 
 If you are interested, I would like to get this code included in 
 mainline cryptodev. All my changes currently live at 
 https://github.com/tchar/cryptodev-python/.
 Also the link for README.md, which explains the ctypesgen bug I 
 mentioned is 
 https://github.com/tchar/cryptodev-python/blob/ctypesgen/README.md
 The link for the ctypesgen module is https://code.google.com/p/ctypesgen/

Looks nice. How about submitting a patch? Do we have to keep the python
bindings themselfs or is it possible to have them generated upon 'make
dist'? I would prefer not having to keep them in sync manually. Maybe
this is related to your mention of 'semi automated bindings', but I
don't get it due to lack of experience in python/C interfaces.

Cheers, Phil

___
Cryptodev-linux-devel mailing list
Cryptodev-linux-devel@gna.org
https://mail.gna.org/listinfo/cryptodev-linux-devel