github.com/deroproject/derosuite@v2.1.6-1.0.20200307070847-0f2e589c7a2b+incompatible/cryptonight/aes_amd64.s (about) 1 #include "textflag.h" 2 3 // single round AES encryption 4 // func encryptAESRound( xk *uint32, dst, src *uint32) 5 TEXT ·encryptAESRound(SB),NOSPLIT,$0 6 MOVQ xk+0(FP), AX 7 MOVQ dst+8(FP), DX 8 MOVQ src+16(FP), BX 9 MOVUPS 0(AX), X1 10 MOVUPS 0(BX), X0 11 AESENC X1, X0 12 MOVUPS X0, 0(DX) 13 RET 14 15 // func encrypt10AESRound( xk *uint32, dst, src *uint32) 16 TEXT ·encrypt10AESRound(SB),NOSPLIT,$0 17 MOVQ xk+0(FP), AX 18 MOVQ dst+8(FP), DX 19 MOVQ src+16(FP), BX 20 MOVUPS 0(AX), X1 21 MOVUPS 0(BX), X0 22 AESENC X1, X0 23 MOVUPS 16(AX), X1 24 AESENC X1, X0 25 MOVUPS 32(AX), X1 26 AESENC X1, X0 27 MOVUPS 48(AX), X1 28 AESENC X1, X0 29 MOVUPS 64(AX), X1 30 AESENC X1, X0 31 MOVUPS 80(AX), X1 32 AESENC X1, X0 33 MOVUPS 96(AX), X1 34 AESENC X1, X0 35 MOVUPS 112(AX), X1 36 AESENC X1, X0 37 MOVUPS 128(AX), X1 38 AESENC X1, X0 39 MOVUPS 144(AX), X1 40 AESENC X1, X0 41 42 MOVUPS X0, 0(DX) 43 RET 44 45 // 128 bit = 64 bit * 64 bit 46 // func mul6464128( input *uint64) 47 TEXT ·mul6464128(SB),NOSPLIT,$0 48 MOVQ input+0(FP), BX 49 MOVQ 0(BX), AX 50 MOVQ 8(BX), DX 51 52 // MUL RDX and place result, RDX/RAX 53 BYTE $0x48 54 BYTE $0xF7 55 BYTE $0xE2 56 57 MOVQ DX,0(BX) 58 MOVQ AX,8(BX) 59 RET 60 61