[Cryptography] Exotic Operations in Primitive Construction

Dan McDonald danmcd at kebe.com
Sat Oct 10 00:20:00 EDT 2020

I tried it, and I think you've some bugs.  Starting with an extra close-paren on each expression.  Losing those made it compile.

Now granted, your choice of parentheses generally was good, but your constant expressions were to me unreadable.

I've attached a program which contains a test harness, the original function (with one close paren moved from each operation), and an IMHO more readable version of the original.  It compiles well on MacOS, and on illumos (OmniOSce), and probably will work with Linux or *BSD just fine as well.  Correcting the buggy code is an exercise left to the reader, however.

Sample output showing it's incorrect:

nowhere(/tmp)[0]% ./r32-32 0x2112
Original(0x2112) = 0x40800000
Readable(0x2112) = 0x40800000

I believe the reverse32 of 0x2112 is 0x48840000.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: reverse32.c
Type: application/octet-stream
Size: 2089 bytes
Desc: not available
URL: <https://www.metzdowd.com/pipermail/cryptography/attachments/20201010/f8377647/attachment.obj>

More information about the cryptography mailing list