tech-security archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: SHA3 implementation in src



On 5 March 2016 at 16:51, Taylor R Campbell
<campbell+netbsd-tech-security%mumble.net@localhost> wrote:
>    Date: Sat, 5 Mar 2016 16:20:07 -0800
>    From: Alistair Crooks <agc%pkgsrc.org@localhost>
>
>    Any objections to adding Taylor Campbell's implementation of sha3 to src?
>
>    Proposed diffs in:
>
>    http://ftp.netbsd.org/pub/NetBSD/misc/agc/sha3-src-20160305.diff
>
> The last time I proposed this, before SHA-3 was finalized, joerg
> objected to it because overlap between libc and OpenSSL libcrypto for
> the sha2 functions had historically caused a lot of trouble, and he
> anticipated similar problems with an analogous sha3 API.

I can see that it would be problematic if there was a clash. However,
Rich Salz indicated last year that sha3 was not on the roadmap for
openssl 1.1 -

https://github.com/openssl/openssl/issues/439

However, I'd like to get the functionality in to NetBSD, and waiting
for a third party who don't view it as a priority isn't going to
accomplish that goal, so a number of ways forward spring to mind:

1. put it in libc and handle the fallout when it hits openssl that we ship with
2. put it in a separate libsha3
3. revamp all of our digest code to go into a separate libdigest (not
too happy with this one, mentioned for completeness)
4. just do nothing (again, not useful, mentioned for completeness)

> Smaller issues, OpenSSL aside:
>
> - I wrote a man page for my SHA-3 code at
>   <http://mumble.net/~campbell/hg/sha3/SHA3.3> -- you might want to
>   use that instead of copying the SHA-2 one, which makes incorrect
>   claims such as `This implementation of the SHA functions was written
>   by Aaron D. Gifford'.  There's also a man page for the SHAKE API:
>   <http://mumble.net/~campbell/hg/sha3/SHAKE.3>.

Great, I grabbed SHA3.3 from there.

> - I included atf tests in my last proposal.  If we go through with
>   this, atf tests needn't necessarily be in the first commit but we
>   should include them.

Indeed, will add atf tests as and when

> - No need to define __BEGIN_DECLS if you include <sys/cdefs.h>?

Good point, I've got rid of the duplicate definition.

New diff uploaded to
http://ftp.netbsd.org/pub/NetBSD/misc/agc/sha3-src-20160305.diff

While I'm here, all the "if (0 < d)" I find tortuous to read, and take
even longer to work out what's meant. OK, so I'm slow; my brain just
can't deal with them. Any chance of putting them the right way round,
please? Our compilers are smart enough these days to realise the
difference between  "=" and "==".

Thanks,
Alistair


Home | Main Index | Thread Index | Old Index