Aloha!
Ok here is a revised patch with defines of update functions like for sha384. This patch is in unified format.
Joachim Strömbergson joachim@secworks.se writes:
Ok here is a revised patch with defines of update functions like for sha384. This patch is in unified format.
Thanks. Seems almost ready to to apply (and I already pushed the trivial indent fix). Some additional comments:
1. For the sha512.c copyright header, should it be "Copyright (C) 2014 Joachim Strömbergson", or Secworks AB, or something else?
2. Test cases are needed. Benchmark support would also be nice, but less important than tests and documentation.
3. I think there should be _DIGEST_SIZE and _DATA_SIZE defines for the new algorithms. In particular, SHA512_256_DATA_SIZE is different from SHA256_DATA_SIZE.
4. Add corresponding -meta.c files? Defining
const struct nettle_hash nettle_sha512_224; const struct nettle_hash nettle_sha512_256;
Or, since all variants are implemented in the same sha512.c source file anyway, maybe these objects could be placed together in sha384-meta.c. With this in place, adding them to examples/nettle-benchmark.c is trivial.
Should also update nettle-meta-hashes.c and correspnding test case.
Regards, /Niels
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Aloha!
Niels Möller wrote:
- For the sha512.c copyright header, should it be "Copyright (C)
2014 Joachim Strömbergson", or Secworks AB, or something else?
Just add me (Joachim) as coauthor if that is ok with you. It is mainly your code.
- Test cases are needed. Benchmark support would also be nice, but
less important than tests and documentation.
Yes. To both. I was thinking of doing benchmarking anyway since the point of these versions is to get better performance than for normal SHA-224 and SHA-256.
- I think there should be _DIGEST_SIZE and _DATA_SIZE defines for
the new algorithms. In particular, SHA512_256_DATA_SIZE is different from SHA256_DATA_SIZE.
Good point. I'll add those and file new patches. Probably today.
- Add corresponding -meta.c files? Defining
const struct nettle_hash nettle_sha512_224; const struct nettle_hash nettle_sha512_256;
Or, since all variants are implemented in the same sha512.c source file anyway, maybe these objects could be placed together in sha384-meta.c. With this in place, adding them to examples/nettle-benchmark.c is trivial.
A little bit confusing having them in SHA-384. But something one should be able to live with.
I'll do some hacking on this and the docs.
- -- Med vänlig hälsning, Yours
Joachim Strömbergson - Alltid i harmonisk svängning. ======================================================================== Joachim Strömbergson Secworks AB joachim@secworks.se ========================================================================
Joachim Strömbergson joachim@secworks.se writes:
Good point. I'll add those and file new patches. Probably today.
I've pushed the first set of patches (to the master branch) now.
const struct nettle_hash nettle_sha512_224; const struct nettle_hash nettle_sha512_256;
Or, since all variants are implemented in the same sha512.c source file anyway, maybe these objects could be placed together in sha384-meta.c.
A little bit confusing having them in SHA-384. But something one should be able to live with.
Feel free to put them in separate files.
I'll do some hacking on this and the docs.
I look forward to that. Of the missing things, test cases are most important, I think.
Regards, /Niels
nettle-bugs@lists.lysator.liu.se