Jim Meyering <[EMAIL PROTECTED]> writes:
> verify (offsetof (struct S, member_m) % 4 == 0);
>
> Hmm... that assumes 8-bit bytes.
And it also assumes no holes in integer representations.
This is more portable:
verify (offsetof (struct S, member_m) % alignof (uint32_t) == 0);
where alignof is
Jim Meyering <[EMAIL PROTECTED]> writes:
> Putting a compile-time assertion like the following,
> right after the struct definition, adds some clout :-)
>
> verify (offsetof (struct S, member_m) % 4 == 0);
>
> Hmm... that assumes 8-bit bytes.
You could multiply by CHAR_BIT and check for a multi
Bruno Haible <[EMAIL PROTECTED]> wrote:
> Simon Josefsson wrote:
>> > you don't need it,
>> > because the rules for struct layout in C guarantee that a structure field
>> > is aligned to a multiple of the alignment of the previous field.
>>
>> Are you saying that even if we don't change the type o
Simon Josefsson wrote:
> > you don't need it,
> > because the rules for struct layout in C guarantee that a structure field
> > is aligned to a multiple of the alignment of the previous field.
>
> Are you saying that even if we don't change the type of buffer to
> char, we don't need that alignment
Ralf Wildenhues <[EMAIL PROTECTED]> writes:
> Hi Simon,
>> +#define arctwo_setkey(context,keylen,key) \
>> + arctwo_setkey_ekb (context, keylen, key, 8 * keylen)
>
> Ouch. `8 * (keylen)' would be safer.
Thanks, Ralf. I have installed this.
___
bug-
Hi Simon,
* Simon Josefsson wrote on Fri, Oct 21, 2005 at 02:02:58PM CEST:
> I have installed this.
A quick glance showed up the nit below.
Cheers,
Ralf
*snip*
> Index: lib/arctwo.h
> ===
> RCS file: lib/arctwo.h
> diff -N lib/arct
I have installed the patch below. It seems the example Rijndael
implementation didn't implement CBC mode correctly...
--- rijndael-api-fst.c 14 Oct 2005 15:33:22 +0200 1.1
+++ rijndael-api-fst.c 19 Oct 2005 16:08:10 +0200
@@ -244,7 +244,7 @@
((uint32_t *) block)[3] = ((uint
Bruno Haible <[EMAIL PROTECTED]> writes:
> Hi Simon,
>
> Here are a few random remarks regarding the new code. It's a bit terse, but
> I hope you can decipher the meaning.
Hi! Many thanks. I have been pushing gc into gnulib rather rapidly
because we want to release GnuTLS 1.2.9 with that stuff
I have installed this.
Index: ChangeLog
===
RCS file: /cvsroot/gnulib/gnulib/ChangeLog,v
retrieving revision 1.433
diff -u -p -r1.433 ChangeLog
--- ChangeLog 21 Oct 2005 12:03:17 - 1.433
+++ ChangeLog 21 Oct 2005 12:27:10
Hi Simon,
Here are a few random remarks regarding the new code. It's a bit terse, but
I hope you can decipher the meaning.
1) crc.h
#if HAVE_INTTYPES_H
# include
#endif
#if HAVE_STDINT_H
# include
#endif
Correct this to
#include
because
- On old platforms with neither nor , these
includ
I have installed this.
Index: ChangeLog
===
RCS file: /cvsroot/gnulib/gnulib/ChangeLog,v
retrieving revision 1.432
diff -u -p -r1.432 ChangeLog
--- ChangeLog 19 Oct 2005 15:40:26 - 1.432
+++ ChangeLog 21 Oct 2005 12:02:14
I have installed this; ECB modes didn't work for libgcrypt through gc.
2005-10-21 Simon Josefsson <[EMAIL PROTECTED]>
* gc-libgcrypt.c (gc_cipher_open): Handle ECB.
Index: gc-libgcrypt.c
===
RCS file: /cvsroot/gnulib/gnuli
12 matches
Mail list logo