From: William N. <wne...@cs...> - 2004-04-10 01:16:19
|
On Apr 9, 2004, at 4:24 PM, Brian Hurt wrote: > I hadn't thought about it much. Last time I took a spin through the > crypto libraries, I was more than a little surprised that not one used > GMP > for RSA. Which I found quite surprising, as I'm willing to bet that > GMP > would give you the best possible RSA performance with the least work > from > the implementor. IIRC, GMP already has an "exponentiate in a modular > field" operation, implemented with tuned assembly code. This is the > core > operation of RSA. I was a bit surprised by this as well, so I modified cryptokit to use GMP, and I also added in a number of additional features, like DSA, SHA-{265, 384, 512}, a number of random number and prime generation routines, hash chains, etc. I've been meaning to package it up for quite a while now, but I'm an idiot when it comes to things like makefiles, and I was barely able to cobble one together for my own needs... And oh yeah... my ocamldoc code is a bit farkled. Plus there's the whole issue of getting GMP and MLGMP up and running. Anyway, if you have a need for this, I'd be happy to sent you what I have. > For symmetric key and hashing, I was thinking of > rounding up the hand-tunned assembly versions kicking around. I > haven't > decided what to do with Elliptic curve yet. As always, the problem with hand tuned assembly is the portability issue, that's why I try to stay away from it where I can -- plus, I'm not sure you really get significant enough benefits from assembly coding the modern symmetric ciphers and hashes. And I've been meaning to add some EC stuff to cryptokit-gmp for a long time. Laziness, it'll get you every time. > Thinking about it a second, there's a problem with providing Ocaml > implementations of various symmetric key crypto systems- most of them > assume you have access to efficient 32-bit integers. Which means you > either use Int32 at a serious performance and memory hit. Yep. And this is one of the biggest pains-in-the-ass for me when it comes to OCaml (I do crypto research for a living). There are times I would kill for an efficient word32/64 datatype... Thank goodness we at least have string_unsafe_get and set. William D. Neumann "Here come the bunnies with the sugar water, Do a little dance with the farmer's daughter." -- The Halo Benders |