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

KATs with data please #23

Open
Exaelitus opened this issue Jun 6, 2022 · 3 comments
Open

KATs with data please #23

Exaelitus opened this issue Jun 6, 2022 · 3 comments

Comments

@Exaelitus
Copy link

Hi! I wrote an implementation in c++ of CircleHash, but I need to ensure that it is correct.

I extracted out 3-4 simple KATs from circlehash64_test.go but those have no data vectors. They are only a seed with a null vector/msg payload. This is great for testing Reset/Init/Seed functionality, and my implementation passes those fine. However, none of the Update/Hash data functionality is exercised.

Could you please publish KATs with seed/iv, data/msg, and expecteds? Even 3-4 more with data vectors would be GREATLY appreciated!

Thanks in advance!

@Exaelitus
Copy link
Author

Exaelitus commented Jun 7, 2022

To be specific, I mean simple vectors like "abc". "cba", "cab", "HelloWorld" etc. Rather than the 16k subroutine for data which I would then also have to implement and not know if I have correct, etc.

For example, here are my KATs for Murmur3, in files for my testing of my implementation of it. Obviously, KATs for CircleHash could be anything, and in the format currently used in *_test.go, just illustrating what I mean...

HASH_MURMUR3_32.testvector.txt
HASH_MURMUR3_32.expected.txt
HASH_MURMUR3_32.iv.txt

@fxamacker
Copy link
Owner

Hi @Exaelitus

To be specific, I mean simple vectors like "abc". "cba", "cab", "HelloWorld" etc. Rather than the 16k subroutine for data which I would then also have to implement and not know if I have correct, etc.

Great point!

BTW, I've been working on publishing CircleHash64fx, which will replace CircleHash64f as the default 64-bit hash in CircleHash.

The new hash will have an improved API and I'll be sure to take your suggestion to include a few simpler-to-implement KATs.

In addition to adding a few simple test vectors, I'll also include an intermediate test like what BLAKE3 uses (which is simpler than the current test that consolidates many thousands of digests into one KAT).
https://github.com/BLAKE3-team/BLAKE3/blob/master/test_vectors/test_vectors.json

@Exaelitus
Copy link
Author

That would be perfect, thanks!

In the meantime, do you have 2-3 that I could use to test my current implementation of CircleHash64f ? This would help me know if I'm porting things correctly and be in better position for when you publish CircleHash64fx. No worries if not, thanks!

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

2 participants