Thread (70 messages) flat view 70 messages, 11 authors, 2016-12-18

Re: [PATCH v2 3/4] secure_seq: use siphash24 instead of md5_transform

From: Hannes Frederic Sowa <hidden>
Date: 2016-12-14 19:22:11
Also in: linux-crypto, lkml

On 14.12.2016 19:06, Jason A. Donenfeld wrote:
Hi David,

On Wed, Dec 14, 2016 at 6:56 PM, David Miller [off-list ref] wrote:
quoted
Just marking the structure __packed, whether necessary or not, makes
the compiler assume that the members are not aligned and causes
byte-by-byte accesses to be performed for words.
Never, _ever_, use __packed unless absolutely necessary, it pessimizes
the code on cpus that require proper alignment of types.
Oh, jimminy cricket, I did not realize that it made assignments
byte-by-byte *always*. So what options am I left with? What
immediately comes to mind are:

1)

struct {
    u64 a;
    u32 b;
    u32 c;
    u16 d;
    u8 end[];
I don't think this helps. Did you test it? I don't see reason why
padding could be left out between `d' and `end' because of the flexible
array member?

Bye,
Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help