Re: [bug-gnulib] crc

2005-10-07 Thread Bruno Haible
Simon Josefsson wrote: > Ok to install? > +/* Compute CRC-32 value of LEN bytes long BUF, and return it. */ > +extern unsigned long crc32 (char *buf, size_t len); > ... All 4 functions don't write into buf, therefore the 'buf' argument type should be 'const char *', not 'char *'. > + Due to hi

Re: generic crypto

2005-10-07 Thread Paul Eggert
Thanks for explaining all that. > Is it ok to install the GC module as-is meanwhile? It's fine with me. One (hopefully easy) suggestion: perhaps your explanation could go into the source code somewhere, in a TODO area? ___ bug-gnulib mailing list bug

Re: gettimeofday() for Win32

2005-10-07 Thread Paul Eggert
Thanks for bird-dogging this. On further review I have some comments and suggestions. The gettimeofday replacement should use the standard POSIX signature, which uses 'restrict'. See . > +#ifdef _WIN32 > +#include > +#e

Relicensing mempcpy, strchrnul, sysexists to LGPL

2005-10-07 Thread Simon Law
Hello, I'm the maintainer for WvStreams, an LGPLed C++ networking library. I'd like to include gnulib's argp implementation, for portability reasons, but it depends on GPLed implementations of mempcpy, strchrnul, and sysexits. Looking at those files, they must have some less restrictive implemen

Re: crc

2005-10-07 Thread Paul Eggert
Simon Josefsson <[EMAIL PROTECTED]> writes: > I'm not sure whether the extract from RFC 1952 (a two line function) > warrant the big copyright comment, or whether borrowing that code is > OK. No, it's OK to borrow two lines of code. However it would be polite to have a one- or two-line comment g

Re: crc

2005-10-07 Thread Simon Josefsson
Ralf Wildenhues <[EMAIL PROTECTED]> writes: >> +/* Table of CRCs of all 8-bit messages. Generated by running code >> + from RFC 1952 modified to print out the table. */ >> +static unsigned long crc32_table[256] = { > > Please make this `const'. Incorporated! Many thanks for reviewing it, Simo

Re: hmac-md5

2005-10-07 Thread Bruno Haible
Simon Josefsson wrote: > > Yes, I try to avoid 'unsigned char *' for that reason'. ... > > Then perhaps hmac-md5 should use 'char*'. The big downsides of 'char *' are: - It is not closer to the meaning of the data than 'void *'. The hmac-md5 module considers all bytes as unsigned values. G

hmac-sha1

2005-10-07 Thread Simon Josefsson
What do you think? This is very similar to the hmac-md5 module. The reason the modules are separate is that I don't want to force hmac-sha1 users to have a hmac-md5 and md5 implementation around. Alas, the sha1 module depend on md5 for 'md5_uint32'. Couldn't we fix it to use 'stdint' instead? D

Re: crc

2005-10-07 Thread Ralf Wildenhues
Hi Simon, * Simon Josefsson wrote on Fri, Oct 07, 2005 at 02:17:19PM CEST: > Ok to install? Tiny nit.. ;) *snip* > +/* Table of CRCs of all 8-bit messages. Generated by running code > + from RFC 1952 modified to print out the table. */ > +static unsigned long crc32_table[256] = { Please make

crc

2005-10-07 Thread Simon Josefsson
Ok to install? I'm not sure whether the extract from RFC 1952 (a two line function) warrant the big copyright comment, or whether borrowing that code is OK. The CRC-32 code in gzip is GPL, I couldn't find any LGPL CRC32 owned by the FSF already. What do you think? Thanks. Index: modules/crc ==

Re: sysexits.h: Define EX_OK

2005-10-07 Thread Martin Lambers
Since the future of the exit module is still unclear (at least to me), and sysexits.h still does not define EX_OK, I'd like to bring this issue up again. I would prefer to define EX_OK to 0 for the following reasons: 1. Simplicity 2. This value is explicitly mentioned in the sysexits man page ("Th

Re: regex-0.12's regex.h seems to have a little bug

2005-10-07 Thread Simon Josefsson
I forgot about this discussion for a while... Stepan Kasal <[EMAIL PROTECTED]> writes: > Hello, > > On Thu, Sep 22, 2005 at 12:36:46PM +0200, Simon Josefsson wrote: >> Stepan Kasal <[EMAIL PROTECTED]> writes: >> > Later on, when it was realized that a fix is needed, it was decided to wait >> > fo

Re: gettimeofday() for Win32

2005-10-07 Thread Martin Lambers
On Fri, 02. Sep 2005, 12:11:37 -0700, Paul Eggert wrote: > You don't need to check whether tp is NULL. Gettimeofday can assume > its first arg is NULL. > > Assuming we can resolve the copyright issues it otherwise looks good to me. > (Though I can't comment on the Microsoft Windows stuff.) The p

Re: hmac-md5

2005-10-07 Thread Simon Josefsson
Paul Eggert <[EMAIL PROTECTED]> writes: > Simon Josefsson <[EMAIL PROTECTED]> writes: > >> Is there a portability requirement that 'char foo = 0xAA' end >> up with 10101010 in the memory buffer (void*)&foo? > > No for C, but yes for POSIX. > > The main problem with char * is that, in principle, an

Re: generic crypto

2005-10-07 Thread Simon Josefsson
Paul Eggert <[EMAIL PROTECTED]> writes: > Simon Josefsson <[EMAIL PROTECTED]> writes: > >> * Perhaps the /dev/*random reading should be separated into a separate >> module? It might be useful outside of the gc layer too. > > Absolutely. I've been meaning to do that for months (for a "shuffle"

Re: memxor

2005-10-07 Thread Simon Josefsson
Paul Eggert <[EMAIL PROTECTED]> writes: > Simon Josefsson <[EMAIL PROTECTED]> writes: > >> The module depend on restrict, but the AC_REQUIRE in m4 wasn't >> present. I added it. But is it necessary? Shouldn't depending on >> the restrict module be sufficient? > > No, sorry, I missed the fact th