Brian Graversen <[EMAIL PROTECTED]> writes: Hi Brian
> Attached is the first sample implementation (can we attach files?) Sure -- messages above 1 MiB will be held for moderation, though. If you have larger stuff (up to 4 MiB) you are welcome to send it to [EMAIL PROTECTED] or attach it at the issue tracker: http://tracker.viff.dk/ (DAIMI seems to be messing around with my office computer, so it is down right now...) By the way, see http://lists.viff.dk/ (that page is always a bit slow to load) for links to all three VIFF mailing lists. In this case it would have been slightly more convenient to just attach the two source files and the jpeg image as-is so that we don't have to decompress the zip file. > of getRandomBytes(int), and a screenshot of the module being called > from Python. There is a build-script as well. Wow, you're quick! This looks really good -- much easier than I had expected. And the bytes in the screenshot sure do look very random :-) > It is not really possible to build it without having the IBM > software installed, nor is it possible to run it without the IBM > hardware, so the code is more for those interested at looking at it. > It is very simple... Thanks for posting it anyway, it's really cool to get a glimpse of how such a gadget works. > I'm more interested in hearing how this will be configurable in the > client software. Since some clients will run using software, and at > least one will run using the IBM hardware, I'm guessing some > configuration will have to be handled in the python code, so it > knows which crypto-library to use (hardware or software). Definitely. If you look at BasicRuntime.add_options you will see that there is already a simple system in place for configuring the VIFF runtime classes. I was going to send you this link: http://viff.dk/doc/0.6/runtime.html#viff.runtime.BasicRuntime.add_options but then I saw that it was undocumented :-( *Everybody*: If you would like to get going with VIFF development, then please find such undocumented functions and send us patches with documentation. You can follow along in the development by subscribing to here: http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk Then check out the newly commited code and add documentation. This is a great and much appreciated way to help development! Just thinking "Martin will fix it" is not going to scale since I can only do so much, and I also forget things... :-) Ehmm, back to the point: The idea is that a program calls this static method like this (see apps/millionaires.py for a nice example): from optparse import OptionParser from viff.runtime import Runtime parser = OptionParser() Runtime.add_options(parser) options, args = parser.parse_args() So one could add a new command line flag (maybe "--hardware-crypto", "--ibm4758", or something similar) in add_options and then all correctly written client programs should pick it up. In the runtime class self.options holds the command line options and can act accourdingly. Here that would probably mean trying to load the ibm4758 Python module and error out if that fails. Try taking a look at how the code deals with PyOpenSSL right now. This is also in add_options, by the way. To use the random bytes you will want to fiddle with viff.util.rand. This is a Random instance which is used by all VIFF code to access random data. Replacing that with your own subclass of SystemRandom in which you override random() and getrandombits() should work beautifully! See http://docs.python.org/dev/library/random.html and the source of random.py (maybe in /usr/lib/python2.4/random.py). A final thing: if you use IRC, then I'm in #viff on freenode.net. -- Martin Geisler _______________________________________________ viff-devel mailing list (http://viff.dk/) [email protected] http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk
