Extensions
Forms
1 (1 Legacy)
Data
Intel XED v2026.08.23

Forms

Every encoding of XSHA256 that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
REP XSHA256 REP_XSHA256F3 0F A6 D0VIA_PADLOCK_SHA + VIA_PADLOCK_SHA_EN

Operation

What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.

via = cpuid_leaf(0xC0000001, 0)[3]
if via >> 10 & 3 != 3:
    fault(UD)                    # CPUID: no PHE, or it is off
if not cr4 >> 9 & 1:
    fault(UD)                    # no SSE
h = aDI                          # the state: 8 doublewords, 16-
if h & 15:                       # byte aligned, 128 bytes at it
    fault(GP, 0)                 # free for the engine
key_loaded = 0                   # it changes the AES engine's CW
hs = load(h, 256)
n = aCX                          # the message's length in bytes
p = eax                          # bytes hashed so far: 0 at first
if p == 0xFFFFFFFF:              # (Linux, VIA Nano) rCX blocks of
    for i in range(n):           # 64 bytes, no padding
        w = load(aSI + 64 * i, 512)
        hs = sha256_block(hs, w)
    aSI = aSI + 64 * n
    eax = UNDEFINED              # no document says what EAX and
    aCX = UNDEFINED              # rCX hold after
else:
    rest = n - p
    for i in range(rest // 64):  # whole blocks
        w = load(aSI + 64 * i, 512)
        hs = sha256_block(hs, w)
    r = rest % 64                # the last bytes, a 1 bit, zeros,
    t = load(aSI + rest - r, 8 * r)  # and the length in bits,
    t |= 0x80 << 8 * r           # 64 bits big-endian, at the end
    b = 1 if r < 56 else 2       # of 1 or 2 blocks
    for j in range(8):
        x = 8 * n >> 56 - 8 * j & 0xFF
        t |= x << 8 * (64 * b - 8 + j)
    for i in range(b):
        hs = sha256_block(hs, t >> 512 * i)
    aSI = aSI + rest             # rDI and rCX do not change
    eax = n                      # all bytes hashed
store(h, 256, hs)                # the hash, each doubleword in the
                                 # processor's order: byte-swap them
# for SHA-256's digest. The initial state is FIPS 180-4's H(0), in
# memory the same way. After each 64 bytes the engine writes the
# state and EAX, so that an interrupt resumes it

Run on AMD Zen 5 (EPYC 9645): 1 case. It ran where CPUID reported no PadLock PHE, and raised an exception.

Operands

What each form reads and writes, as Intel XED records it: the operands of its syntax, in order, and the implicit ones that the syntax does not name. How to read.
OperandKindAction
REP XSHA256
rAXimplicitread, conditional write
rCXimplicitread, conditional write
m8 at ES:[rSI]implicitwrite
rSIimplicitread, write
m8 at ES:[rDI]implicitread
rDIimplicitread

Flags

None: XED records no flag that the forms test or change.

Attributes

What else XED records about the forms. How to read.

All forms
repeated: count in rCX

CPUID and processors

Each form belongs to an XED ISA set. A form can be used when the processor reports every CPUID bit of one of its ISA set's alternatives.

CPUID requirements and processors of the XED ISA sets above. Alternatives are separated by “or”; processors follow XED’s chip model, whose AMD processors end with Zen 2, and the CPU data of this site for Zen 3 to Zen 6.
ISA setCPUIDProcessors
VIA_PADLOCK_SHA

VIA_PADLOCK_SHA + VIA_PADLOCK_SHA_EN
CPUID.C0000001H:EDX[10] VIA_PADLOCK_SHA
CPUID.C0000001H:EDX[11] VIA_PADLOCK_SHA_EN

None in XED’s model.

More VIA PadLock instructions

Sources

  1. Intel XED v2026.08.23 (commit 0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model.
  2. Linux 7.3: drivers/crypto/padlock-aes.c and padlock-sha.c (VIA PadLock AES and SHA)
  3. Linux 7.3: drivers/char/hw_random/via-rng.c (VIA PadLock random number generator)

The tables are derived from Intel XED, Copyright Intel Corporation, licensed under the Apache License 2.0; x86-64.net converted and reformatted them. The text is our own.