[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: memxor
From: |
Simon Josefsson |
Subject: |
Re: memxor |
Date: |
Wed, 05 Oct 2005 15:33:15 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
Bruno Haible <address@hidden> writes:
> Simon Josefsson wrote:
>> Ok to install?
>
> Yes. I'd try to help the compilers with not-so-good loop optimizers by
> changing
>
> for (i = 0; i < n; i++)
> d[i] ^= s[i];
>
> into
>
> for (; n > 0; n--)
> *d++ ^= *s++;
>
> but that's a detail. Also the comment in memxor.h should say what
> memxor does and what the return value is.
I made the change, and installed it.
>> I am not sure about the prototype. Should it use 'char*'? 'int*'?
>
> 'void*' is fine, analogous to memset. 'char*' is also acceptable.
> 'int*' implies different alignment requirements and is therefore less general.
What about uint8_t*? If hmac uses uint8_t*, perhaps it should be
aligned. I think we should use 'void*' though, it will cause less
problems and will work just as fine as far as I can tell.
Thanks,
Simon
- memxor, Simon Josefsson, 2005/10/05