AES-256 ARM Hardware Instruction Usage In C!

I wanted to eventually experiment with using the AES hardware instruction but for the ARM architecture because there are ways to turn block ciphers into stream ciphers for future usage. There appears to be a C header include file that exists on both Mac and Ubuntu (arm_neon.h) and you can compile this small C program file with standard gcc options (no special arguments needed). The hardware instruction method names appear very cryptic, however, they do seem to work when I tested the hex output against other sites!

K: [00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ]
R: [00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 62 63 63 63 62 63 63 63 62 63 63 63 62 63 63 63 aa fb fb fb aa fb fb fb aa fb fb fb aa fb fb fb 6f 6c 6c cf 0d 0f 0f ac 6f 6c 6c cf 0d 0f 0f ac 7d 8d 8d 6a d7 76 76 91 7d 8d 8d 6a d7 76 76 91 53 54 ed c1 5e 5b e2 6d 31 37 8e a2 3c 38 81 0e 96 8a 81 c1 41 fc f7 50 3c 71 7a 3a eb 07 0c ab 9e aa 8f 28 c0 f1 6d 45 f1 c6 e3 e7 cd fe 62 e9 2b 31 2b df 6a cd dc 8f 56 bc a6 b5 bd bb aa 1e 64 06 fd 52 a4 f7 90 17 55 31 73 f0 98 cf 11 19 6d bb a9 0b 07 76 75 84 51 ca d3 31 ec 71 79 2f e7 b0 e8 9c 43 47 78 8b 16 76 0b 7b 8e b9 1a 62 74 ed 0b a1 73 9b 7e 25 22 51 ad 14 ce 20 d4 3b 10 f8 0a 17 53 bf 72 9c 45 c9 79 e7 cb 70 63 85 ]
I: [00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ]
O: [dc 95 c0 78 a2 40 89 89 ad 48 a2 14 92 84 20 87 ]
I: [dc 95 c0 78 a2 40 89 89 ad 48 a2 14 92 84 20 87 ]
O: [00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ]

~

Source Code: github.com/stoops/aes/blob/main/aes.c

~

Leave a comment