floodyberry / chacha-opt

Optimized block functions for the ChaCha stream cipher
47 stars 16 forks source link

Use bic instead of and on arm for clang compatibility #3

Open krovetz opened 9 years ago

krovetz commented 9 years ago

Hello Andrew,

I'm using your chacha implementation for a project and thought I'd report a very small issue.

Because the constants are too big for and, gcc is nice enough to assemble and sp, sp, #0xffffffe0 into the equivalent bic sp, sp, #31 and and sp, sp, #0xffffff80 into the equivalent bic sp, sp, #127. Clang however doesn't. Changing the source to use bic would make the code work on both compilers.

Thanks for the nice implementations!

Ted Krovetz