aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/aes192.asm54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/aes192.asm b/src/aes192.asm
index f3a56a8..6851ae1 100644
--- a/src/aes192.asm
+++ b/src/aes192.asm
@@ -99,30 +99,44 @@
; * xmm0[63:32] == w[1],
; * xmm0[31:0] == w[0].
- movdqa [ecx], xmm0 ; sets w[0], w[1], w[2], w[3]
- movdqa [ecx + 10h], xmm1 ; sets w[4], w[5]
- add ecx, 18h ; ecx = &w[6]
+ movdqa [ecx], xmm0 ; sets w[0], w[1], w[2], w[3]
+ movq qword ptr [ecx + 10h], xmm1 ; sets w[4], w[5]
aeskeygenassist xmm7, xmm1, 1 ; xmm7[63:32] = RotWord(SubWord(w[5]))^Rcon,
- call gen_round_key ; sets w[6], w[7], w[8], w[9], w[10], w[11]
+ call aes192_keygen_assist
+ movdqu [ecx + 18h], xmm0
+ movq qword ptr [ecx + 28h], xmm1
aeskeygenassist xmm7, xmm1, 2 ; xmm7[63:32] = RotWord(SubWord(w[11]))^Rcon
- call gen_round_key ; sets w[12], w[13], w[14], w[15], w[16], w[17]
+ call aes192_keygen_assist
+ movdqa [ecx + 30h], xmm0
+ movq qword ptr [ecx + 40h], xmm1
aeskeygenassist xmm7, xmm1, 4 ; xmm7[63:32] = RotWord(SubWord(w[17]))^Rcon
- call gen_round_key ; sets w[18], w[19], w[20], w[21], w[22], w[23]
+ call aes192_keygen_assist
+ movdqu [ecx + 48h], xmm0
+ movq qword ptr [ecx + 58h], xmm1
aeskeygenassist xmm7, xmm1, 8 ; xmm7[63:32] = RotWord(SubWord(w[23]))^Rcon
- call gen_round_key ; sets w[24], w[25], w[26], w[27], w[28], w[29]
+ call aes192_keygen_assist
+ movdqa [ecx + 60h], xmm0
+ movq qword ptr [ecx + 70h], xmm1
aeskeygenassist xmm7, xmm1, 10h ; xmm7[63:32] = RotWord(SubWord(w[29]))^Rcon
- call gen_round_key ; sets w[30], w[31], w[32], w[33], w[34], w[35]
+ call aes192_keygen_assist
+ movdqu [ecx + 78h], xmm0
+ movq qword ptr [ecx + 88h], xmm1
aeskeygenassist xmm7, xmm1, 20h ; xmm7[63:32] = RotWord(SubWord(w[35]))^Rcon
- call gen_round_key ; sets w[36], w[37], w[38], w[39], w[40], w[41]
+ call aes192_keygen_assist
+ movdqa [ecx + 90h], xmm0
+ movq qword ptr [ecx + 0a0h], xmm1
aeskeygenassist xmm7, xmm1, 40h ; xmm7[63:32] = RotWord(SubWord(w[41]))^Rcon
- call gen_round_key ; sets w[42], w[43], w[44], w[45], w[46], w[47]
+ call aes192_keygen_assist
+ movdqu [ecx + 0a8h], xmm0
+ movq qword ptr [ecx + 0b8h], xmm1
aeskeygenassist xmm7, xmm1, 80h ; xmm7[63:32] = RotWord(SubWord(w[49]))^Rcon
- call gen_round_key ; sets w[48], w[49], w[50], w[51], w[52], w[53]
+ call aes192_keygen_assist
+ movdqa [ecx + 0c0h], xmm0
ret
-gen_round_key:
+aes192_keygen_assist:
; Preconditions:
; * xmm1[127:96] == 0,
; * xmm1[95:64] == 0,
@@ -132,8 +146,7 @@ gen_round_key:
; * xmm0[95:64] == w[i+2],
; * xmm0[63:32] == w[i+1],
; * xmm0[31:0] == w[i],
- ; * xmm7[63:32] == RotWord(SubWord(w[i+5]))^Rcon,
- ; * ecx == &w[i+6].
+ ; * xmm7[63:32] == RotWord(SubWord(w[i+5]))^Rcon.
;
; Postconditions:
; * xmm1[127:96] == 0,
@@ -144,7 +157,6 @@ gen_round_key:
; * xmm0[95:64] == w[i+8] == RotWord(SubWord(w[i+5]))^Rcon^w[i+2]^w[i+1]^w[i],
; * xmm0[63:32] == w[i+7] == RotWord(SubWord(w[i+5]))^Rcon^w[i+1]^w[i],
; * xmm0[31:0] == w[i+6] == RotWord(SubWord(w[i+5]))^Rcon^w[i],
- ; * ecx == &w[i+12],
; * the value in xmm6 is also modified.
; Calculate
@@ -176,13 +188,6 @@ gen_round_key:
; xmm0[63:32] == w[i+7] == RotWord(SubWord(w[i+5]))^Rcon^w[i+1]^w[i]
; xmm0[31:0] == w[i+6] == RotWord(SubWord(w[i+5]))^Rcon^w[i]
- ; Set w[i+6], w[i+7], w[i+8] and w[i+9].
- movdqu [ecx], xmm0 ; w[i+6] = RotWord(SubWord(w[i+5]))^Rcon^w[i]
- ; w[i+7] = RotWord(SubWord(w[i+5]))^Rcon^w[i+1]^w[i]
- ; w[i+8] = RotWord(SubWord(w[i+5]))^Rcon^w[i+2]^w[i+1]^w[i]
- ; w[i+9] = RotWord(SubWord(w[i+5]))^Rcon^w[i+3]^w[i+2]^w[i+1]^w[i]
- add ecx, 10h ; ecx = &w[i+10]
-
; Calculate
; w[i+5]^w[i+4],
; w[i+4].
@@ -200,11 +205,6 @@ gen_round_key:
; xmm1[63:32] == w[i+11] == RotWord(SubWord(w[i+5]))^Rcon^w[i+5]^w[i+4]^w[i+3]^w[i+2]^w[i+1]^w[i]
; xmm1[31:0] == w[i+10] == RotWord(SubWord(w[i+5]))^Rcon^w[i+4]^w[i+3]^w[i+2]^w[i+1]^w[i]
- ; Set w[i+10] and w[i+11].
- movq qword ptr [ecx], xmm1 ; w[i+10] = RotWord(SubWord(w[i+5]))^Rcon^w[i+4]^w[i+3]^w[i+2]^w[i+1]^w[i]
- ; w[i+11] = RotWord(SubWord(w[i+5]))^Rcon^w[i+5]^w[i+4]^w[i+3]^w[i+2]^w[i+1]^w[i]
- add ecx, 8 ; ecx = &w[i+12]
-
ret
@raw_aes192_expand_key_schedule@36 endp