Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Most of a failed code modification to cpuminer-multi
- ; Maybe LucasJones knows what went wrong?
- format ELF64
- public CPUSupportsOptimizations
- public fast_aesb_pseudo_round_mut
- ; Returns nonzero if AES instruction set is supported
- ; void CPUSupportsOptimizations(void)
- CPUSupportsOptimizations:
- mov eax, 1
- cpuid
- and ecx, 0xFFFFFFDF
- mov eax, ecx
- ret
- ; void fast_aesb_pseudo_round_mut(val, expandedKey)
- fast_aesb_pseudo_round_mut:
- xor r9, r9 ; Clear this so it can be used as a counter
- mov r10, 9 ; Number of rounds minus one
- movdqu xmm1, [rdi] ; Move state into XMM1
- pxor xmm1, [rsi] ; Key whitening step
- add rdx, 0x10 ; Advance expanded key
- .AESRoundLoop:
- aesenc xmm1, [rsi]
- add rdx, 0x10 ; Advance expanded key pointer
- inc r9 ; Increment round counter
- cmp r9, r10 ; Did we do all the rounds except one?
- jl .AESRoundLoop ; If not, loop some more
- aesenclast xmm1, [rsi] ; Do last AES round (without MixColumns)
- ; Move the result back into the buffer the state
- ; came in and get outta here.
- movdqu [rsi], xmm1
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement