-
Notifications
You must be signed in to change notification settings - Fork 258
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
Add Grostl #8
Comments
Overriding Probably the easiest way to implement this will be to define two separate types with appropriate bounds on OutputSize. It will look approximately like this:
This approach is a bit hacky, but I couldn't get with a better one. Probably with specialization it will be possible to write it in a more general manner, but unfortunately I am not that familiar with it. |
Thanks, I'll do that. I have some questions though.
|
Another point:
With that code, I'd like to not make the |
Yes, it was leftover from testing code.
It allows us to write condition which uses
Yes, forgot to add upper bound.
I believe warning also gives a note with a way around it. You just need to place |
Closed in the #10. |
Claimed by @gsgsingh93
Moved from #1:
I'm having some trouble with the types for Grostl. The issue is that the BlockSize depends on the OutputSize, and so I can't figure out to define the impl for
Digest
. If the Output size is 256 bits or less, then 512 is used as the block size. If the output size is greater than 256 bytes, then 1024 is used as the block size. Here's what I have right now, with the incorrectly hardcodedBlockSize
asU512
Note that
OutputSize
is parameterized here because Grostl can output hashes between 1 and 64 bytes.EDIT: I guess if there's no fancy solution with the generics that could get this to work, I could always just override
block_bytes
andblock_bits
in the trait, and just set a dummyBlockSize
and not use it.The text was updated successfully, but these errors were encountered: