What's the reason for using the extra level of indirection by using `()? Ie, when is HashAlgorithm and MD5_Algorithm used directly?
/ Martin Nilsson (har bott i google)
Previous text:
2003-03-20 17:58: Subject: nettle-1.7
Now I've done some initial hacking on Crypto.pmod/module.pmod.
I made it inherit Nettle, and added two classes, HashAlgorithm (an abstract class) and MD5_Algorithm. The latter is also instantiated as Crypto.MD5.
It has the methods
string name() int digest_size() int block_size() string hash(string) MD5_State `()()
(HashAlgorithm has the same methods, except that `() returns a HashState, and lacks an implementation).
Unfortunately, I couldn't use constant for either Crypto.MD5 or the `() method. Problem is that HashAlgorithm needs a prototype for `(), and it seems I can't override it in MD5_Algorithm using constant. Perhaps there's some trick that I've missed?
I wrapped the Nettle parts inside an #if constant(Nettle), is that enough to make sure that the module can be compiled if Nettle is unavailable?
/ Niels Möller ()