In https://eprint.iacr.org/2017/630.pdf and https://gimli.cr.yp.to/gimli-20170627.pdf there are test vectors for the gimli hash function. I have compile the reference C code test_hash.c from https://gimli.cr.yp.to/gimli-20170627.tar.gz on two systems (Intel x86/Win, ARMV7l GNU/Linux) and consistently get results that differ from the printed vectors. The paper lists e.g.

input: "" (empty string)
input (bytes): (0 bytes)

but both executables give


Has anybody verified the test vectors from the papers?

For the permutation/compression function test program test.c my results are the same as given in the file test.exp.

  • $\begingroup$ Did you have to modify any of the files in the c-ref folder to compile them successfully? $\endgroup$
    – Q-Club
    Aug 28, 2017 at 23:13
  • $\begingroup$ Yes, I commented-out the first line in gimli.h to read //#<x86intrin.h>, because the compiler(s) did not find the file. $\endgroup$ Aug 29, 2017 at 8:18

1 Answer 1


I'm one of the authors of Gimli.

TL;DR: Test vectors provided by the paper are indeed wrong.

We had a error when we generated the paper and the test vectors have not been updated with respect to the last iteration of Gimli (in development stages).

Also one of the test vectors had a double space at some place. This has been corrected and will be updated in the revision of the paper.

Please find the correct ones below:

Test vectors

input 1:

There's plenty for the both of us, may the best Dwarf win.

54686572 65277320 706c656e 74792066 6f722074 68652062 6f746820
6f662075 732c206d 61792074 68652062 65737420 44776172 66207769

output 1:


input 2:

If anyone was to ask for my opinion, which I note they're not, I'd say we were taking the long way around.

49662061 6e796f6e 65207761 7320746f 2061736b 20666f72 206d7920
6f70696e 696f6e2c 20776869 63682049 206e6f74 65207468 65792772
65206e6f 742c2049 27642073 61792077 65207765 72652074 616b696e
67207468 65206c6f 6e672077 61792061 726f756e 642e

output 2:


input 3:

Speak words we can all understand!

53706561 6b20776f 72647320 77652063 616e2061 6c6c2075 6e646572
7374616e 6421

output 3:


input 4:

It's true you don't see many Dwarf-women. And in fact, they are so alike in voice and appearance, that they are often mistaken for Dwarf-men. And this in turn has given rise to the belief that there are no Dwarf-women, and that Dwarves just spring out of holes in the ground! Which is, of course, ridiculous.

49742773 20747275 6520796f 7520646f 6e277420 73656520 6d616e79
20447761 72662d77 6f6d656e 2e20416e 6420696e 20666163 742c2074
68657920 61726520 736f2061 6c696b65 20696e20 766f6963 6520616e
64206170 70656172 616e6365 2c207468 61742074 68657920 61726520
6f667465 6e206d69 7374616b 656e2066 6f722044 77617266 2d6d656e
2e20416e 64207468 69732069 6e207475 726e2068 61732067 6976656e
20726973 6520746f 20746865 2062656c 69656620 74686174 20746865
72652061 7265206e 6f204477 6172662d 776f6d65 6e2c2061 6e642074
68617420 44776172 76657320 6a757374 20737072 696e6720 6f757420
6f662068 6f6c6573 20696e20 74686520 67726f75 6e642120 57686963
68206973 2c206f66 20636f75 7273652c 20726964 6963756c 6f75732e

output 4:


input 5:

 no bytes

ouput 5:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.