From simon at josefsson.org Mon Aug 5 09:09:21 2024 From: simon at josefsson.org (Simon Josefsson) Date: Mon, 05 Aug 2024 09:09:21 +0200 Subject: Classic McEliece on arch which doesn't like unaligned access In-Reply-To: <87wmo5pc7m.fsf@kaka.sjd.se> (Simon Josefsson via Gcrypt-devel's message of "Tue, 07 May 2024 23:02:37 +0200") References: <87jzk69xrd.fsf@akagi.fsij.org> <87wmo5pc7m.fsf@kaka.sjd.se> Message-ID: <878qxbo38e.fsf@kaka.sjd.se> Hi. As a first step towards fixing this, please find attached patch to add a script that re-generate mceliece6688128f.c from upstream libmceliece. This should have been part of the first patch, but I cheated and manually modified the generated code to fix some issues. For that reason, this patch modify mceliece6688128f.c too. All of those changes should be no-ops and are to make the mceliece6688128f.sh script simpler. After applying this patch, you can reproduce the generated code: $ cd ~/src/libgcrypt/cipher $ wget -nv https://lib.mceliece.org/libmceliece-20230612.tar.gz $ tar xfa libmceliece-20230612.tar.gz $ ./mceliece6688128f.sh . > mceliece6688128f.c $ git diff Syncing the code with latest libmceliece was a bit more complicated than I thought so I think the right approach is to first get this patch in and later finish updating to latest libmceliece 20240726. That should fix the alignment issue and some other problems. The patch in this e-mail should go in first though, to have a good way to reproduce the existing code for auditing. What do you think? /Simon -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-cipher-Add-script-to-re-generate-mceliece6688128f.c.patch Type: text/x-diff Size: 18180 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 255 bytes Desc: not available URL: