Re: small changes in aesxcbcmac.c

2016-09-26 Thread Alexander Nasonov
Alexander Nasonov wrote: > If there are no objections I'll commit the code. Ah, Christos committed it already. Less work for me then :) -- Alex

Re: small changes in aesxcbcmac.c

2016-09-26 Thread Alexander Nasonov
Alexander Nasonov wrote: > The first change shrinks aes_xcbc_mac_init by 183 bytes on amd64 > (from 562 to 379 bytes). > The second change avoids a comparison with an address that may > point beyond the end of a buffer. > The third change is stylistic. > Alex If there are no objections I'll commit

Re: small changes in aesxcbcmac.c

2016-09-26 Thread Joerg Sonnenberger
On Sun, Sep 25, 2016 at 10:39:17PM +, Eric Haszlakiewicz wrote: > On September 25, 2016 5:01:16 PM EDT, Alexander Nasonov > wrote: > >The first change shrinks aes_xcbc_mac_init by 183 bytes on amd64 > >(from 562 to 379 bytes). > > Do you mean it shrinks its stack usage? Or does that change

Re: small changes in aesxcbcmac.c

2016-09-25 Thread Alexander Nasonov
Rhialto wrote: > On Sun 25 Sep 2016 at 22:01:16 +0100, Alexander Nasonov wrote: > > - while (addr + AES_BLOCKSIZE < ep) { > > + while (ep - addr > AES_BLOCKSIZE) { > > I think that if ep points beyond tbe buffer (apart from the > just-past-the-end location), the subtraction is just as undefine

Re: small changes in aesxcbcmac.c

2016-09-25 Thread Alexander Nasonov
Eric Haszlakiewicz wrote: > On September 25, 2016 5:01:16 PM EDT, Alexander Nasonov > wrote: > >The first change shrinks aes_xcbc_mac_init by 183 bytes on amd64 > >(from 562 to 379 bytes). > > Do you mean it shrinks its stack usage? Or does that change to static const > vars somehow shrink the

Re: small changes in aesxcbcmac.c

2016-09-25 Thread Eric Haszlakiewicz
On September 25, 2016 5:01:16 PM EDT, Alexander Nasonov wrote: >The first change shrinks aes_xcbc_mac_init by 183 bytes on amd64 >(from 562 to 379 bytes). Do you mean it shrinks its stack usage? Or does that change to static const vars somehow shrink the function itself? Eric

Re: small changes in aesxcbcmac.c

2016-09-25 Thread Rhialto
On Sun 25 Sep 2016 at 22:01:16 +0100, Alexander Nasonov wrote: > - while (addr + AES_BLOCKSIZE < ep) { > + while (ep - addr > AES_BLOCKSIZE) { I think that if ep points beyond tbe buffer (apart from the just-past-the-end location), the subtraction is just as undefined behaviour as before..

small changes in aesxcbcmac.c

2016-09-25 Thread Alexander Nasonov
The first change shrinks aes_xcbc_mac_init by 183 bytes on amd64 (from 562 to 379 bytes). The second change avoids a comparison with an address that may point beyond the end of a buffer. The third change is stylistic. Alex --- sys/opencrypto/aesxcbcmac.c.orig2016-09-25 21:44:25.344941650 +0100