Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make a type for every hash function #100

Open
JanisErdmanis opened this issue Oct 30, 2019 · 0 comments
Open

Make a type for every hash function #100

JanisErdmanis opened this issue Oct 30, 2019 · 0 comments

Comments

@JanisErdmanis
Copy link

JanisErdmanis commented Oct 30, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant