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

Blake2: add modern interface using Nat #140

Merged
merged 5 commits into from Mar 18, 2017

Conversation

Projects
None yet
3 participants
@NicolasDP
Copy link
Contributor

NicolasDP commented Mar 13, 2017

Just continuing the improvements started with Cryptonite.Hash.SHAKE.

@ocheron

This comment has been minimized.

Copy link
Contributor

ocheron commented Mar 13, 2017

BLAKE2 is defined with a maximum digest size.
Is it possible to add this contraint using the operators from GHC.TypeLits ?

@NicolasDP

This comment has been minimized.

Copy link
Contributor Author

NicolasDP commented Mar 13, 2017

That's a good idea. I will see if I can come with something in Crypto.Internal.Nat.

@NicolasDP

This comment has been minimized.

Copy link
Contributor Author

NicolasDP commented Mar 13, 2017

Now, with base >= 4.9.0, we can have the nice following output:

/Users/nicolas/work/primetype/haskell-crypto/cryptonite/tests/Hash.hs:202:23: error:
    • bitlen 1024 is greater than 512
      You have tried to use an invalid Digest size. Please, refer to the documentation.
    • In the expression: HashAlg (Blake2b :: Blake2b 1024)
      In the expression:
        ("Blake2b 512", HashAlg (Blake2b :: Blake2b 1024), 
      ...

Also added the minimal constraint of 1 byte.

@vincenthz vincenthz merged commit 666eb4e into haskell-crypto:master Mar 18, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@vincenthz

This comment has been minimized.

Copy link
Member

vincenthz commented Mar 18, 2017

Nice, thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment