4 ms·
OP is treating XOR as though it were not commutative between registers and memory: > Consequently, there are actually two ways to encode xor eax, eax: ; r
by mikorym 6y ago
OP is treating XOR as though it were not commutative between registers and memory:
> Consequently, there are actually two ways to encode xor eax, eax:
; r/m32, r
31 C0
; r, r/m32
33 C0
So, what I am saying is that write(memory,register) != write(register,memory) in the byte code, meaning that writing the XOR itself is a noncommutative operation. The machine running the code does however treat both option ultimately to get the same result.
The XOR algorithm remains unchanged and remains commutative. The execution routine of the XOR is noncommutative.
So, there are two operations here: XOR and executeXOR and OPs article is about using the machine level noncommutativity in the form of different byte strings for executeXOR. The machine still thinks that is is commutative for the end result of the calculation/routine.
My comment about cypher XOR plaintext = cyphertext is just a general comment about XOR.
- woodruffw 6y agoI think you might have misunderstood the modr/m encoding: steg86 never touches memory-register or register-memory operations, only register-register ones. Nothing about this either requires or implies commutativity.
- mikorym 6y agoAlright, but the principle still holds: You have some action act(x,y). The encoding in the bitstream can either differ for act(x,y) or act(y,x) or it is the same. The original article states that the effect of act(x,y) and act(y,x) is the same. But the bitstream may differ. So it is commutative in the operations of the computer, but not in the bitstream instruction.