SHA3 #173
No reviewers
Labels
No labels
bug
duplicate
enhancement
feature
help wanted
improve API
invalid
needs documentation
not-planned
rtfm
stale
support
wishlist
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libtom/libtomcrypt!173
Loading…
Reference in a new issue
No description provided.
Delete branch "pr/sha3"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
SHAKE128 and SHAKE256 need to be added - I only do not know yet how to do it (they do not fit well to our hash machinery).
The implementation is based on https://github.com/brainhub/SHA3IUF
I am extremely strongly against creating dependency on
stdint.h.I lost this battle in libtommath and the result is that I have to keep a specially patched
tommath.hfor my perl bindings which is a pain for me. Frankly we did not gain anything in libtommath by starting usingstdint.h.And please do not give me those stories about how old is C99. It was a week ago when I was trying to improve libtomcrypt's Visual C builds. And guess what, on Visual Studio 2008 Express there is no
stdint.hsotommath.hhit me again.In short: either
meorstdint.h😃using size_t does not necessarily mean including stdint.h. since you're a fan of ifdef hacks over configure tests you could hardcode a list of CPP defines which define HAVE_STDINT_H and only use it there, for the other platforms fall back to typedefing it to unsigned long, or unsigned long long on windows64 bit.
Let's move
size_tdiscussion to #175 so that it does not block this PRRegarding 4abbf45731c235c973da9a1ae349bc788eb232ca wouldn't it make sense to have a separate
sha3_shakehash descriptor so we can re-use the hash helpers?unfortunately
sha3_shake_donedoes not fit intoltc_hash_descriptorbecause it is missing theoutlen(SHAKE functions are designed in a way that they give the output as long as you ask.Kind of
outleninconsistency we have here:The thing is that
hash_memorygives you the output as long as thehashsizeis, whereassha3_shake_memorygives you the output as long as you have requested byoutlenparam. So these functions are a bit different in their nature,sha3_shake_memoryis more likehkdforprng->readwhere we useoutlennot*outlen.But providing that we have a separate outlen related issue #176 I propose to discuss/solve it rather there than to block this PR. When we decide to change
outlento*outlenit is trivial to change the implementation.Coverage increased (+0.06%) to 87.475% when pulling 95c94bf317b05913a98fbef81e79afe4b84681b8 on pr/sha3 into
7885c91af3on develop.Rebased & squashed into 1 commit, travis-ci all green. I propose merging to develop.
I'd prefer to have
sha3_shake_memory()already with*outlenthen it's fine by me to mergesha3_shake_memorychangedShould I also change
int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen)to*outlen? By "normal" hashes we have no outlen - likeint sha3_done(hash_state *md, unsigned char *hash)Coverage increased (+0.07%) to 87.478% when pulling 9c92c0a4c45ae640e99c9cf8f467a5fd32e12870 on pr/sha3 into
7885c91af3on develop.I also thought about that, but as there's no reference I'd say we keep it like that.
btw. I also had the idea why can't we provide a
sha3_shake_set_outlen(hash_state *md, unsigned long outlen), then we could havesha3_shake_done(hash_state *md, unsigned char *hash):)but it was just an idea and as there's no way to properly integrate this in the 'hashing framework' I think it doesn't make sense to squeeze the sha3 shake API in there
Coverage increased (+0.07%) to 87.478% when pulling
c6a0362c88on pr/sha3 into1b81848576on develop.