To explain my logic: IMHO the only reason NOT to enforce IsStrictAligned in the entire project would be if it kills performance (which I consider unlikely).
Sent from my iPad > On Jul 14, 2015, at 00:31, Jeffrey Walton <[email protected]> wrote: > > Oh, the irony.... > > Testing MessageDigest algorithm SHA-3-224. > ...... > Program received signal SIGSEGV, Segmentation fault. > 0x004d7235 in CryptoPP::xorbuf ( > buf=0x8004dc0a > "\276Y\255\064^|Lo!$\374զ\203\f\244\347bc\237\311xV4\367H\021\331\304\\\347\276\306(\254jŭ\233\300W\016\062m\274yk\371\375\274\377\241ڿ\276\220wc\360<Q\337/\266\231\267߸\274-\242\272\262i\251H\006\272b\037 > > \376\275\004eMk\261\200\004\210ֆ\362r\031\237\372v\f\256\320r\344\353\320=\212\246\023\365\347X\036\067ָö\220\271\302i\315U&", > mask=0x28adf3 'a' <repeats 200 times>..., count=count@entry=0x46) > at misc.cpp:41 > 41 ((word32*)buf)[i] ^= ((word32*)mask)[i]; > (gdb) > > And its our old friend, this time showing its head on word32: > > (gdb) disass > Dump of assembler code for function CryptoPP::xorbuf(unsigned char*, unsigned > char const*, unsigned int): > 0x004d7120 <+0>: push %ebp > 0x004d7121 <+1>: mov %esp,%ebp > ... > 0x004d721a <+250>: mov 0xc(%esp),%edx > 0x004d721e <+254>: vmovdqu (%eax,%ebx,1),%xmm1 > 0x004d7223 <+259>: vinsertf128 $0x1,0x10(%eax,%ebx,1),%ymm1,%ymm0 > 0x004d722b <+267>: addl $0x1,0x1c(%esp) > 0x004d7230 <+272>: vxorps (%edx,%ebx,1),%ymm0,%ymm0 > => 0x004d7235 <+277>: vmovdqa %ymm0,(%edx,%ebx,1) > 0x004d723a <+282>: mov 0x1c(%esp),%edx > 0x004d723e <+286>: add $0x20,%ebx > ... > > We now have CRYPTOPP_NO_UNALIGNED_DATA_ACCESS. We can enable it (1) project > wide. Or we can band-aide it and (2) enable it for Cygwin; maybe even (3) > enable it for Cygwin i386. > > Or, we can add yet another band-aide, and change the IsAligned<word32> to > IsStrictAligned<word32>. > > How do you guys want to proceed? Any thing other than (1) is a band-aide > that's going to lead to future trouble. > > Jeff > > -- > -- > You received this message because you are subscribed to the "Crypto++ Users" > Google Group. > To unsubscribe, send an email to [email protected]. > More information about Crypto++ and this group is available at > http://www.cryptopp.com. > --- > You received this message because you are subscribed to the Google Groups > "Crypto++ Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com. --- You received this message because you are subscribed to the Google Groups "Crypto++ Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
