Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upHasher expects correct output length #5
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
zx2c4 commentedJun 25, 2016
•
edited
Symmetric state has
hof a fixed maximum size:When initializing, the following code is run:
When using PSK mode and a 32-byte hash function, such as Blake2s, the second branch is taken:
This passes
self.htohasher.result, which is 64 bytes:Unfortunately, the result function expects for h to be equal to the output length. That is, it expects h to be 32 bytes. From
blake2s.rs:This makes using Blake2s with PSK impossible. The solution is to have the size of
hchange based on which hash function is being used.