It doesn't seem to work that way. Attached is the patch to Crypto.pmod/module.pmod (this one is not complete just for testing purpose)
If try to use it:
object a = Crypto.CRC16();
/usr/local/pike/7.8.447/lib/modules/Crypto.pmod/module.pmod:118:Illegal program pointer. Compiler Error: 1: Index 'CRC16' not present in module Crypto. Compiler Error: 1: Indexed module was: master()->joinnode(({ /* 1 element */ master()->dirnode("/usr/local/pike/7.8.447/lib/modules/Crypto.pmod":0) })). Compiler Error: 1: Attempt to call a non function value `() (function call). Compiler Error: 1: Expected: function. Compiler Error: 1: Got : zero.
If I create a file "CRC16.pmod" like attached in a previous email. I can use CRC16();
protected class _MySubModule { ... }
_MySubModule MySubModule = _MySubModule();
object a = Crypto.CRC16();
/usr/local/pike/7.8.447/lib/modules/Crypto.pmod/module.pmod:118:Illegal program pointer.
You need to put the class you inherit before the inherit itself. This is one case where the pike compiler isn't independent on order.
Btw, it looks rather odd to me that you inherit the hash state class into the base algorithm class. The hash state is supposed to contain the context for a specific hashing while the algorithm class has the static data (e.g. the polynomial). And the algorithm class (which is a module and hence just a single instance) cannot return itself as state, because then several hashings running in parallell would clobber each other.
pike-devel@lists.lysator.liu.se