Ok, now I have cvs access. Just have to build a stable pike from a srcdist before trying the cvs version...
For a start, I think it's best to create a directory "src/post_modules/Nettle", that builds a module "Nettle.so". This will be cmod-glue to nettle, with basic crypto objects.
Then friendlier objects and namespaces should be implemented in Pike, in Crypto.pmod.
Any objections to that plan?
/ Niels Möller ()
Previous text:
2003-03-11 23:17: Subject: nettle-1.7
The interface I imagine is something like
Crypto.AES()->set_encrypt_key(the_key)->crypt(data)
The basic AES object will only encrypt complete blocks. Then you can wrap CBC on top of that, but that would still probably handle complete blocks.
In order to handle arbitrary length input, one must use some padding convention. An object implementing padding could also do buffering. I'm not sure I see the point of feed/drain, the most natural interface to me would be
o->crypt(data) // encrypts or buffers more data. Returns as much // output as is available
o->finish() // Do final padding, return final output.
One could do feed/drain on top of that, but perhaps that's best done in pike rather than C.
For hash functions, the interface would be close to nettles,
o = Crypto.MD5(); o->update("foo"); // Returns self, so that o->update("bar"); // Crypto.MD5()->update("foo)->digest() works too. o->digest(); // Returns digest string
So, that's basically what I've been imagining, but I'm open to suggestions.
/ Niels Möller ()