Paul Eggert <[EMAIL PROTECTED]> writes:

> Simon Josefsson <[EMAIL PROTECTED]> writes:
>
>> Has anyone used md5_buffer from the md5 module on a platform with char
>> that is larger than 1 byte?
>
> Do you mean a host where UCHAR_MAX > 255?  I doubt whether anyone has
> done that.  POSIX requires that UCHAR_MAX == 255.  A small fraction of
> GNU code is portable to hosts where UCHAR_MAX > 255, but usually this
> is more for the amusement of the author than anything else.
>
> If you meant sizeof (char) > 1, then I really doubt whether anyone has
> done that.  C has required that sizeof (char) == 1 for ages.

Ok, then perhaps 'char*' is better than 'void*' for hmac-md5.  When I
think more about it, also the encoding of the bytes inside 'char*'
matter.  Is there a portability requirement that 'char foo = 0xAA' end
up with 10101010 in the memory buffer (void*)&foo?  I think we need
that assumption since the md5 module uses 'void*'.

I'm not sure about 'unsigned char*'.  Using 'unsigned char*' usually
lead to plenty of signed/unsigned warnings sooner or later.  If we
make the code work regardless of whether 'char'=='unsigned char' or
'char'=='signed char', do we really have to specify 'unsigned char*'
in the API?  Perhaps 'char*' leads to less problems.

I never realize how little I know until I start to do things..

Thanks,
Simon


_______________________________________________
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib

Reply via email to