Re: improving OpenBSD's gmac.c...

2014-11-12 Thread Damien Miller
On Wed, 12 Nov 2014, Mike Belopuhov wrote: > > isn't this likely to make it more likely to be subject to timing > > attacks? > > > > then how is this different to our table based aes implementation? > and it's the same C code as in openssl which also uses table based > gcm implementation. Yeah,

Re: improving OpenBSD's gmac.c...

2014-11-12 Thread John-Mark Gurney
Mike Belopuhov wrote this message on Wed, Nov 12, 2014 at 19:05 +0100: > On 10 October 2014 02:39, Damien Miller wrote: > > On Thu, 9 Oct 2014, Christian Weisgerber wrote: > > > >> John-Mark Gurney: > >> > >> > I also have an implementation of ghash that does a 4 bit lookup table > >> > version wi

Re: improving OpenBSD's gmac.c...

2014-11-12 Thread Mike Belopuhov
On 10 October 2014 02:39, Damien Miller wrote: > On Thu, 9 Oct 2014, Christian Weisgerber wrote: > >> John-Mark Gurney: >> >> > I also have an implementation of ghash that does a 4 bit lookup table >> > version with the table split between cache lines in p4 at: >> > https://p4db.freebsd.org/fileVi

Re: improving OpenBSD's gmac.c...

2014-10-13 Thread Philip Guenther
On Mon, Oct 13, 2014 at 5:26 AM, David Gwynne wrote: > On 13 Oct 2014, at 9:00 pm, Christian Weisgerber wrote: > >> David Gwynne: >> >>> dont you need endian.h to get bemtoh64 and htobem64? (This is kernel code, so that would be ) >> I went by the man page, which says . > > and cvs blame says

Re: improving OpenBSD's gmac.c...

2014-10-13 Thread David Gwynne
On 13 Oct 2014, at 9:00 pm, Christian Weisgerber wrote: > David Gwynne: > >> dont you need endian.h to get bemtoh64 and htobem64? > > I went by the man page, which says . and cvs blame says that's my fault... fair enough. ill talk to philip about whether that should change, but dont let that

Re: improving OpenBSD's gmac.c...

2014-10-13 Thread Christian Weisgerber
David Gwynne: > dont you need endian.h to get bemtoh64 and htobem64? I went by the man page, which says . PS: I accidentally omitted a chunk: Index: sys/conf/files === RCS file: /cvs/src/sys/conf/files,v retrieving revision 1.581

Re: improving OpenBSD's gmac.c...

2014-10-12 Thread David Gwynne
dont you need endian.h to get bemtoh64 and htobem64? On 13 Oct 2014, at 7:57, Christian Weisgerber wrote: > Here's a cleaned-up diff. Briefly tested on amd64 & sparc64. I'll > do some more testing tomorrow. This already has mikeb@'s blessing. > > Index: regress/sys/crypto/gmac/Makefile > ===

Re: improving OpenBSD's gmac.c...

2014-10-12 Thread Christian Weisgerber
Here's a cleaned-up diff. Briefly tested on amd64 & sparc64. I'll do some more testing tomorrow. This already has mikeb@'s blessing. Index: regress/sys/crypto/gmac/Makefile === RCS file: /cvs/src/regress/sys/crypto/gmac/Makefile,v

Re: improving OpenBSD's gmac.c...

2014-10-09 Thread Damien Miller
On Thu, 9 Oct 2014, Christian Weisgerber wrote: > John-Mark Gurney: > > > I also have an implementation of ghash that does a 4 bit lookup table > > version with the table split between cache lines in p4 at: > > https://p4db.freebsd.org/fileViewer.cgi?FSPC=//depot/projects/opencrypto/sys/opencrypt

Re: improving OpenBSD's gmac.c...

2014-10-09 Thread Chris Cappuccio
Christian Weisgerber [na...@mips.inka.de] wrote: > John-Mark Gurney: > > > I also have an implementation of ghash that does a 4 bit lookup table > > version with the table split between cache lines in p4 at: > > https://p4db.freebsd.org/fileViewer.cgi?FSPC=//depot/projects/opencrypto/sys/opencrypt

Re: improving OpenBSD's gmac.c...

2014-10-09 Thread Christian Weisgerber
John-Mark Gurney: > I also have an implementation of ghash that does a 4 bit lookup table > version with the table split between cache lines in p4 at: > https://p4db.freebsd.org/fileViewer.cgi?FSPC=//depot/projects/opencrypto/sys/opencrypto/gfmult.c&REV=4 > > This also has a version with does 4 b

Re: improving OpenBSD's gmac.c...

2014-10-08 Thread John-Mark Gurney
Mike Belopuhov wrote this message on Wed, Oct 08, 2014 at 14:32 +0200: > On 8 October 2014 00:48, John-Mark Gurney wrote: > > Christian Weisgerber wrote this message on Tue, Oct 07, 2014 at 23:08 +0200: > >> John-Mark Gurney: > >> > >> > So, as I was working on FreeBSD's implementation of gmac.c,

Re: improving OpenBSD's gmac.c...

2014-10-08 Thread Mike Belopuhov
On 8 October 2014 00:48, John-Mark Gurney wrote: > Christian Weisgerber wrote this message on Tue, Oct 07, 2014 at 23:08 +0200: >> John-Mark Gurney: >> >> > So, as I was working on FreeBSD's implementation of gmac.c, I noticed >> > that I was able to get a significant speed up by using a mask inst

Re: improving OpenBSD's gmac.c...

2014-10-07 Thread John-Mark Gurney
Christian Weisgerber wrote this message on Tue, Oct 07, 2014 at 23:08 +0200: > John-Mark Gurney: > > > So, as I was working on FreeBSD's implementation of gmac.c, I noticed > > that I was able to get a significant speed up by using a mask instead > > of an if branch in ghash_gfmul in gmac.c from O

Re: improving OpenBSD's gmac.c...

2014-10-07 Thread Christian Weisgerber
John-Mark Gurney: > So, as I was working on FreeBSD's implementation of gmac.c, I noticed > that I was able to get a significant speed up by using a mask instead > of an if branch in ghash_gfmul in gmac.c from OpenBSD... > > Add a mask var and replace the code between the comments > "update Z" an

improving OpenBSD's gmac.c...

2014-09-30 Thread John-Mark Gurney
So, as I was working on FreeBSD's implementation of gmac.c, I noticed that I was able to get a significant speed up by using a mask instead of an if branch in ghash_gfmul in gmac.c from OpenBSD... Add a mask var and replace the code between the comments "update Z" and "update V" w/: