sha256sum Illegal instruction on musl amd64

Kang-Che Sung explorer09 at gmail.com
Fri Mar 31 00:29:36 UTC 2023


On Fri, Mar 31, 2023 at 12:34 AM <ben.busybox at backplane.be> wrote:
>
> shaNI = ((ebx >> 28) & 2) - 1; /* bit 29 -> 1 or -1 */
>
> Seems a lot more complicated than intel's approach:
>
> shaNI = ((ebx >> 29) & 1);
>

The `shaNI` variable is not a boolean, but has three possible values:
0 (undetermined), 1 (SHA instructions supported), -1 (not supported)
That's why the slightly complicated logic.

By the way, the `shaNI` name is a misnomer, as Intel never uses "NI"
to refer to their SHA instruction set, unlike the AES instruction set.


More information about the busybox mailing list