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
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
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