Make a type for every hash function
JanisErdmanis opened this issue · comments
Currently, it is not possible to write a hash function generic security protocols. To understand that, consider data and hash value. Let's say we want to test that the hash value corresponds to the data:
ishash(data,hash)
The problem is that one can not make that generic.
A resolution for such a problem is to give type information for the hashes. Thus one could write a generic function:
ishash(data,hash::Hash) = typeof(hash)(data).hash==hash.hash
I started to implement an interface in my Signatures.jl package (lines 40 to 63), but that does not have a place there. @staticfloat could that be implemented in Nettle.jl?