0

I'm try yo use SHA256 Intel instructions.

_start:
mov     eax,0x01
CPUID  
test    edx, 1<<25
jz      _quit
smsw    eax
movaps  xmm1, [d1]
movaps  xmm2, [d2]
SHA256msg1 xmm1,xmm2

Wen prg fetch sha256 instruction returns the error: received signal SIGILL, Illegal instruction.

  • OS is Ubuntu 22.04.1LTS
  • iMac Late '11 (27")
  • Intel i5-2500s (4core)
  • NASM 2.15.05

There are possibility to run it not in protected mode? Is that problem caused by running in protected mode or somethings else?

Grazie!

New in programming so please be tolerant

  • You have to run them on a CPU that supports them. Like Goldmont from 2016, Ryzen (2017), or for mainstream Intel, Ice Lake. Definitely not a decade-old Intel mainstream CPU! Linux `/proc/cpuinfo` will confirm the absences of any `sha` anything. Not sure which feature bit you're checking with that CPUID call, but apparently not the right one. The linked duplicate question has further links to Intel docs, including which feature flag bit to check, `CPUID.(EAX=07H, ECX=0):EBX.SHA [bit 29]` – Peter Cordes Nov 26 '22 at 19:17
  • 1
    Thanks helping me on this issue. Now testing EBX.SHA [bit 29] the flow jump to _quit. – Ivan Fassoli Nov 26 '22 at 19:42

0 Answers0