1 1.6 christos #ifndef __ASSEMBLER__ 2 1.6 christos # define __ASSEMBLER__ 1 3 1.6 christos #endif 4 1.6 christos #include "crypto/sparc_arch.h" 5 1.4 martin 6 1.4 martin #ifdef __arch64__ 7 1.4 martin .register %g2,#scratch 8 1.4 martin .register %g3,#scratch 9 1.4 martin #endif 10 1.4 martin 11 1.1 spz .text 12 1.1 spz 13 1.1 spz .globl aes_t4_encrypt 14 1.1 spz .align 32 15 1.1 spz aes_t4_encrypt: 16 1.1 spz andcc %o0, 7, %g1 ! is input aligned? 17 1.1 spz andn %o0, 7, %o0 18 1.1 spz 19 1.1 spz ldx [%o2 + 0], %g4 20 1.1 spz ldx [%o2 + 8], %g5 21 1.1 spz 22 1.1 spz ldx [%o0 + 0], %o4 23 1.1 spz bz,pt %icc, 1f 24 1.1 spz ldx [%o0 + 8], %o5 25 1.1 spz ldx [%o0 + 16], %o0 26 1.1 spz sll %g1, 3, %g1 27 1.1 spz sub %g0, %g1, %o3 28 1.1 spz sllx %o4, %g1, %o4 29 1.1 spz sllx %o5, %g1, %g1 30 1.1 spz srlx %o5, %o3, %o5 31 1.1 spz srlx %o0, %o3, %o3 32 1.1 spz or %o5, %o4, %o4 33 1.1 spz or %o3, %g1, %o5 34 1.1 spz 1: 35 1.1 spz ld [%o2 + 240], %o3 36 1.1 spz ldd [%o2 + 16], %f12 37 1.1 spz ldd [%o2 + 24], %f14 38 1.1 spz xor %g4, %o4, %o4 39 1.1 spz xor %g5, %o5, %o5 40 1.1 spz .word 0x81b0230c !movxtod %o4,%f0 41 1.1 spz .word 0x85b0230d !movxtod %o5,%f2 42 1.1 spz srl %o3, 1, %o3 43 1.1 spz ldd [%o2 + 32], %f16 44 1.1 spz sub %o3, 1, %o3 45 1.1 spz ldd [%o2 + 40], %f18 46 1.1 spz add %o2, 48, %o2 47 1.1 spz 48 1.1 spz .Lenc: 49 1.1 spz .word 0x88cb0400 !aes_eround01 %f12,%f0,%f2,%f4 50 1.1 spz .word 0x84cb8420 !aes_eround23 %f14,%f0,%f2,%f2 51 1.1 spz ldd [%o2 + 0], %f12 52 1.1 spz ldd [%o2 + 8], %f14 53 1.1 spz sub %o3,1,%o3 54 1.1 spz .word 0x80cc0404 !aes_eround01 %f16,%f4,%f2,%f0 55 1.1 spz .word 0x84cc8424 !aes_eround23 %f18,%f4,%f2,%f2 56 1.1 spz ldd [%o2 + 16], %f16 57 1.1 spz ldd [%o2 + 24], %f18 58 1.1 spz brnz,pt %o3, .Lenc 59 1.1 spz add %o2, 32, %o2 60 1.1 spz 61 1.1 spz andcc %o1, 7, %o4 ! is output aligned? 62 1.1 spz .word 0x88cb0400 !aes_eround01 %f12,%f0,%f2,%f4 63 1.1 spz .word 0x84cb8420 !aes_eround23 %f14,%f0,%f2,%f2 64 1.1 spz .word 0x80cc0484 !aes_eround01_l %f16,%f4,%f2,%f0 65 1.1 spz .word 0x84cc84a4 !aes_eround23_l %f18,%f4,%f2,%f2 66 1.1 spz 67 1.1 spz bnz,pn %icc, 2f 68 1.1 spz nop 69 1.1 spz 70 1.1 spz std %f0, [%o1 + 0] 71 1.1 spz retl 72 1.1 spz std %f2, [%o1 + 8] 73 1.1 spz 74 1.1 spz 2: .word 0x93b24340 !alignaddrl %o1,%g0,%o1 75 1.1 spz mov 0xff, %o5 76 1.1 spz srl %o5, %o4, %o5 77 1.1 spz 78 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 79 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 80 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 81 1.1 spz 82 1.1 spz stda %f4, [%o1 + %o5]0xc0 ! partial store 83 1.1 spz std %f6, [%o1 + 8] 84 1.1 spz add %o1, 16, %o1 85 1.1 spz orn %g0, %o5, %o5 86 1.1 spz retl 87 1.1 spz stda %f8, [%o1 + %o5]0xc0 ! partial store 88 1.1 spz .type aes_t4_encrypt,#function 89 1.1 spz .size aes_t4_encrypt,.-aes_t4_encrypt 90 1.1 spz 91 1.1 spz .globl aes_t4_decrypt 92 1.1 spz .align 32 93 1.1 spz aes_t4_decrypt: 94 1.1 spz andcc %o0, 7, %g1 ! is input aligned? 95 1.1 spz andn %o0, 7, %o0 96 1.1 spz 97 1.1 spz ldx [%o2 + 0], %g4 98 1.1 spz ldx [%o2 + 8], %g5 99 1.1 spz 100 1.1 spz ldx [%o0 + 0], %o4 101 1.1 spz bz,pt %icc, 1f 102 1.1 spz ldx [%o0 + 8], %o5 103 1.1 spz ldx [%o0 + 16], %o0 104 1.1 spz sll %g1, 3, %g1 105 1.1 spz sub %g0, %g1, %o3 106 1.1 spz sllx %o4, %g1, %o4 107 1.1 spz sllx %o5, %g1, %g1 108 1.1 spz srlx %o5, %o3, %o5 109 1.1 spz srlx %o0, %o3, %o3 110 1.1 spz or %o5, %o4, %o4 111 1.1 spz or %o3, %g1, %o5 112 1.1 spz 1: 113 1.1 spz ld [%o2 + 240], %o3 114 1.1 spz ldd [%o2 + 16], %f12 115 1.1 spz ldd [%o2 + 24], %f14 116 1.1 spz xor %g4, %o4, %o4 117 1.1 spz xor %g5, %o5, %o5 118 1.1 spz .word 0x81b0230c !movxtod %o4,%f0 119 1.1 spz .word 0x85b0230d !movxtod %o5,%f2 120 1.1 spz srl %o3, 1, %o3 121 1.1 spz ldd [%o2 + 32], %f16 122 1.1 spz sub %o3, 1, %o3 123 1.1 spz ldd [%o2 + 40], %f18 124 1.1 spz add %o2, 48, %o2 125 1.1 spz 126 1.1 spz .Ldec: 127 1.1 spz .word 0x88cb0440 !aes_dround01 %f12,%f0,%f2,%f4 128 1.1 spz .word 0x84cb8460 !aes_dround23 %f14,%f0,%f2,%f2 129 1.1 spz ldd [%o2 + 0], %f12 130 1.1 spz ldd [%o2 + 8], %f14 131 1.1 spz sub %o3,1,%o3 132 1.1 spz .word 0x80cc0444 !aes_dround01 %f16,%f4,%f2,%f0 133 1.1 spz .word 0x84cc8464 !aes_dround23 %f18,%f4,%f2,%f2 134 1.1 spz ldd [%o2 + 16], %f16 135 1.1 spz ldd [%o2 + 24], %f18 136 1.1 spz brnz,pt %o3, .Ldec 137 1.1 spz add %o2, 32, %o2 138 1.1 spz 139 1.1 spz andcc %o1, 7, %o4 ! is output aligned? 140 1.1 spz .word 0x88cb0440 !aes_dround01 %f12,%f0,%f2,%f4 141 1.1 spz .word 0x84cb8460 !aes_dround23 %f14,%f0,%f2,%f2 142 1.1 spz .word 0x80cc04c4 !aes_dround01_l %f16,%f4,%f2,%f0 143 1.1 spz .word 0x84cc84e4 !aes_dround23_l %f18,%f4,%f2,%f2 144 1.1 spz 145 1.1 spz bnz,pn %icc, 2f 146 1.1 spz nop 147 1.1 spz 148 1.1 spz std %f0, [%o1 + 0] 149 1.1 spz retl 150 1.1 spz std %f2, [%o1 + 8] 151 1.1 spz 152 1.1 spz 2: .word 0x93b24340 !alignaddrl %o1,%g0,%o1 153 1.1 spz mov 0xff, %o5 154 1.1 spz srl %o5, %o4, %o5 155 1.1 spz 156 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 157 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 158 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 159 1.1 spz 160 1.1 spz stda %f4, [%o1 + %o5]0xc0 ! partial store 161 1.1 spz std %f6, [%o1 + 8] 162 1.1 spz add %o1, 16, %o1 163 1.1 spz orn %g0, %o5, %o5 164 1.1 spz retl 165 1.1 spz stda %f8, [%o1 + %o5]0xc0 ! partial store 166 1.1 spz .type aes_t4_decrypt,#function 167 1.1 spz .size aes_t4_decrypt,.-aes_t4_decrypt 168 1.1 spz .globl aes_t4_set_encrypt_key 169 1.1 spz .align 32 170 1.1 spz aes_t4_set_encrypt_key: 171 1.1 spz .Lset_encrypt_key: 172 1.1 spz and %o0, 7, %o3 173 1.1 spz .word 0x91b20300 !alignaddr %o0,%g0,%o0 174 1.1 spz cmp %o1, 192 175 1.1 spz ldd [%o0 + 0], %f0 176 1.1 spz bl,pt %icc,.L128 177 1.1 spz ldd [%o0 + 8], %f2 178 1.1 spz 179 1.1 spz be,pt %icc,.L192 180 1.1 spz ldd [%o0 + 16], %f4 181 1.1 spz brz,pt %o3, .L256aligned 182 1.1 spz ldd [%o0 + 24], %f6 183 1.1 spz 184 1.1 spz ldd [%o0 + 32], %f8 185 1.1 spz .word 0x81b00902 !faligndata %f0,%f2,%f0 186 1.1 spz .word 0x85b08904 !faligndata %f2,%f4,%f2 187 1.1 spz .word 0x89b10906 !faligndata %f4,%f6,%f4 188 1.1 spz .word 0x8db18908 !faligndata %f6,%f8,%f6 189 1.1 spz .L256aligned: 190 1.1 spz std %f0, [%o2 + 0] 191 1.1 spz .word 0x80c80106 !aes_kexpand1 %f0,%f6,0,%f0 192 1.1 spz std %f2, [%o2 + 8] 193 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 194 1.1 spz std %f4, [%o2 + 16] 195 1.1 spz .word 0x89b12602 !aes_kexpand0 %f4,%f2,%f4 196 1.1 spz std %f6, [%o2 + 24] 197 1.1 spz .word 0x8db1a624 !aes_kexpand2 %f6,%f4,%f6 198 1.1 spz std %f0, [%o2 + 32] 199 1.1 spz .word 0x80c80306 !aes_kexpand1 %f0,%f6,1,%f0 200 1.1 spz std %f2, [%o2 + 40] 201 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 202 1.1 spz std %f4, [%o2 + 48] 203 1.1 spz .word 0x89b12602 !aes_kexpand0 %f4,%f2,%f4 204 1.1 spz std %f6, [%o2 + 56] 205 1.1 spz .word 0x8db1a624 !aes_kexpand2 %f6,%f4,%f6 206 1.1 spz std %f0, [%o2 + 64] 207 1.1 spz .word 0x80c80506 !aes_kexpand1 %f0,%f6,2,%f0 208 1.1 spz std %f2, [%o2 + 72] 209 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 210 1.1 spz std %f4, [%o2 + 80] 211 1.1 spz .word 0x89b12602 !aes_kexpand0 %f4,%f2,%f4 212 1.1 spz std %f6, [%o2 + 88] 213 1.1 spz .word 0x8db1a624 !aes_kexpand2 %f6,%f4,%f6 214 1.1 spz std %f0, [%o2 + 96] 215 1.1 spz .word 0x80c80706 !aes_kexpand1 %f0,%f6,3,%f0 216 1.1 spz std %f2, [%o2 + 104] 217 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 218 1.1 spz std %f4, [%o2 + 112] 219 1.1 spz .word 0x89b12602 !aes_kexpand0 %f4,%f2,%f4 220 1.1 spz std %f6, [%o2 + 120] 221 1.1 spz .word 0x8db1a624 !aes_kexpand2 %f6,%f4,%f6 222 1.1 spz std %f0, [%o2 + 128] 223 1.1 spz .word 0x80c80906 !aes_kexpand1 %f0,%f6,4,%f0 224 1.1 spz std %f2, [%o2 + 136] 225 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 226 1.1 spz std %f4, [%o2 + 144] 227 1.1 spz .word 0x89b12602 !aes_kexpand0 %f4,%f2,%f4 228 1.1 spz std %f6, [%o2 + 152] 229 1.1 spz .word 0x8db1a624 !aes_kexpand2 %f6,%f4,%f6 230 1.1 spz std %f0, [%o2 + 160] 231 1.1 spz .word 0x80c80b06 !aes_kexpand1 %f0,%f6,5,%f0 232 1.1 spz std %f2, [%o2 + 168] 233 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 234 1.1 spz std %f4, [%o2 + 176] 235 1.1 spz .word 0x89b12602 !aes_kexpand0 %f4,%f2,%f4 236 1.1 spz std %f6, [%o2 + 184] 237 1.1 spz .word 0x8db1a624 !aes_kexpand2 %f6,%f4,%f6 238 1.1 spz std %f0, [%o2 + 192] 239 1.1 spz .word 0x80c80d06 !aes_kexpand1 %f0,%f6,6,%f0 240 1.1 spz std %f2, [%o2 + 200] 241 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 242 1.1 spz std %f4, [%o2 + 208] 243 1.1 spz std %f6, [%o2 + 216] 244 1.1 spz std %f0, [%o2 + 224] 245 1.1 spz std %f2, [%o2 + 232] 246 1.1 spz 247 1.1 spz mov 14, %o3 248 1.1 spz st %o3, [%o2 + 240] 249 1.1 spz retl 250 1.1 spz xor %o0, %o0, %o0 251 1.1 spz 252 1.1 spz .align 16 253 1.1 spz .L192: 254 1.1 spz brz,pt %o3, .L192aligned 255 1.1 spz nop 256 1.1 spz 257 1.1 spz ldd [%o0 + 24], %f6 258 1.1 spz .word 0x81b00902 !faligndata %f0,%f2,%f0 259 1.1 spz .word 0x85b08904 !faligndata %f2,%f4,%f2 260 1.1 spz .word 0x89b10906 !faligndata %f4,%f6,%f4 261 1.1 spz .L192aligned: 262 1.1 spz std %f0, [%o2 + 0] 263 1.1 spz .word 0x80c80104 !aes_kexpand1 %f0,%f4,0,%f0 264 1.1 spz std %f2, [%o2 + 8] 265 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 266 1.1 spz std %f4, [%o2 + 16] 267 1.1 spz .word 0x89b12622 !aes_kexpand2 %f4,%f2,%f4 268 1.1 spz std %f0, [%o2 + 24] 269 1.1 spz .word 0x80c80304 !aes_kexpand1 %f0,%f4,1,%f0 270 1.1 spz std %f2, [%o2 + 32] 271 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 272 1.1 spz std %f4, [%o2 + 40] 273 1.1 spz .word 0x89b12622 !aes_kexpand2 %f4,%f2,%f4 274 1.1 spz std %f0, [%o2 + 48] 275 1.1 spz .word 0x80c80504 !aes_kexpand1 %f0,%f4,2,%f0 276 1.1 spz std %f2, [%o2 + 56] 277 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 278 1.1 spz std %f4, [%o2 + 64] 279 1.1 spz .word 0x89b12622 !aes_kexpand2 %f4,%f2,%f4 280 1.1 spz std %f0, [%o2 + 72] 281 1.1 spz .word 0x80c80704 !aes_kexpand1 %f0,%f4,3,%f0 282 1.1 spz std %f2, [%o2 + 80] 283 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 284 1.1 spz std %f4, [%o2 + 88] 285 1.1 spz .word 0x89b12622 !aes_kexpand2 %f4,%f2,%f4 286 1.1 spz std %f0, [%o2 + 96] 287 1.1 spz .word 0x80c80904 !aes_kexpand1 %f0,%f4,4,%f0 288 1.1 spz std %f2, [%o2 + 104] 289 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 290 1.1 spz std %f4, [%o2 + 112] 291 1.1 spz .word 0x89b12622 !aes_kexpand2 %f4,%f2,%f4 292 1.1 spz std %f0, [%o2 + 120] 293 1.1 spz .word 0x80c80b04 !aes_kexpand1 %f0,%f4,5,%f0 294 1.1 spz std %f2, [%o2 + 128] 295 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 296 1.1 spz std %f4, [%o2 + 136] 297 1.1 spz .word 0x89b12622 !aes_kexpand2 %f4,%f2,%f4 298 1.1 spz std %f0, [%o2 + 144] 299 1.1 spz .word 0x80c80d04 !aes_kexpand1 %f0,%f4,6,%f0 300 1.1 spz std %f2, [%o2 + 152] 301 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 302 1.1 spz std %f4, [%o2 + 160] 303 1.1 spz .word 0x89b12622 !aes_kexpand2 %f4,%f2,%f4 304 1.1 spz std %f0, [%o2 + 168] 305 1.1 spz .word 0x80c80f04 !aes_kexpand1 %f0,%f4,7,%f0 306 1.1 spz std %f2, [%o2 + 176] 307 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 308 1.1 spz std %f4, [%o2 + 184] 309 1.1 spz std %f0, [%o2 + 192] 310 1.1 spz std %f2, [%o2 + 200] 311 1.1 spz 312 1.1 spz mov 12, %o3 313 1.1 spz st %o3, [%o2 + 240] 314 1.1 spz retl 315 1.1 spz xor %o0, %o0, %o0 316 1.1 spz 317 1.1 spz .align 16 318 1.1 spz .L128: 319 1.1 spz brz,pt %o3, .L128aligned 320 1.1 spz nop 321 1.1 spz 322 1.1 spz ldd [%o0 + 16], %f4 323 1.1 spz .word 0x81b00902 !faligndata %f0,%f2,%f0 324 1.1 spz .word 0x85b08904 !faligndata %f2,%f4,%f2 325 1.1 spz .L128aligned: 326 1.1 spz std %f0, [%o2 + 0] 327 1.1 spz .word 0x80c80102 !aes_kexpand1 %f0,%f2,0,%f0 328 1.1 spz std %f2, [%o2 + 8] 329 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 330 1.1 spz std %f0, [%o2 + 16] 331 1.1 spz .word 0x80c80302 !aes_kexpand1 %f0,%f2,1,%f0 332 1.1 spz std %f2, [%o2 + 24] 333 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 334 1.1 spz std %f0, [%o2 + 32] 335 1.1 spz .word 0x80c80502 !aes_kexpand1 %f0,%f2,2,%f0 336 1.1 spz std %f2, [%o2 + 40] 337 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 338 1.1 spz std %f0, [%o2 + 48] 339 1.1 spz .word 0x80c80702 !aes_kexpand1 %f0,%f2,3,%f0 340 1.1 spz std %f2, [%o2 + 56] 341 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 342 1.1 spz std %f0, [%o2 + 64] 343 1.1 spz .word 0x80c80902 !aes_kexpand1 %f0,%f2,4,%f0 344 1.1 spz std %f2, [%o2 + 72] 345 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 346 1.1 spz std %f0, [%o2 + 80] 347 1.1 spz .word 0x80c80b02 !aes_kexpand1 %f0,%f2,5,%f0 348 1.1 spz std %f2, [%o2 + 88] 349 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 350 1.1 spz std %f0, [%o2 + 96] 351 1.1 spz .word 0x80c80d02 !aes_kexpand1 %f0,%f2,6,%f0 352 1.1 spz std %f2, [%o2 + 104] 353 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 354 1.1 spz std %f0, [%o2 + 112] 355 1.1 spz .word 0x80c80f02 !aes_kexpand1 %f0,%f2,7,%f0 356 1.1 spz std %f2, [%o2 + 120] 357 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 358 1.1 spz std %f0, [%o2 + 128] 359 1.1 spz .word 0x80c81102 !aes_kexpand1 %f0,%f2,8,%f0 360 1.1 spz std %f2, [%o2 + 136] 361 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 362 1.1 spz std %f0, [%o2 + 144] 363 1.1 spz .word 0x80c81302 !aes_kexpand1 %f0,%f2,9,%f0 364 1.1 spz std %f2, [%o2 + 152] 365 1.1 spz .word 0x85b0a620 !aes_kexpand2 %f2,%f0,%f2 366 1.1 spz std %f0, [%o2 + 160] 367 1.1 spz std %f2, [%o2 + 168] 368 1.1 spz 369 1.1 spz mov 10, %o3 370 1.1 spz st %o3, [%o2 + 240] 371 1.1 spz retl 372 1.1 spz xor %o0, %o0, %o0 373 1.1 spz .type aes_t4_set_encrypt_key,#function 374 1.1 spz .size aes_t4_set_encrypt_key,.-aes_t4_set_encrypt_key 375 1.1 spz 376 1.1 spz .globl aes_t4_set_decrypt_key 377 1.1 spz .align 32 378 1.1 spz aes_t4_set_decrypt_key: 379 1.1 spz mov %o7, %o5 380 1.1 spz call .Lset_encrypt_key 381 1.1 spz nop 382 1.1 spz 383 1.1 spz mov %o5, %o7 384 1.1 spz sll %o3, 4, %o0 ! %o3 is number of rounds 385 1.1 spz add %o3, 2, %o3 386 1.1 spz add %o2, %o0, %o0 ! %o0=%o2+16*rounds 387 1.1 spz srl %o3, 2, %o3 ! %o3=(rounds+2)/4 388 1.1 spz 389 1.1 spz .Lkey_flip: 390 1.1 spz ldd [%o2 + 0], %f0 391 1.1 spz ldd [%o2 + 8], %f2 392 1.1 spz ldd [%o2 + 16], %f4 393 1.1 spz ldd [%o2 + 24], %f6 394 1.1 spz ldd [%o0 + 0], %f8 395 1.1 spz ldd [%o0 + 8], %f10 396 1.1 spz ldd [%o0 - 16], %f12 397 1.1 spz ldd [%o0 - 8], %f14 398 1.1 spz sub %o3, 1, %o3 399 1.1 spz std %f0, [%o0 + 0] 400 1.1 spz std %f2, [%o0 + 8] 401 1.1 spz std %f4, [%o0 - 16] 402 1.1 spz std %f6, [%o0 - 8] 403 1.1 spz std %f8, [%o2 + 0] 404 1.1 spz std %f10, [%o2 + 8] 405 1.1 spz std %f12, [%o2 + 16] 406 1.1 spz std %f14, [%o2 + 24] 407 1.1 spz add %o2, 32, %o2 408 1.1 spz brnz %o3, .Lkey_flip 409 1.1 spz sub %o0, 32, %o0 410 1.1 spz 411 1.1 spz retl 412 1.1 spz xor %o0, %o0, %o0 413 1.1 spz .type aes_t4_set_decrypt_key,#function 414 1.1 spz .size aes_t4_set_decrypt_key,.-aes_t4_set_decrypt_key 415 1.1 spz .align 32 416 1.1 spz _aes128_encrypt_1x: 417 1.1 spz .word 0x88cc0400 !aes_eround01 %f16,%f0,%f2,%f4 418 1.1 spz .word 0x84cc8420 !aes_eround23 %f18,%f0,%f2,%f2 419 1.1 spz .word 0x80cd0404 !aes_eround01 %f20,%f4,%f2,%f0 420 1.1 spz .word 0x84cd8424 !aes_eround23 %f22,%f4,%f2,%f2 421 1.1 spz .word 0x88ce0400 !aes_eround01 %f24,%f0,%f2,%f4 422 1.1 spz .word 0x84ce8420 !aes_eround23 %f26,%f0,%f2,%f2 423 1.1 spz .word 0x80cf0404 !aes_eround01 %f28,%f4,%f2,%f0 424 1.1 spz .word 0x84cf8424 !aes_eround23 %f30,%f4,%f2,%f2 425 1.1 spz .word 0x88c84400 !aes_eround01 %f32,%f0,%f2,%f4 426 1.1 spz .word 0x84c8c420 !aes_eround23 %f34,%f0,%f2,%f2 427 1.1 spz .word 0x80c94404 !aes_eround01 %f36,%f4,%f2,%f0 428 1.1 spz .word 0x84c9c424 !aes_eround23 %f38,%f4,%f2,%f2 429 1.1 spz .word 0x88ca4400 !aes_eround01 %f40,%f0,%f2,%f4 430 1.1 spz .word 0x84cac420 !aes_eround23 %f42,%f0,%f2,%f2 431 1.1 spz .word 0x80cb4404 !aes_eround01 %f44,%f4,%f2,%f0 432 1.1 spz .word 0x84cbc424 !aes_eround23 %f46,%f4,%f2,%f2 433 1.1 spz .word 0x88cc4400 !aes_eround01 %f48,%f0,%f2,%f4 434 1.1 spz .word 0x84ccc420 !aes_eround23 %f50,%f0,%f2,%f2 435 1.1 spz .word 0x80cd4484 !aes_eround01_l %f52,%f4,%f2,%f0 436 1.1 spz retl 437 1.1 spz .word 0x84cdc4a4 !aes_eround23_l %f54,%f4,%f2,%f2 438 1.1 spz .type _aes128_encrypt_1x,#function 439 1.1 spz .size _aes128_encrypt_1x,.-_aes128_encrypt_1x 440 1.1 spz 441 1.1 spz .align 32 442 1.1 spz _aes128_encrypt_2x: 443 1.1 spz .word 0x90cc0400 !aes_eround01 %f16,%f0,%f2,%f8 444 1.1 spz .word 0x84cc8420 !aes_eround23 %f18,%f0,%f2,%f2 445 1.1 spz .word 0x94cc0c04 !aes_eround01 %f16,%f4,%f6,%f10 446 1.1 spz .word 0x8ccc8c24 !aes_eround23 %f18,%f4,%f6,%f6 447 1.1 spz .word 0x80cd0408 !aes_eround01 %f20,%f8,%f2,%f0 448 1.1 spz .word 0x84cd8428 !aes_eround23 %f22,%f8,%f2,%f2 449 1.1 spz .word 0x88cd0c0a !aes_eround01 %f20,%f10,%f6,%f4 450 1.1 spz .word 0x8ccd8c2a !aes_eround23 %f22,%f10,%f6,%f6 451 1.1 spz .word 0x90ce0400 !aes_eround01 %f24,%f0,%f2,%f8 452 1.1 spz .word 0x84ce8420 !aes_eround23 %f26,%f0,%f2,%f2 453 1.1 spz .word 0x94ce0c04 !aes_eround01 %f24,%f4,%f6,%f10 454 1.1 spz .word 0x8cce8c24 !aes_eround23 %f26,%f4,%f6,%f6 455 1.1 spz .word 0x80cf0408 !aes_eround01 %f28,%f8,%f2,%f0 456 1.1 spz .word 0x84cf8428 !aes_eround23 %f30,%f8,%f2,%f2 457 1.1 spz .word 0x88cf0c0a !aes_eround01 %f28,%f10,%f6,%f4 458 1.1 spz .word 0x8ccf8c2a !aes_eround23 %f30,%f10,%f6,%f6 459 1.1 spz .word 0x90c84400 !aes_eround01 %f32,%f0,%f2,%f8 460 1.1 spz .word 0x84c8c420 !aes_eround23 %f34,%f0,%f2,%f2 461 1.1 spz .word 0x94c84c04 !aes_eround01 %f32,%f4,%f6,%f10 462 1.1 spz .word 0x8cc8cc24 !aes_eround23 %f34,%f4,%f6,%f6 463 1.1 spz .word 0x80c94408 !aes_eround01 %f36,%f8,%f2,%f0 464 1.1 spz .word 0x84c9c428 !aes_eround23 %f38,%f8,%f2,%f2 465 1.1 spz .word 0x88c94c0a !aes_eround01 %f36,%f10,%f6,%f4 466 1.1 spz .word 0x8cc9cc2a !aes_eround23 %f38,%f10,%f6,%f6 467 1.1 spz .word 0x90ca4400 !aes_eround01 %f40,%f0,%f2,%f8 468 1.1 spz .word 0x84cac420 !aes_eround23 %f42,%f0,%f2,%f2 469 1.1 spz .word 0x94ca4c04 !aes_eround01 %f40,%f4,%f6,%f10 470 1.1 spz .word 0x8ccacc24 !aes_eround23 %f42,%f4,%f6,%f6 471 1.1 spz .word 0x80cb4408 !aes_eround01 %f44,%f8,%f2,%f0 472 1.1 spz .word 0x84cbc428 !aes_eround23 %f46,%f8,%f2,%f2 473 1.1 spz .word 0x88cb4c0a !aes_eround01 %f44,%f10,%f6,%f4 474 1.1 spz .word 0x8ccbcc2a !aes_eround23 %f46,%f10,%f6,%f6 475 1.1 spz .word 0x90cc4400 !aes_eround01 %f48,%f0,%f2,%f8 476 1.1 spz .word 0x84ccc420 !aes_eround23 %f50,%f0,%f2,%f2 477 1.1 spz .word 0x94cc4c04 !aes_eround01 %f48,%f4,%f6,%f10 478 1.1 spz .word 0x8ccccc24 !aes_eround23 %f50,%f4,%f6,%f6 479 1.1 spz .word 0x80cd4488 !aes_eround01_l %f52,%f8,%f2,%f0 480 1.1 spz .word 0x84cdc4a8 !aes_eround23_l %f54,%f8,%f2,%f2 481 1.1 spz .word 0x88cd4c8a !aes_eround01_l %f52,%f10,%f6,%f4 482 1.1 spz retl 483 1.1 spz .word 0x8ccdccaa !aes_eround23_l %f54,%f10,%f6,%f6 484 1.1 spz .type _aes128_encrypt_2x,#function 485 1.1 spz .size _aes128_encrypt_2x,.-_aes128_encrypt_2x 486 1.1 spz 487 1.1 spz .align 32 488 1.1 spz _aes128_loadkey: 489 1.1 spz ldx [%i3 + 0], %g4 490 1.1 spz ldx [%i3 + 8], %g5 491 1.1 spz ldd [%i3 + 16], %f16 492 1.1 spz ldd [%i3 + 24], %f18 493 1.1 spz ldd [%i3 + 32], %f20 494 1.1 spz ldd [%i3 + 40], %f22 495 1.1 spz ldd [%i3 + 48], %f24 496 1.1 spz ldd [%i3 + 56], %f26 497 1.1 spz ldd [%i3 + 64], %f28 498 1.1 spz ldd [%i3 + 72], %f30 499 1.1 spz ldd [%i3 + 80], %f32 500 1.1 spz ldd [%i3 + 88], %f34 501 1.1 spz ldd [%i3 + 96], %f36 502 1.1 spz ldd [%i3 + 104], %f38 503 1.1 spz ldd [%i3 + 112], %f40 504 1.1 spz ldd [%i3 + 120], %f42 505 1.1 spz ldd [%i3 + 128], %f44 506 1.1 spz ldd [%i3 + 136], %f46 507 1.1 spz ldd [%i3 + 144], %f48 508 1.1 spz ldd [%i3 + 152], %f50 509 1.1 spz ldd [%i3 + 160], %f52 510 1.1 spz ldd [%i3 + 168], %f54 511 1.1 spz retl 512 1.1 spz nop 513 1.1 spz .type _aes128_loadkey,#function 514 1.1 spz .size _aes128_loadkey,.-_aes128_loadkey 515 1.1 spz _aes128_load_enckey=_aes128_loadkey 516 1.1 spz _aes128_load_deckey=_aes128_loadkey 517 1.1 spz 518 1.1 spz .globl aes128_t4_cbc_encrypt 519 1.1 spz .align 32 520 1.1 spz aes128_t4_cbc_encrypt: 521 1.4 martin save %sp, -STACK_FRAME, %sp 522 1.1 spz cmp %i2, 0 523 1.4 martin be,pn SIZE_T_CC, .L128_cbc_enc_abort 524 1.1 spz srln %i2, 0, %i2 ! needed on v8+, "nop" on v9 525 1.1 spz sub %i0, %i1, %l5 ! %i0!=%i1 526 1.1 spz ld [%i4 + 0], %f0 527 1.1 spz ld [%i4 + 4], %f1 528 1.1 spz ld [%i4 + 8], %f2 529 1.1 spz ld [%i4 + 12], %f3 530 1.1 spz prefetch [%i0], 20 531 1.1 spz prefetch [%i0 + 63], 20 532 1.1 spz call _aes128_load_enckey 533 1.1 spz and %i0, 7, %l0 534 1.1 spz andn %i0, 7, %i0 535 1.1 spz sll %l0, 3, %l0 536 1.1 spz mov 64, %l1 537 1.1 spz mov 0xff, %l3 538 1.1 spz sub %l1, %l0, %l1 539 1.1 spz and %i1, 7, %l2 540 1.1 spz cmp %i2, 127 541 1.1 spz movrnz %l2, 0, %l5 ! if ( %i1&7 || 542 1.4 martin movleu SIZE_T_CC, 0, %l5 ! %i2<128 || 543 1.1 spz brnz,pn %l5, .L128cbc_enc_blk ! %i0==%i1) 544 1.1 spz srl %l3, %l2, %l3 545 1.1 spz 546 1.1 spz .word 0xb3b64340 !alignaddrl %i1,%g0,%i1 547 1.1 spz srlx %i2, 4, %i2 548 1.1 spz prefetch [%i1], 22 549 1.1 spz 550 1.1 spz .L128_cbc_enc_loop: 551 1.1 spz ldx [%i0 + 0], %o0 552 1.1 spz brz,pt %l0, 4f 553 1.1 spz ldx [%i0 + 8], %o1 554 1.1 spz 555 1.1 spz ldx [%i0 + 16], %o2 556 1.1 spz sllx %o0, %l0, %o0 557 1.1 spz srlx %o1, %l1, %g1 558 1.1 spz sllx %o1, %l0, %o1 559 1.1 spz or %g1, %o0, %o0 560 1.1 spz srlx %o2, %l1, %o2 561 1.1 spz or %o2, %o1, %o1 562 1.1 spz 4: 563 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 564 1.1 spz xor %g5, %o1, %o1 565 1.1 spz .word 0x99b02308 !movxtod %o0,%f12 566 1.1 spz .word 0x9db02309 !movxtod %o1,%f14 567 1.1 spz 568 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 569 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 570 1.1 spz prefetch [%i1 + 63], 22 571 1.1 spz prefetch [%i0 + 16+63], 20 572 1.1 spz call _aes128_encrypt_1x 573 1.1 spz add %i0, 16, %i0 574 1.1 spz 575 1.1 spz brnz,pn %l2, 2f 576 1.1 spz sub %i2, 1, %i2 577 1.5 christos 578 1.1 spz std %f0, [%i1 + 0] 579 1.1 spz std %f2, [%i1 + 8] 580 1.1 spz brnz,pt %i2, .L128_cbc_enc_loop 581 1.1 spz add %i1, 16, %i1 582 1.1 spz st %f0, [%i4 + 0] 583 1.1 spz st %f1, [%i4 + 4] 584 1.1 spz st %f2, [%i4 + 8] 585 1.1 spz st %f3, [%i4 + 12] 586 1.1 spz .L128_cbc_enc_abort: 587 1.1 spz ret 588 1.1 spz restore 589 1.1 spz 590 1.1 spz .align 16 591 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 592 1.1 spz ! and ~3x deterioration 593 1.1 spz ! in inp==out case 594 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 ! handle unaligned output 595 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 596 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 597 1.1 spz 598 1.1 spz stda %f4, [%i1 + %l3]0xc0 ! partial store 599 1.1 spz std %f6, [%i1 + 8] 600 1.1 spz add %i1, 16, %i1 601 1.1 spz orn %g0, %l3, %l3 602 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 603 1.1 spz 604 1.1 spz brnz,pt %i2, .L128_cbc_enc_loop+4 605 1.1 spz orn %g0, %l3, %l3 606 1.1 spz st %f0, [%i4 + 0] 607 1.1 spz st %f1, [%i4 + 4] 608 1.1 spz st %f2, [%i4 + 8] 609 1.1 spz st %f3, [%i4 + 12] 610 1.1 spz ret 611 1.1 spz restore 612 1.1 spz 613 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 614 1.1 spz .align 32 615 1.1 spz .L128cbc_enc_blk: 616 1.1 spz add %i1, %i2, %l5 617 1.1 spz and %l5, 63, %l5 ! tail 618 1.1 spz sub %i2, %l5, %i2 619 1.1 spz add %l5, 15, %l5 ! round up to 16n 620 1.1 spz srlx %i2, 4, %i2 621 1.1 spz srl %l5, 4, %l5 622 1.1 spz 623 1.1 spz .L128_cbc_enc_blk_loop: 624 1.1 spz ldx [%i0 + 0], %o0 625 1.1 spz brz,pt %l0, 5f 626 1.1 spz ldx [%i0 + 8], %o1 627 1.1 spz 628 1.1 spz ldx [%i0 + 16], %o2 629 1.1 spz sllx %o0, %l0, %o0 630 1.1 spz srlx %o1, %l1, %g1 631 1.1 spz sllx %o1, %l0, %o1 632 1.1 spz or %g1, %o0, %o0 633 1.1 spz srlx %o2, %l1, %o2 634 1.1 spz or %o2, %o1, %o1 635 1.1 spz 5: 636 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 637 1.1 spz xor %g5, %o1, %o1 638 1.1 spz .word 0x99b02308 !movxtod %o0,%f12 639 1.1 spz .word 0x9db02309 !movxtod %o1,%f14 640 1.1 spz 641 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 642 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 643 1.1 spz prefetch [%i0 + 16+63], 20 644 1.1 spz call _aes128_encrypt_1x 645 1.1 spz add %i0, 16, %i0 646 1.1 spz sub %i2, 1, %i2 647 1.5 christos 648 1.1 spz stda %f0, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 649 1.1 spz add %i1, 8, %i1 650 1.1 spz stda %f2, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 651 1.1 spz brnz,pt %i2, .L128_cbc_enc_blk_loop 652 1.1 spz add %i1, 8, %i1 653 1.1 spz 654 1.1 spz membar #StoreLoad|#StoreStore 655 1.1 spz brnz,pt %l5, .L128_cbc_enc_loop 656 1.1 spz mov %l5, %i2 657 1.1 spz st %f0, [%i4 + 0] 658 1.1 spz st %f1, [%i4 + 4] 659 1.1 spz st %f2, [%i4 + 8] 660 1.1 spz st %f3, [%i4 + 12] 661 1.1 spz ret 662 1.1 spz restore 663 1.1 spz .type aes128_t4_cbc_encrypt,#function 664 1.1 spz .size aes128_t4_cbc_encrypt,.-aes128_t4_cbc_encrypt 665 1.1 spz .globl aes128_t4_ctr32_encrypt 666 1.1 spz .align 32 667 1.1 spz aes128_t4_ctr32_encrypt: 668 1.4 martin save %sp, -STACK_FRAME, %sp 669 1.1 spz srln %i2, 0, %i2 ! needed on v8+, "nop" on v9 670 1.1 spz 671 1.1 spz prefetch [%i0], 20 672 1.1 spz prefetch [%i0 + 63], 20 673 1.1 spz call _aes128_load_enckey 674 1.1 spz sllx %i2, 4, %i2 675 1.1 spz 676 1.1 spz ld [%i4 + 0], %l4 ! counter 677 1.1 spz ld [%i4 + 4], %l5 678 1.1 spz ld [%i4 + 8], %l6 679 1.1 spz ld [%i4 + 12], %l7 680 1.1 spz 681 1.1 spz sllx %l4, 32, %o5 682 1.1 spz or %l5, %o5, %o5 683 1.1 spz sllx %l6, 32, %g1 684 1.1 spz xor %o5, %g4, %g4 ! ^= rk[0] 685 1.1 spz xor %g1, %g5, %g5 686 1.1 spz .word 0x9db02304 !movxtod %g4,%f14 ! most significant 64 bits 687 1.1 spz 688 1.1 spz sub %i0, %i1, %l5 ! %i0!=%i1 689 1.1 spz and %i0, 7, %l0 690 1.1 spz andn %i0, 7, %i0 691 1.1 spz sll %l0, 3, %l0 692 1.1 spz mov 64, %l1 693 1.1 spz mov 0xff, %l3 694 1.1 spz sub %l1, %l0, %l1 695 1.1 spz and %i1, 7, %l2 696 1.1 spz cmp %i2, 255 697 1.1 spz movrnz %l2, 0, %l5 ! if ( %i1&7 || 698 1.4 martin movleu SIZE_T_CC, 0, %l5 ! %i2<256 || 699 1.1 spz brnz,pn %l5, .L128_ctr32_blk ! %i0==%i1) 700 1.1 spz srl %l3, %l2, %l3 701 1.1 spz 702 1.1 spz andcc %i2, 16, %g0 ! is number of blocks even? 703 1.1 spz .word 0xb3b64340 !alignaddrl %i1,%g0,%i1 704 1.1 spz bz %icc, .L128_ctr32_loop2x 705 1.1 spz srlx %i2, 4, %i2 706 1.1 spz .L128_ctr32_loop: 707 1.1 spz ldx [%i0 + 0], %o0 708 1.1 spz brz,pt %l0, 4f 709 1.1 spz ldx [%i0 + 8], %o1 710 1.1 spz 711 1.1 spz ldx [%i0 + 16], %o2 712 1.1 spz sllx %o0, %l0, %o0 713 1.1 spz srlx %o1, %l1, %g1 714 1.1 spz sllx %o1, %l0, %o1 715 1.1 spz or %g1, %o0, %o0 716 1.1 spz srlx %o2, %l1, %o2 717 1.1 spz or %o2, %o1, %o1 718 1.1 spz 4: 719 1.1 spz xor %g5, %l7, %g1 ! ^= rk[0] 720 1.1 spz add %l7, 1, %l7 721 1.1 spz .word 0x85b02301 !movxtod %g1,%f2 722 1.1 spz srl %l7, 0, %l7 ! clruw 723 1.1 spz prefetch [%i1 + 63], 22 724 1.1 spz prefetch [%i0 + 16+63], 20 725 1.1 spz .word 0x88cc040e !aes_eround01 %f16,%f14,%f2,%f4 726 1.1 spz .word 0x84cc842e !aes_eround23 %f18,%f14,%f2,%f2 727 1.1 spz call _aes128_encrypt_1x+8 728 1.1 spz add %i0, 16, %i0 729 1.1 spz 730 1.1 spz .word 0x95b02308 !movxtod %o0,%f10 731 1.1 spz .word 0x99b02309 !movxtod %o1,%f12 732 1.1 spz .word 0x81b28d80 !fxor %f10,%f0,%f0 ! ^= inp 733 1.1 spz .word 0x85b30d82 !fxor %f12,%f2,%f2 734 1.1 spz 735 1.1 spz brnz,pn %l2, 2f 736 1.1 spz sub %i2, 1, %i2 737 1.5 christos 738 1.1 spz std %f0, [%i1 + 0] 739 1.1 spz std %f2, [%i1 + 8] 740 1.1 spz brnz,pt %i2, .L128_ctr32_loop2x 741 1.1 spz add %i1, 16, %i1 742 1.1 spz 743 1.1 spz ret 744 1.1 spz restore 745 1.1 spz 746 1.1 spz .align 16 747 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 748 1.1 spz ! and ~3x deterioration 749 1.1 spz ! in inp==out case 750 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 ! handle unaligned output 751 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 752 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 753 1.1 spz stda %f4, [%i1 + %l3]0xc0 ! partial store 754 1.1 spz std %f6, [%i1 + 8] 755 1.1 spz add %i1, 16, %i1 756 1.1 spz orn %g0, %l3, %l3 757 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 758 1.1 spz 759 1.1 spz brnz,pt %i2, .L128_ctr32_loop2x+4 760 1.1 spz orn %g0, %l3, %l3 761 1.1 spz 762 1.1 spz ret 763 1.1 spz restore 764 1.1 spz 765 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 766 1.1 spz .align 32 767 1.1 spz .L128_ctr32_loop2x: 768 1.1 spz ldx [%i0 + 0], %o0 769 1.1 spz ldx [%i0 + 8], %o1 770 1.1 spz ldx [%i0 + 16], %o2 771 1.1 spz brz,pt %l0, 4f 772 1.1 spz ldx [%i0 + 24], %o3 773 1.1 spz 774 1.1 spz ldx [%i0 + 32], %o4 775 1.1 spz sllx %o0, %l0, %o0 776 1.1 spz srlx %o1, %l1, %g1 777 1.1 spz or %g1, %o0, %o0 778 1.1 spz sllx %o1, %l0, %o1 779 1.1 spz srlx %o2, %l1, %g1 780 1.1 spz or %g1, %o1, %o1 781 1.1 spz sllx %o2, %l0, %o2 782 1.1 spz srlx %o3, %l1, %g1 783 1.1 spz or %g1, %o2, %o2 784 1.1 spz sllx %o3, %l0, %o3 785 1.1 spz srlx %o4, %l1, %o4 786 1.1 spz or %o4, %o3, %o3 787 1.1 spz 4: 788 1.1 spz xor %g5, %l7, %g1 ! ^= rk[0] 789 1.1 spz add %l7, 1, %l7 790 1.1 spz .word 0x85b02301 !movxtod %g1,%f2 791 1.1 spz srl %l7, 0, %l7 ! clruw 792 1.1 spz xor %g5, %l7, %g1 793 1.1 spz add %l7, 1, %l7 794 1.1 spz .word 0x8db02301 !movxtod %g1,%f6 795 1.1 spz srl %l7, 0, %l7 ! clruw 796 1.1 spz prefetch [%i1 + 63], 22 797 1.1 spz prefetch [%i0 + 32+63], 20 798 1.1 spz .word 0x90cc040e !aes_eround01 %f16,%f14,%f2,%f8 799 1.1 spz .word 0x84cc842e !aes_eround23 %f18,%f14,%f2,%f2 800 1.1 spz .word 0x94cc0c0e !aes_eround01 %f16,%f14,%f6,%f10 801 1.1 spz .word 0x8ccc8c2e !aes_eround23 %f18,%f14,%f6,%f6 802 1.1 spz call _aes128_encrypt_2x+16 803 1.1 spz add %i0, 32, %i0 804 1.1 spz 805 1.1 spz .word 0x91b02308 !movxtod %o0,%f8 806 1.1 spz .word 0x95b02309 !movxtod %o1,%f10 807 1.1 spz .word 0x99b0230a !movxtod %o2,%f12 808 1.1 spz .word 0x81b20d80 !fxor %f8,%f0,%f0 ! ^= inp 809 1.1 spz .word 0x91b0230b !movxtod %o3,%f8 810 1.1 spz .word 0x85b28d82 !fxor %f10,%f2,%f2 811 1.1 spz .word 0x89b30d84 !fxor %f12,%f4,%f4 812 1.1 spz .word 0x8db20d86 !fxor %f8,%f6,%f6 813 1.1 spz 814 1.1 spz brnz,pn %l2, 2f 815 1.1 spz sub %i2, 2, %i2 816 1.5 christos 817 1.1 spz std %f0, [%i1 + 0] 818 1.1 spz std %f2, [%i1 + 8] 819 1.1 spz std %f4, [%i1 + 16] 820 1.1 spz std %f6, [%i1 + 24] 821 1.1 spz brnz,pt %i2, .L128_ctr32_loop2x 822 1.1 spz add %i1, 32, %i1 823 1.1 spz 824 1.1 spz ret 825 1.1 spz restore 826 1.1 spz 827 1.1 spz .align 16 828 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 829 1.1 spz ! and ~3x deterioration 830 1.1 spz ! in inp==out case 831 1.1 spz .word 0x91b00900 !faligndata %f0,%f0,%f8 ! handle unaligned output 832 1.1 spz .word 0x81b00902 !faligndata %f0,%f2,%f0 833 1.1 spz .word 0x85b08904 !faligndata %f2,%f4,%f2 834 1.1 spz .word 0x89b10906 !faligndata %f4,%f6,%f4 835 1.1 spz .word 0x8db18906 !faligndata %f6,%f6,%f6 836 1.1 spz 837 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 838 1.1 spz std %f0, [%i1 + 8] 839 1.1 spz std %f2, [%i1 + 16] 840 1.1 spz std %f4, [%i1 + 24] 841 1.1 spz add %i1, 32, %i1 842 1.1 spz orn %g0, %l3, %l3 843 1.1 spz stda %f6, [%i1 + %l3]0xc0 ! partial store 844 1.1 spz 845 1.1 spz brnz,pt %i2, .L128_ctr32_loop2x+4 846 1.1 spz orn %g0, %l3, %l3 847 1.1 spz 848 1.1 spz ret 849 1.1 spz restore 850 1.1 spz 851 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 852 1.1 spz .align 32 853 1.1 spz .L128_ctr32_blk: 854 1.1 spz add %i1, %i2, %l5 855 1.1 spz and %l5, 63, %l5 ! tail 856 1.1 spz sub %i2, %l5, %i2 857 1.1 spz add %l5, 15, %l5 ! round up to 16n 858 1.1 spz srlx %i2, 4, %i2 859 1.1 spz srl %l5, 4, %l5 860 1.1 spz sub %i2, 1, %i2 861 1.1 spz add %l5, 1, %l5 862 1.1 spz 863 1.1 spz .L128_ctr32_blk_loop2x: 864 1.1 spz ldx [%i0 + 0], %o0 865 1.1 spz ldx [%i0 + 8], %o1 866 1.1 spz ldx [%i0 + 16], %o2 867 1.1 spz brz,pt %l0, 5f 868 1.1 spz ldx [%i0 + 24], %o3 869 1.1 spz 870 1.1 spz ldx [%i0 + 32], %o4 871 1.1 spz sllx %o0, %l0, %o0 872 1.1 spz srlx %o1, %l1, %g1 873 1.1 spz or %g1, %o0, %o0 874 1.1 spz sllx %o1, %l0, %o1 875 1.1 spz srlx %o2, %l1, %g1 876 1.1 spz or %g1, %o1, %o1 877 1.1 spz sllx %o2, %l0, %o2 878 1.1 spz srlx %o3, %l1, %g1 879 1.1 spz or %g1, %o2, %o2 880 1.1 spz sllx %o3, %l0, %o3 881 1.1 spz srlx %o4, %l1, %o4 882 1.1 spz or %o4, %o3, %o3 883 1.1 spz 5: 884 1.1 spz xor %g5, %l7, %g1 ! ^= rk[0] 885 1.1 spz add %l7, 1, %l7 886 1.1 spz .word 0x85b02301 !movxtod %g1,%f2 887 1.1 spz srl %l7, 0, %l7 ! clruw 888 1.1 spz xor %g5, %l7, %g1 889 1.1 spz add %l7, 1, %l7 890 1.1 spz .word 0x8db02301 !movxtod %g1,%f6 891 1.1 spz srl %l7, 0, %l7 ! clruw 892 1.1 spz prefetch [%i0 + 32+63], 20 893 1.1 spz .word 0x90cc040e !aes_eround01 %f16,%f14,%f2,%f8 894 1.1 spz .word 0x84cc842e !aes_eround23 %f18,%f14,%f2,%f2 895 1.1 spz .word 0x94cc0c0e !aes_eround01 %f16,%f14,%f6,%f10 896 1.1 spz .word 0x8ccc8c2e !aes_eround23 %f18,%f14,%f6,%f6 897 1.1 spz call _aes128_encrypt_2x+16 898 1.1 spz add %i0, 32, %i0 899 1.1 spz subcc %i2, 2, %i2 900 1.1 spz 901 1.1 spz .word 0x91b02308 !movxtod %o0,%f8 902 1.1 spz .word 0x95b02309 !movxtod %o1,%f10 903 1.1 spz .word 0x99b0230a !movxtod %o2,%f12 904 1.1 spz .word 0x81b20d80 !fxor %f8,%f0,%f0 ! ^= inp 905 1.1 spz .word 0x91b0230b !movxtod %o3,%f8 906 1.1 spz .word 0x85b28d82 !fxor %f10,%f2,%f2 907 1.1 spz .word 0x89b30d84 !fxor %f12,%f4,%f4 908 1.1 spz .word 0x8db20d86 !fxor %f8,%f6,%f6 909 1.1 spz 910 1.1 spz stda %f0, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 911 1.1 spz add %i1, 8, %i1 912 1.1 spz stda %f2, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 913 1.1 spz add %i1, 8, %i1 914 1.1 spz stda %f4, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 915 1.1 spz add %i1, 8, %i1 916 1.1 spz stda %f6, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 917 1.4 martin bgu,pt SIZE_T_CC, .L128_ctr32_blk_loop2x 918 1.1 spz add %i1, 8, %i1 919 1.1 spz 920 1.1 spz add %l5, %i2, %i2 921 1.1 spz andcc %i2, 1, %g0 ! is number of blocks even? 922 1.1 spz membar #StoreLoad|#StoreStore 923 1.1 spz bnz,pt %icc, .L128_ctr32_loop 924 1.1 spz srl %i2, 0, %i2 925 1.1 spz brnz,pn %i2, .L128_ctr32_loop2x 926 1.1 spz nop 927 1.1 spz 928 1.1 spz ret 929 1.1 spz restore 930 1.1 spz .type aes128_t4_ctr32_encrypt,#function 931 1.1 spz .size aes128_t4_ctr32_encrypt,.-aes128_t4_ctr32_encrypt 932 1.1 spz .globl aes128_t4_xts_encrypt 933 1.1 spz .align 32 934 1.1 spz aes128_t4_xts_encrypt: 935 1.4 martin save %sp, -STACK_FRAME-16, %sp 936 1.1 spz srln %i2, 0, %i2 ! needed on v8+, "nop" on v9 937 1.1 spz 938 1.1 spz mov %i5, %o0 939 1.4 martin add %fp, STACK_BIAS-16, %o1 940 1.1 spz call aes_t4_encrypt 941 1.1 spz mov %i4, %o2 942 1.1 spz 943 1.4 martin add %fp, STACK_BIAS-16, %l7 944 1.1 spz ldxa [%l7]0x88, %g2 945 1.4 martin add %fp, STACK_BIAS-8, %l7 946 1.1 spz ldxa [%l7]0x88, %g3 ! %g3:%g2 is tweak 947 1.1 spz 948 1.1 spz sethi %hi(0x76543210), %l7 949 1.1 spz or %l7, %lo(0x76543210), %l7 950 1.1 spz .word 0x81b5c320 !bmask %l7,%g0,%g0 ! byte swap mask 951 1.1 spz 952 1.1 spz prefetch [%i0], 20 953 1.1 spz prefetch [%i0 + 63], 20 954 1.1 spz call _aes128_load_enckey 955 1.1 spz and %i2, 15, %i5 956 1.1 spz and %i2, -16, %i2 957 1.1 spz 958 1.1 spz sub %i0, %i1, %l5 ! %i0!=%i1 959 1.1 spz and %i0, 7, %l0 960 1.1 spz andn %i0, 7, %i0 961 1.1 spz sll %l0, 3, %l0 962 1.1 spz mov 64, %l1 963 1.1 spz mov 0xff, %l3 964 1.1 spz sub %l1, %l0, %l1 965 1.1 spz and %i1, 7, %l2 966 1.1 spz cmp %i2, 255 967 1.1 spz movrnz %l2, 0, %l5 ! if ( %i1&7 || 968 1.4 martin movleu SIZE_T_CC, 0, %l5 ! %i2<256 || 969 1.1 spz brnz,pn %l5, .L128_xts_enblk ! %i0==%i1) 970 1.1 spz srl %l3, %l2, %l3 971 1.1 spz 972 1.1 spz andcc %i2, 16, %g0 ! is number of blocks even? 973 1.1 spz .word 0xb3b64340 !alignaddrl %i1,%g0,%i1 974 1.1 spz bz %icc, .L128_xts_enloop2x 975 1.1 spz srlx %i2, 4, %i2 976 1.1 spz .L128_xts_enloop: 977 1.1 spz ldx [%i0 + 0], %o0 978 1.1 spz brz,pt %l0, 4f 979 1.1 spz ldx [%i0 + 8], %o1 980 1.1 spz 981 1.1 spz ldx [%i0 + 16], %o2 982 1.1 spz sllx %o0, %l0, %o0 983 1.1 spz srlx %o1, %l1, %g1 984 1.1 spz sllx %o1, %l0, %o1 985 1.1 spz or %g1, %o0, %o0 986 1.1 spz srlx %o2, %l1, %o2 987 1.1 spz or %o2, %o1, %o1 988 1.1 spz 4: 989 1.1 spz .word 0x99b02302 !movxtod %g2,%f12 990 1.1 spz .word 0x9db02303 !movxtod %g3,%f14 991 1.1 spz .word 0x99b3098c !bshuffle %f12,%f12,%f12 992 1.1 spz .word 0x9db3898e !bshuffle %f14,%f14,%f14 993 1.1 spz 994 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 995 1.1 spz xor %g5, %o1, %o1 996 1.1 spz .word 0x81b02308 !movxtod %o0,%f0 997 1.1 spz .word 0x85b02309 !movxtod %o1,%f2 998 1.1 spz 999 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 1000 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1001 1.1 spz 1002 1.1 spz prefetch [%i1 + 63], 22 1003 1.1 spz prefetch [%i0 + 16+63], 20 1004 1.1 spz call _aes128_encrypt_1x 1005 1.1 spz add %i0, 16, %i0 1006 1.1 spz 1007 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 1008 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1009 1.1 spz 1010 1.1 spz srax %g3, 63, %l7 ! next tweak value 1011 1.1 spz addcc %g2, %g2, %g2 1012 1.1 spz and %l7, 0x87, %l7 1013 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 1014 1.1 spz xor %l7, %g2, %g2 1015 1.1 spz 1016 1.1 spz brnz,pn %l2, 2f 1017 1.1 spz sub %i2, 1, %i2 1018 1.5 christos 1019 1.1 spz std %f0, [%i1 + 0] 1020 1.1 spz std %f2, [%i1 + 8] 1021 1.1 spz brnz,pt %i2, .L128_xts_enloop2x 1022 1.1 spz add %i1, 16, %i1 1023 1.1 spz 1024 1.1 spz brnz,pn %i5, .L128_xts_ensteal 1025 1.1 spz nop 1026 1.1 spz 1027 1.1 spz ret 1028 1.1 spz restore 1029 1.1 spz 1030 1.1 spz .align 16 1031 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 1032 1.1 spz ! and ~3x deterioration 1033 1.1 spz ! in inp==out case 1034 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 ! handle unaligned output 1035 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 1036 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 1037 1.1 spz stda %f4, [%i1 + %l3]0xc0 ! partial store 1038 1.1 spz std %f6, [%i1 + 8] 1039 1.1 spz add %i1, 16, %i1 1040 1.1 spz orn %g0, %l3, %l3 1041 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 1042 1.1 spz 1043 1.1 spz brnz,pt %i2, .L128_xts_enloop2x+4 1044 1.1 spz orn %g0, %l3, %l3 1045 1.1 spz 1046 1.1 spz brnz,pn %i5, .L128_xts_ensteal 1047 1.1 spz nop 1048 1.1 spz 1049 1.1 spz ret 1050 1.1 spz restore 1051 1.1 spz 1052 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1053 1.1 spz .align 32 1054 1.1 spz .L128_xts_enloop2x: 1055 1.1 spz ldx [%i0 + 0], %o0 1056 1.1 spz ldx [%i0 + 8], %o1 1057 1.1 spz ldx [%i0 + 16], %o2 1058 1.1 spz brz,pt %l0, 4f 1059 1.1 spz ldx [%i0 + 24], %o3 1060 1.1 spz 1061 1.1 spz ldx [%i0 + 32], %o4 1062 1.1 spz sllx %o0, %l0, %o0 1063 1.1 spz srlx %o1, %l1, %g1 1064 1.1 spz or %g1, %o0, %o0 1065 1.1 spz sllx %o1, %l0, %o1 1066 1.1 spz srlx %o2, %l1, %g1 1067 1.1 spz or %g1, %o1, %o1 1068 1.1 spz sllx %o2, %l0, %o2 1069 1.1 spz srlx %o3, %l1, %g1 1070 1.1 spz or %g1, %o2, %o2 1071 1.1 spz sllx %o3, %l0, %o3 1072 1.1 spz srlx %o4, %l1, %o4 1073 1.1 spz or %o4, %o3, %o3 1074 1.1 spz 4: 1075 1.1 spz .word 0x99b02302 !movxtod %g2,%f12 1076 1.1 spz .word 0x9db02303 !movxtod %g3,%f14 1077 1.1 spz .word 0x99b3098c !bshuffle %f12,%f12,%f12 1078 1.1 spz .word 0x9db3898e !bshuffle %f14,%f14,%f14 1079 1.1 spz 1080 1.1 spz srax %g3, 63, %l7 ! next tweak value 1081 1.1 spz addcc %g2, %g2, %g2 1082 1.1 spz and %l7, 0x87, %l7 1083 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 1084 1.1 spz xor %l7, %g2, %g2 1085 1.1 spz 1086 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 1087 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 1088 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 1089 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 1090 1.1 spz 1091 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 1092 1.1 spz xor %g5, %o1, %o1 1093 1.1 spz xor %g4, %o2, %o2 ! ^= rk[0] 1094 1.1 spz xor %g5, %o3, %o3 1095 1.1 spz .word 0x81b02308 !movxtod %o0,%f0 1096 1.1 spz .word 0x85b02309 !movxtod %o1,%f2 1097 1.1 spz .word 0x89b0230a !movxtod %o2,%f4 1098 1.1 spz .word 0x8db0230b !movxtod %o3,%f6 1099 1.1 spz 1100 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 1101 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1102 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 ! ^= tweak[0] 1103 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 1104 1.1 spz 1105 1.1 spz prefetch [%i1 + 63], 22 1106 1.1 spz prefetch [%i0 + 32+63], 20 1107 1.1 spz call _aes128_encrypt_2x 1108 1.1 spz add %i0, 32, %i0 1109 1.1 spz 1110 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 1111 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 1112 1.1 spz 1113 1.1 spz srax %g3, 63, %l7 ! next tweak value 1114 1.1 spz addcc %g2, %g2, %g2 1115 1.1 spz and %l7, 0x87, %l7 1116 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 1117 1.1 spz xor %l7, %g2, %g2 1118 1.1 spz 1119 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 1120 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 1121 1.1 spz 1122 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 1123 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1124 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 1125 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 1126 1.1 spz 1127 1.1 spz brnz,pn %l2, 2f 1128 1.1 spz sub %i2, 2, %i2 1129 1.5 christos 1130 1.1 spz std %f0, [%i1 + 0] 1131 1.1 spz std %f2, [%i1 + 8] 1132 1.1 spz std %f4, [%i1 + 16] 1133 1.1 spz std %f6, [%i1 + 24] 1134 1.1 spz brnz,pt %i2, .L128_xts_enloop2x 1135 1.1 spz add %i1, 32, %i1 1136 1.1 spz 1137 1.1 spz .word 0x81b00f04 !fsrc2 %f0,%f4,%f0 1138 1.1 spz .word 0x85b00f06 !fsrc2 %f0,%f6,%f2 1139 1.1 spz brnz,pn %i5, .L128_xts_ensteal 1140 1.1 spz nop 1141 1.1 spz 1142 1.1 spz ret 1143 1.1 spz restore 1144 1.1 spz 1145 1.1 spz .align 16 1146 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 1147 1.1 spz ! and ~3x deterioration 1148 1.1 spz ! in inp==out case 1149 1.1 spz .word 0x91b00900 !faligndata %f0,%f0,%f8 ! handle unaligned output 1150 1.1 spz .word 0x95b00902 !faligndata %f0,%f2,%f10 1151 1.1 spz .word 0x99b08904 !faligndata %f2,%f4,%f12 1152 1.1 spz .word 0x9db10906 !faligndata %f4,%f6,%f14 1153 1.1 spz .word 0x81b18906 !faligndata %f6,%f6,%f0 1154 1.1 spz 1155 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 1156 1.1 spz std %f10, [%i1 + 8] 1157 1.1 spz std %f12, [%i1 + 16] 1158 1.1 spz std %f14, [%i1 + 24] 1159 1.1 spz add %i1, 32, %i1 1160 1.1 spz orn %g0, %l3, %l3 1161 1.1 spz stda %f0, [%i1 + %l3]0xc0 ! partial store 1162 1.1 spz 1163 1.1 spz brnz,pt %i2, .L128_xts_enloop2x+4 1164 1.1 spz orn %g0, %l3, %l3 1165 1.1 spz 1166 1.1 spz .word 0x81b00f04 !fsrc2 %f0,%f4,%f0 1167 1.1 spz .word 0x85b00f06 !fsrc2 %f0,%f6,%f2 1168 1.1 spz brnz,pn %i5, .L128_xts_ensteal 1169 1.1 spz nop 1170 1.1 spz 1171 1.1 spz ret 1172 1.1 spz restore 1173 1.1 spz 1174 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1175 1.1 spz .align 32 1176 1.1 spz .L128_xts_enblk: 1177 1.1 spz add %i1, %i2, %l5 1178 1.1 spz and %l5, 63, %l5 ! tail 1179 1.1 spz sub %i2, %l5, %i2 1180 1.1 spz add %l5, 15, %l5 ! round up to 16n 1181 1.1 spz srlx %i2, 4, %i2 1182 1.1 spz srl %l5, 4, %l5 1183 1.1 spz sub %i2, 1, %i2 1184 1.1 spz add %l5, 1, %l5 1185 1.1 spz 1186 1.1 spz .L128_xts_enblk2x: 1187 1.1 spz ldx [%i0 + 0], %o0 1188 1.1 spz ldx [%i0 + 8], %o1 1189 1.1 spz ldx [%i0 + 16], %o2 1190 1.1 spz brz,pt %l0, 5f 1191 1.1 spz ldx [%i0 + 24], %o3 1192 1.1 spz 1193 1.1 spz ldx [%i0 + 32], %o4 1194 1.1 spz sllx %o0, %l0, %o0 1195 1.1 spz srlx %o1, %l1, %g1 1196 1.1 spz or %g1, %o0, %o0 1197 1.1 spz sllx %o1, %l0, %o1 1198 1.1 spz srlx %o2, %l1, %g1 1199 1.1 spz or %g1, %o1, %o1 1200 1.1 spz sllx %o2, %l0, %o2 1201 1.1 spz srlx %o3, %l1, %g1 1202 1.1 spz or %g1, %o2, %o2 1203 1.1 spz sllx %o3, %l0, %o3 1204 1.1 spz srlx %o4, %l1, %o4 1205 1.1 spz or %o4, %o3, %o3 1206 1.1 spz 5: 1207 1.1 spz .word 0x99b02302 !movxtod %g2,%f12 1208 1.1 spz .word 0x9db02303 !movxtod %g3,%f14 1209 1.1 spz .word 0x99b3098c !bshuffle %f12,%f12,%f12 1210 1.1 spz .word 0x9db3898e !bshuffle %f14,%f14,%f14 1211 1.1 spz 1212 1.1 spz srax %g3, 63, %l7 ! next tweak value 1213 1.1 spz addcc %g2, %g2, %g2 1214 1.1 spz and %l7, 0x87, %l7 1215 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 1216 1.1 spz xor %l7, %g2, %g2 1217 1.1 spz 1218 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 1219 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 1220 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 1221 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 1222 1.1 spz 1223 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 1224 1.1 spz xor %g5, %o1, %o1 1225 1.1 spz xor %g4, %o2, %o2 ! ^= rk[0] 1226 1.1 spz xor %g5, %o3, %o3 1227 1.1 spz .word 0x81b02308 !movxtod %o0,%f0 1228 1.1 spz .word 0x85b02309 !movxtod %o1,%f2 1229 1.1 spz .word 0x89b0230a !movxtod %o2,%f4 1230 1.1 spz .word 0x8db0230b !movxtod %o3,%f6 1231 1.1 spz 1232 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 1233 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1234 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 ! ^= tweak[0] 1235 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 1236 1.1 spz 1237 1.1 spz prefetch [%i0 + 32+63], 20 1238 1.1 spz call _aes128_encrypt_2x 1239 1.1 spz add %i0, 32, %i0 1240 1.1 spz 1241 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 1242 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 1243 1.1 spz 1244 1.1 spz srax %g3, 63, %l7 ! next tweak value 1245 1.1 spz addcc %g2, %g2, %g2 1246 1.1 spz and %l7, 0x87, %l7 1247 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 1248 1.1 spz xor %l7, %g2, %g2 1249 1.1 spz 1250 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 1251 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 1252 1.1 spz 1253 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 1254 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1255 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 1256 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 1257 1.1 spz 1258 1.1 spz subcc %i2, 2, %i2 1259 1.1 spz stda %f0, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 1260 1.1 spz add %i1, 8, %i1 1261 1.1 spz stda %f2, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 1262 1.1 spz add %i1, 8, %i1 1263 1.1 spz stda %f4, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 1264 1.1 spz add %i1, 8, %i1 1265 1.1 spz stda %f6, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 1266 1.4 martin bgu,pt SIZE_T_CC, .L128_xts_enblk2x 1267 1.1 spz add %i1, 8, %i1 1268 1.1 spz 1269 1.1 spz add %l5, %i2, %i2 1270 1.1 spz andcc %i2, 1, %g0 ! is number of blocks even? 1271 1.1 spz membar #StoreLoad|#StoreStore 1272 1.1 spz bnz,pt %icc, .L128_xts_enloop 1273 1.1 spz srl %i2, 0, %i2 1274 1.1 spz brnz,pn %i2, .L128_xts_enloop2x 1275 1.1 spz nop 1276 1.1 spz 1277 1.1 spz .word 0x81b00f04 !fsrc2 %f0,%f4,%f0 1278 1.1 spz .word 0x85b00f06 !fsrc2 %f0,%f6,%f2 1279 1.1 spz brnz,pn %i5, .L128_xts_ensteal 1280 1.1 spz nop 1281 1.1 spz 1282 1.1 spz ret 1283 1.1 spz restore 1284 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1285 1.1 spz .align 32 1286 1.1 spz .L128_xts_ensteal: 1287 1.4 martin std %f0, [%fp + STACK_BIAS-16] ! copy of output 1288 1.4 martin std %f2, [%fp + STACK_BIAS-8] 1289 1.1 spz 1290 1.1 spz srl %l0, 3, %l0 1291 1.4 martin add %fp, STACK_BIAS-16, %l7 1292 1.1 spz add %i0, %l0, %i0 ! original %i0+%i2&-15 1293 1.1 spz add %i1, %l2, %i1 ! original %i1+%i2&-15 1294 1.1 spz mov 0, %l0 1295 1.1 spz nop ! align 1296 1.1 spz 1297 1.1 spz .L128_xts_enstealing: 1298 1.1 spz ldub [%i0 + %l0], %o0 1299 1.1 spz ldub [%l7 + %l0], %o1 1300 1.1 spz dec %i5 1301 1.1 spz stb %o0, [%l7 + %l0] 1302 1.1 spz stb %o1, [%i1 + %l0] 1303 1.1 spz brnz %i5, .L128_xts_enstealing 1304 1.1 spz inc %l0 1305 1.1 spz 1306 1.1 spz mov %l7, %i0 1307 1.1 spz sub %i1, 16, %i1 1308 1.1 spz mov 0, %l0 1309 1.1 spz sub %i1, %l2, %i1 1310 1.1 spz ba .L128_xts_enloop ! one more time 1311 1.1 spz mov 1, %i2 ! %i5 is 0 1312 1.1 spz ret 1313 1.1 spz restore 1314 1.1 spz .type aes128_t4_xts_encrypt,#function 1315 1.1 spz .size aes128_t4_xts_encrypt,.-aes128_t4_xts_encrypt 1316 1.1 spz .globl aes128_t4_xts_decrypt 1317 1.1 spz .align 32 1318 1.1 spz aes128_t4_xts_decrypt: 1319 1.4 martin save %sp, -STACK_FRAME-16, %sp 1320 1.1 spz srln %i2, 0, %i2 ! needed on v8+, "nop" on v9 1321 1.1 spz 1322 1.1 spz mov %i5, %o0 1323 1.4 martin add %fp, STACK_BIAS-16, %o1 1324 1.1 spz call aes_t4_encrypt 1325 1.1 spz mov %i4, %o2 1326 1.1 spz 1327 1.4 martin add %fp, STACK_BIAS-16, %l7 1328 1.1 spz ldxa [%l7]0x88, %g2 1329 1.4 martin add %fp, STACK_BIAS-8, %l7 1330 1.1 spz ldxa [%l7]0x88, %g3 ! %g3:%g2 is tweak 1331 1.1 spz 1332 1.1 spz sethi %hi(0x76543210), %l7 1333 1.1 spz or %l7, %lo(0x76543210), %l7 1334 1.1 spz .word 0x81b5c320 !bmask %l7,%g0,%g0 ! byte swap mask 1335 1.1 spz 1336 1.1 spz prefetch [%i0], 20 1337 1.1 spz prefetch [%i0 + 63], 20 1338 1.1 spz call _aes128_load_deckey 1339 1.1 spz and %i2, 15, %i5 1340 1.1 spz and %i2, -16, %i2 1341 1.1 spz mov 0, %l7 1342 1.1 spz movrnz %i5, 16, %l7 1343 1.1 spz sub %i2, %l7, %i2 1344 1.1 spz 1345 1.1 spz sub %i0, %i1, %l5 ! %i0!=%i1 1346 1.1 spz and %i0, 7, %l0 1347 1.1 spz andn %i0, 7, %i0 1348 1.1 spz sll %l0, 3, %l0 1349 1.1 spz mov 64, %l1 1350 1.1 spz mov 0xff, %l3 1351 1.1 spz sub %l1, %l0, %l1 1352 1.1 spz and %i1, 7, %l2 1353 1.1 spz cmp %i2, 255 1354 1.1 spz movrnz %l2, 0, %l5 ! if ( %i1&7 || 1355 1.4 martin movleu SIZE_T_CC, 0, %l5 ! %i2<256 || 1356 1.1 spz brnz,pn %l5, .L128_xts_deblk ! %i0==%i1) 1357 1.1 spz srl %l3, %l2, %l3 1358 1.1 spz 1359 1.1 spz andcc %i2, 16, %g0 ! is number of blocks even? 1360 1.1 spz brz,pn %i2, .L128_xts_desteal 1361 1.1 spz .word 0xb3b64340 !alignaddrl %i1,%g0,%i1 1362 1.1 spz bz %icc, .L128_xts_deloop2x 1363 1.1 spz srlx %i2, 4, %i2 1364 1.1 spz .L128_xts_deloop: 1365 1.1 spz ldx [%i0 + 0], %o0 1366 1.1 spz brz,pt %l0, 4f 1367 1.1 spz ldx [%i0 + 8], %o1 1368 1.1 spz 1369 1.1 spz ldx [%i0 + 16], %o2 1370 1.1 spz sllx %o0, %l0, %o0 1371 1.1 spz srlx %o1, %l1, %g1 1372 1.1 spz sllx %o1, %l0, %o1 1373 1.1 spz or %g1, %o0, %o0 1374 1.1 spz srlx %o2, %l1, %o2 1375 1.1 spz or %o2, %o1, %o1 1376 1.1 spz 4: 1377 1.1 spz .word 0x99b02302 !movxtod %g2,%f12 1378 1.1 spz .word 0x9db02303 !movxtod %g3,%f14 1379 1.1 spz .word 0x99b3098c !bshuffle %f12,%f12,%f12 1380 1.1 spz .word 0x9db3898e !bshuffle %f14,%f14,%f14 1381 1.1 spz 1382 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 1383 1.1 spz xor %g5, %o1, %o1 1384 1.1 spz .word 0x81b02308 !movxtod %o0,%f0 1385 1.1 spz .word 0x85b02309 !movxtod %o1,%f2 1386 1.1 spz 1387 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 1388 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1389 1.1 spz 1390 1.1 spz prefetch [%i1 + 63], 22 1391 1.1 spz prefetch [%i0 + 16+63], 20 1392 1.1 spz call _aes128_decrypt_1x 1393 1.1 spz add %i0, 16, %i0 1394 1.1 spz 1395 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 1396 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1397 1.1 spz 1398 1.1 spz srax %g3, 63, %l7 ! next tweak value 1399 1.1 spz addcc %g2, %g2, %g2 1400 1.1 spz and %l7, 0x87, %l7 1401 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 1402 1.1 spz xor %l7, %g2, %g2 1403 1.1 spz 1404 1.1 spz brnz,pn %l2, 2f 1405 1.1 spz sub %i2, 1, %i2 1406 1.5 christos 1407 1.1 spz std %f0, [%i1 + 0] 1408 1.1 spz std %f2, [%i1 + 8] 1409 1.1 spz brnz,pt %i2, .L128_xts_deloop2x 1410 1.1 spz add %i1, 16, %i1 1411 1.1 spz 1412 1.1 spz brnz,pn %i5, .L128_xts_desteal 1413 1.1 spz nop 1414 1.1 spz 1415 1.1 spz ret 1416 1.1 spz restore 1417 1.1 spz 1418 1.1 spz .align 16 1419 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 1420 1.1 spz ! and ~3x deterioration 1421 1.1 spz ! in inp==out case 1422 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 ! handle unaligned output 1423 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 1424 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 1425 1.1 spz stda %f4, [%i1 + %l3]0xc0 ! partial store 1426 1.1 spz std %f6, [%i1 + 8] 1427 1.1 spz add %i1, 16, %i1 1428 1.1 spz orn %g0, %l3, %l3 1429 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 1430 1.1 spz 1431 1.1 spz brnz,pt %i2, .L128_xts_deloop2x+4 1432 1.1 spz orn %g0, %l3, %l3 1433 1.1 spz 1434 1.1 spz brnz,pn %i5, .L128_xts_desteal 1435 1.1 spz nop 1436 1.1 spz 1437 1.1 spz ret 1438 1.1 spz restore 1439 1.1 spz 1440 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1441 1.1 spz .align 32 1442 1.1 spz .L128_xts_deloop2x: 1443 1.1 spz ldx [%i0 + 0], %o0 1444 1.1 spz ldx [%i0 + 8], %o1 1445 1.1 spz ldx [%i0 + 16], %o2 1446 1.1 spz brz,pt %l0, 4f 1447 1.1 spz ldx [%i0 + 24], %o3 1448 1.1 spz 1449 1.1 spz ldx [%i0 + 32], %o4 1450 1.1 spz sllx %o0, %l0, %o0 1451 1.1 spz srlx %o1, %l1, %g1 1452 1.1 spz or %g1, %o0, %o0 1453 1.1 spz sllx %o1, %l0, %o1 1454 1.1 spz srlx %o2, %l1, %g1 1455 1.1 spz or %g1, %o1, %o1 1456 1.1 spz sllx %o2, %l0, %o2 1457 1.1 spz srlx %o3, %l1, %g1 1458 1.1 spz or %g1, %o2, %o2 1459 1.1 spz sllx %o3, %l0, %o3 1460 1.1 spz srlx %o4, %l1, %o4 1461 1.1 spz or %o4, %o3, %o3 1462 1.1 spz 4: 1463 1.1 spz .word 0x99b02302 !movxtod %g2,%f12 1464 1.1 spz .word 0x9db02303 !movxtod %g3,%f14 1465 1.1 spz .word 0x99b3098c !bshuffle %f12,%f12,%f12 1466 1.1 spz .word 0x9db3898e !bshuffle %f14,%f14,%f14 1467 1.1 spz 1468 1.1 spz srax %g3, 63, %l7 ! next tweak value 1469 1.1 spz addcc %g2, %g2, %g2 1470 1.1 spz and %l7, 0x87, %l7 1471 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 1472 1.1 spz xor %l7, %g2, %g2 1473 1.1 spz 1474 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 1475 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 1476 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 1477 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 1478 1.1 spz 1479 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 1480 1.1 spz xor %g5, %o1, %o1 1481 1.1 spz xor %g4, %o2, %o2 ! ^= rk[0] 1482 1.1 spz xor %g5, %o3, %o3 1483 1.1 spz .word 0x81b02308 !movxtod %o0,%f0 1484 1.1 spz .word 0x85b02309 !movxtod %o1,%f2 1485 1.1 spz .word 0x89b0230a !movxtod %o2,%f4 1486 1.1 spz .word 0x8db0230b !movxtod %o3,%f6 1487 1.1 spz 1488 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 1489 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1490 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 ! ^= tweak[0] 1491 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 1492 1.1 spz 1493 1.1 spz prefetch [%i1 + 63], 22 1494 1.1 spz prefetch [%i0 + 32+63], 20 1495 1.1 spz call _aes128_decrypt_2x 1496 1.1 spz add %i0, 32, %i0 1497 1.1 spz 1498 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 1499 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 1500 1.1 spz 1501 1.1 spz srax %g3, 63, %l7 ! next tweak value 1502 1.1 spz addcc %g2, %g2, %g2 1503 1.1 spz and %l7, 0x87, %l7 1504 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 1505 1.1 spz xor %l7, %g2, %g2 1506 1.1 spz 1507 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 1508 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 1509 1.1 spz 1510 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 1511 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1512 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 1513 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 1514 1.1 spz 1515 1.1 spz brnz,pn %l2, 2f 1516 1.1 spz sub %i2, 2, %i2 1517 1.5 christos 1518 1.1 spz std %f0, [%i1 + 0] 1519 1.1 spz std %f2, [%i1 + 8] 1520 1.1 spz std %f4, [%i1 + 16] 1521 1.1 spz std %f6, [%i1 + 24] 1522 1.1 spz brnz,pt %i2, .L128_xts_deloop2x 1523 1.1 spz add %i1, 32, %i1 1524 1.1 spz 1525 1.1 spz .word 0x81b00f04 !fsrc2 %f0,%f4,%f0 1526 1.1 spz .word 0x85b00f06 !fsrc2 %f0,%f6,%f2 1527 1.1 spz brnz,pn %i5, .L128_xts_desteal 1528 1.1 spz nop 1529 1.1 spz 1530 1.1 spz ret 1531 1.1 spz restore 1532 1.1 spz 1533 1.1 spz .align 16 1534 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 1535 1.1 spz ! and ~3x deterioration 1536 1.1 spz ! in inp==out case 1537 1.1 spz .word 0x91b00900 !faligndata %f0,%f0,%f8 ! handle unaligned output 1538 1.1 spz .word 0x95b00902 !faligndata %f0,%f2,%f10 1539 1.1 spz .word 0x99b08904 !faligndata %f2,%f4,%f12 1540 1.1 spz .word 0x9db10906 !faligndata %f4,%f6,%f14 1541 1.1 spz .word 0x81b18906 !faligndata %f6,%f6,%f0 1542 1.1 spz 1543 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 1544 1.1 spz std %f10, [%i1 + 8] 1545 1.1 spz std %f12, [%i1 + 16] 1546 1.1 spz std %f14, [%i1 + 24] 1547 1.1 spz add %i1, 32, %i1 1548 1.1 spz orn %g0, %l3, %l3 1549 1.1 spz stda %f0, [%i1 + %l3]0xc0 ! partial store 1550 1.1 spz 1551 1.1 spz brnz,pt %i2, .L128_xts_deloop2x+4 1552 1.1 spz orn %g0, %l3, %l3 1553 1.1 spz 1554 1.1 spz .word 0x81b00f04 !fsrc2 %f0,%f4,%f0 1555 1.1 spz .word 0x85b00f06 !fsrc2 %f0,%f6,%f2 1556 1.1 spz brnz,pn %i5, .L128_xts_desteal 1557 1.1 spz nop 1558 1.1 spz 1559 1.1 spz ret 1560 1.1 spz restore 1561 1.1 spz 1562 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1563 1.1 spz .align 32 1564 1.1 spz .L128_xts_deblk: 1565 1.1 spz add %i1, %i2, %l5 1566 1.1 spz and %l5, 63, %l5 ! tail 1567 1.1 spz sub %i2, %l5, %i2 1568 1.1 spz add %l5, 15, %l5 ! round up to 16n 1569 1.1 spz srlx %i2, 4, %i2 1570 1.1 spz srl %l5, 4, %l5 1571 1.1 spz sub %i2, 1, %i2 1572 1.1 spz add %l5, 1, %l5 1573 1.1 spz 1574 1.1 spz .L128_xts_deblk2x: 1575 1.1 spz ldx [%i0 + 0], %o0 1576 1.1 spz ldx [%i0 + 8], %o1 1577 1.1 spz ldx [%i0 + 16], %o2 1578 1.1 spz brz,pt %l0, 5f 1579 1.1 spz ldx [%i0 + 24], %o3 1580 1.1 spz 1581 1.1 spz ldx [%i0 + 32], %o4 1582 1.1 spz sllx %o0, %l0, %o0 1583 1.1 spz srlx %o1, %l1, %g1 1584 1.1 spz or %g1, %o0, %o0 1585 1.1 spz sllx %o1, %l0, %o1 1586 1.1 spz srlx %o2, %l1, %g1 1587 1.1 spz or %g1, %o1, %o1 1588 1.1 spz sllx %o2, %l0, %o2 1589 1.1 spz srlx %o3, %l1, %g1 1590 1.1 spz or %g1, %o2, %o2 1591 1.1 spz sllx %o3, %l0, %o3 1592 1.1 spz srlx %o4, %l1, %o4 1593 1.1 spz or %o4, %o3, %o3 1594 1.1 spz 5: 1595 1.1 spz .word 0x99b02302 !movxtod %g2,%f12 1596 1.1 spz .word 0x9db02303 !movxtod %g3,%f14 1597 1.1 spz .word 0x99b3098c !bshuffle %f12,%f12,%f12 1598 1.1 spz .word 0x9db3898e !bshuffle %f14,%f14,%f14 1599 1.1 spz 1600 1.1 spz srax %g3, 63, %l7 ! next tweak value 1601 1.1 spz addcc %g2, %g2, %g2 1602 1.1 spz and %l7, 0x87, %l7 1603 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 1604 1.1 spz xor %l7, %g2, %g2 1605 1.1 spz 1606 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 1607 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 1608 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 1609 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 1610 1.1 spz 1611 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 1612 1.1 spz xor %g5, %o1, %o1 1613 1.1 spz xor %g4, %o2, %o2 ! ^= rk[0] 1614 1.1 spz xor %g5, %o3, %o3 1615 1.1 spz .word 0x81b02308 !movxtod %o0,%f0 1616 1.1 spz .word 0x85b02309 !movxtod %o1,%f2 1617 1.1 spz .word 0x89b0230a !movxtod %o2,%f4 1618 1.1 spz .word 0x8db0230b !movxtod %o3,%f6 1619 1.1 spz 1620 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 1621 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1622 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 ! ^= tweak[0] 1623 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 1624 1.1 spz 1625 1.1 spz prefetch [%i0 + 32+63], 20 1626 1.1 spz call _aes128_decrypt_2x 1627 1.1 spz add %i0, 32, %i0 1628 1.1 spz 1629 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 1630 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 1631 1.1 spz 1632 1.1 spz srax %g3, 63, %l7 ! next tweak value 1633 1.1 spz addcc %g2, %g2, %g2 1634 1.1 spz and %l7, 0x87, %l7 1635 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 1636 1.1 spz xor %l7, %g2, %g2 1637 1.1 spz 1638 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 1639 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 1640 1.1 spz 1641 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 1642 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1643 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 1644 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 1645 1.1 spz 1646 1.1 spz subcc %i2, 2, %i2 1647 1.1 spz stda %f0, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 1648 1.1 spz add %i1, 8, %i1 1649 1.1 spz stda %f2, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 1650 1.1 spz add %i1, 8, %i1 1651 1.1 spz stda %f4, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 1652 1.1 spz add %i1, 8, %i1 1653 1.1 spz stda %f6, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 1654 1.4 martin bgu,pt SIZE_T_CC, .L128_xts_deblk2x 1655 1.1 spz add %i1, 8, %i1 1656 1.1 spz 1657 1.1 spz add %l5, %i2, %i2 1658 1.1 spz andcc %i2, 1, %g0 ! is number of blocks even? 1659 1.1 spz membar #StoreLoad|#StoreStore 1660 1.1 spz bnz,pt %icc, .L128_xts_deloop 1661 1.1 spz srl %i2, 0, %i2 1662 1.1 spz brnz,pn %i2, .L128_xts_deloop2x 1663 1.1 spz nop 1664 1.1 spz 1665 1.1 spz .word 0x81b00f04 !fsrc2 %f0,%f4,%f0 1666 1.1 spz .word 0x85b00f06 !fsrc2 %f0,%f6,%f2 1667 1.1 spz brnz,pn %i5, .L128_xts_desteal 1668 1.1 spz nop 1669 1.1 spz 1670 1.1 spz ret 1671 1.1 spz restore 1672 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1673 1.1 spz .align 32 1674 1.1 spz .L128_xts_desteal: 1675 1.1 spz ldx [%i0 + 0], %o0 1676 1.1 spz brz,pt %l0, 8f 1677 1.1 spz ldx [%i0 + 8], %o1 1678 1.1 spz 1679 1.1 spz ldx [%i0 + 16], %o2 1680 1.1 spz sllx %o0, %l0, %o0 1681 1.1 spz srlx %o1, %l1, %g1 1682 1.1 spz sllx %o1, %l0, %o1 1683 1.1 spz or %g1, %o0, %o0 1684 1.1 spz srlx %o2, %l1, %o2 1685 1.1 spz or %o2, %o1, %o1 1686 1.1 spz 8: 1687 1.1 spz srax %g3, 63, %l7 ! next tweak value 1688 1.1 spz addcc %g2, %g2, %o2 1689 1.1 spz and %l7, 0x87, %l7 1690 1.1 spz .word 0x97b0c223 !addxc %g3,%g3,%o3 1691 1.1 spz xor %l7, %o2, %o2 1692 1.1 spz 1693 1.1 spz .word 0x99b0230a !movxtod %o2,%f12 1694 1.1 spz .word 0x9db0230b !movxtod %o3,%f14 1695 1.1 spz .word 0x99b3098c !bshuffle %f12,%f12,%f12 1696 1.1 spz .word 0x9db3898e !bshuffle %f14,%f14,%f14 1697 1.1 spz 1698 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 1699 1.1 spz xor %g5, %o1, %o1 1700 1.1 spz .word 0x81b02308 !movxtod %o0,%f0 1701 1.1 spz .word 0x85b02309 !movxtod %o1,%f2 1702 1.1 spz 1703 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 1704 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1705 1.1 spz 1706 1.1 spz call _aes128_decrypt_1x 1707 1.1 spz add %i0, 16, %i0 1708 1.1 spz 1709 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 1710 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1711 1.1 spz 1712 1.4 martin std %f0, [%fp + STACK_BIAS-16] 1713 1.4 martin std %f2, [%fp + STACK_BIAS-8] 1714 1.1 spz 1715 1.1 spz srl %l0, 3, %l0 1716 1.4 martin add %fp, STACK_BIAS-16, %l7 1717 1.1 spz add %i0, %l0, %i0 ! original %i0+%i2&-15 1718 1.1 spz add %i1, %l2, %i1 ! original %i1+%i2&-15 1719 1.1 spz mov 0, %l0 1720 1.1 spz add %i1, 16, %i1 1721 1.1 spz nop ! align 1722 1.1 spz 1723 1.1 spz .L128_xts_destealing: 1724 1.1 spz ldub [%i0 + %l0], %o0 1725 1.1 spz ldub [%l7 + %l0], %o1 1726 1.1 spz dec %i5 1727 1.1 spz stb %o0, [%l7 + %l0] 1728 1.1 spz stb %o1, [%i1 + %l0] 1729 1.1 spz brnz %i5, .L128_xts_destealing 1730 1.1 spz inc %l0 1731 1.1 spz 1732 1.1 spz mov %l7, %i0 1733 1.1 spz sub %i1, 16, %i1 1734 1.1 spz mov 0, %l0 1735 1.1 spz sub %i1, %l2, %i1 1736 1.1 spz ba .L128_xts_deloop ! one more time 1737 1.1 spz mov 1, %i2 ! %i5 is 0 1738 1.1 spz ret 1739 1.1 spz restore 1740 1.1 spz .type aes128_t4_xts_decrypt,#function 1741 1.1 spz .size aes128_t4_xts_decrypt,.-aes128_t4_xts_decrypt 1742 1.1 spz .globl aes128_t4_cbc_decrypt 1743 1.1 spz .align 32 1744 1.1 spz aes128_t4_cbc_decrypt: 1745 1.4 martin save %sp, -STACK_FRAME, %sp 1746 1.1 spz cmp %i2, 0 1747 1.4 martin be,pn SIZE_T_CC, .L128_cbc_dec_abort 1748 1.1 spz srln %i2, 0, %i2 ! needed on v8+, "nop" on v9 1749 1.1 spz sub %i0, %i1, %l5 ! %i0!=%i1 1750 1.1 spz ld [%i4 + 0], %f12 ! load ivec 1751 1.1 spz ld [%i4 + 4], %f13 1752 1.1 spz ld [%i4 + 8], %f14 1753 1.1 spz ld [%i4 + 12], %f15 1754 1.1 spz prefetch [%i0], 20 1755 1.1 spz prefetch [%i0 + 63], 20 1756 1.1 spz call _aes128_load_deckey 1757 1.1 spz and %i0, 7, %l0 1758 1.1 spz andn %i0, 7, %i0 1759 1.1 spz sll %l0, 3, %l0 1760 1.1 spz mov 64, %l1 1761 1.1 spz mov 0xff, %l3 1762 1.1 spz sub %l1, %l0, %l1 1763 1.1 spz and %i1, 7, %l2 1764 1.1 spz cmp %i2, 255 1765 1.1 spz movrnz %l2, 0, %l5 ! if ( %i1&7 || 1766 1.4 martin movleu SIZE_T_CC, 0, %l5 ! %i2<256 || 1767 1.1 spz brnz,pn %l5, .L128cbc_dec_blk ! %i0==%i1) 1768 1.1 spz srl %l3, %l2, %l3 1769 1.1 spz 1770 1.1 spz andcc %i2, 16, %g0 ! is number of blocks even? 1771 1.1 spz srlx %i2, 4, %i2 1772 1.1 spz .word 0xb3b64340 !alignaddrl %i1,%g0,%i1 1773 1.1 spz bz %icc, .L128_cbc_dec_loop2x 1774 1.1 spz prefetch [%i1], 22 1775 1.1 spz .L128_cbc_dec_loop: 1776 1.1 spz ldx [%i0 + 0], %o0 1777 1.1 spz brz,pt %l0, 4f 1778 1.1 spz ldx [%i0 + 8], %o1 1779 1.1 spz 1780 1.1 spz ldx [%i0 + 16], %o2 1781 1.1 spz sllx %o0, %l0, %o0 1782 1.1 spz srlx %o1, %l1, %g1 1783 1.1 spz sllx %o1, %l0, %o1 1784 1.1 spz or %g1, %o0, %o0 1785 1.1 spz srlx %o2, %l1, %o2 1786 1.1 spz or %o2, %o1, %o1 1787 1.1 spz 4: 1788 1.1 spz xor %g4, %o0, %o2 ! ^= rk[0] 1789 1.1 spz xor %g5, %o1, %o3 1790 1.1 spz .word 0x81b0230a !movxtod %o2,%f0 1791 1.1 spz .word 0x85b0230b !movxtod %o3,%f2 1792 1.1 spz 1793 1.1 spz prefetch [%i1 + 63], 22 1794 1.1 spz prefetch [%i0 + 16+63], 20 1795 1.1 spz call _aes128_decrypt_1x 1796 1.1 spz add %i0, 16, %i0 1797 1.1 spz 1798 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 1799 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1800 1.1 spz .word 0x99b02308 !movxtod %o0,%f12 1801 1.1 spz .word 0x9db02309 !movxtod %o1,%f14 1802 1.1 spz 1803 1.1 spz brnz,pn %l2, 2f 1804 1.1 spz sub %i2, 1, %i2 1805 1.5 christos 1806 1.1 spz std %f0, [%i1 + 0] 1807 1.1 spz std %f2, [%i1 + 8] 1808 1.1 spz brnz,pt %i2, .L128_cbc_dec_loop2x 1809 1.1 spz add %i1, 16, %i1 1810 1.1 spz st %f12, [%i4 + 0] 1811 1.1 spz st %f13, [%i4 + 4] 1812 1.1 spz st %f14, [%i4 + 8] 1813 1.1 spz st %f15, [%i4 + 12] 1814 1.1 spz .L128_cbc_dec_abort: 1815 1.1 spz ret 1816 1.1 spz restore 1817 1.1 spz 1818 1.1 spz .align 16 1819 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 1820 1.1 spz ! and ~3x deterioration 1821 1.1 spz ! in inp==out case 1822 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 ! handle unaligned output 1823 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 1824 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 1825 1.1 spz 1826 1.1 spz stda %f4, [%i1 + %l3]0xc0 ! partial store 1827 1.1 spz std %f6, [%i1 + 8] 1828 1.1 spz add %i1, 16, %i1 1829 1.1 spz orn %g0, %l3, %l3 1830 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 1831 1.1 spz 1832 1.1 spz brnz,pt %i2, .L128_cbc_dec_loop2x+4 1833 1.1 spz orn %g0, %l3, %l3 1834 1.1 spz st %f12, [%i4 + 0] 1835 1.1 spz st %f13, [%i4 + 4] 1836 1.1 spz st %f14, [%i4 + 8] 1837 1.1 spz st %f15, [%i4 + 12] 1838 1.1 spz ret 1839 1.1 spz restore 1840 1.1 spz 1841 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1842 1.1 spz .align 32 1843 1.1 spz .L128_cbc_dec_loop2x: 1844 1.1 spz ldx [%i0 + 0], %o0 1845 1.1 spz ldx [%i0 + 8], %o1 1846 1.1 spz ldx [%i0 + 16], %o2 1847 1.1 spz brz,pt %l0, 4f 1848 1.1 spz ldx [%i0 + 24], %o3 1849 1.1 spz 1850 1.1 spz ldx [%i0 + 32], %o4 1851 1.1 spz sllx %o0, %l0, %o0 1852 1.1 spz srlx %o1, %l1, %g1 1853 1.1 spz or %g1, %o0, %o0 1854 1.1 spz sllx %o1, %l0, %o1 1855 1.1 spz srlx %o2, %l1, %g1 1856 1.1 spz or %g1, %o1, %o1 1857 1.1 spz sllx %o2, %l0, %o2 1858 1.1 spz srlx %o3, %l1, %g1 1859 1.1 spz or %g1, %o2, %o2 1860 1.1 spz sllx %o3, %l0, %o3 1861 1.1 spz srlx %o4, %l1, %o4 1862 1.1 spz or %o4, %o3, %o3 1863 1.1 spz 4: 1864 1.1 spz xor %g4, %o0, %o4 ! ^= rk[0] 1865 1.1 spz xor %g5, %o1, %o5 1866 1.1 spz .word 0x81b0230c !movxtod %o4,%f0 1867 1.1 spz .word 0x85b0230d !movxtod %o5,%f2 1868 1.1 spz xor %g4, %o2, %o4 1869 1.1 spz xor %g5, %o3, %o5 1870 1.1 spz .word 0x89b0230c !movxtod %o4,%f4 1871 1.1 spz .word 0x8db0230d !movxtod %o5,%f6 1872 1.1 spz 1873 1.1 spz prefetch [%i1 + 63], 22 1874 1.1 spz prefetch [%i0 + 32+63], 20 1875 1.1 spz call _aes128_decrypt_2x 1876 1.1 spz add %i0, 32, %i0 1877 1.1 spz 1878 1.1 spz .word 0x91b02308 !movxtod %o0,%f8 1879 1.1 spz .word 0x95b02309 !movxtod %o1,%f10 1880 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 1881 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1882 1.1 spz .word 0x99b0230a !movxtod %o2,%f12 1883 1.1 spz .word 0x9db0230b !movxtod %o3,%f14 1884 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 1885 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 1886 1.1 spz 1887 1.1 spz brnz,pn %l2, 2f 1888 1.1 spz sub %i2, 2, %i2 1889 1.5 christos 1890 1.1 spz std %f0, [%i1 + 0] 1891 1.1 spz std %f2, [%i1 + 8] 1892 1.1 spz std %f4, [%i1 + 16] 1893 1.1 spz std %f6, [%i1 + 24] 1894 1.1 spz brnz,pt %i2, .L128_cbc_dec_loop2x 1895 1.1 spz add %i1, 32, %i1 1896 1.1 spz st %f12, [%i4 + 0] 1897 1.1 spz st %f13, [%i4 + 4] 1898 1.1 spz st %f14, [%i4 + 8] 1899 1.1 spz st %f15, [%i4 + 12] 1900 1.1 spz ret 1901 1.1 spz restore 1902 1.1 spz 1903 1.1 spz .align 16 1904 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 1905 1.1 spz ! and ~3x deterioration 1906 1.1 spz ! in inp==out case 1907 1.1 spz .word 0x91b00900 !faligndata %f0,%f0,%f8 ! handle unaligned output 1908 1.1 spz .word 0x81b00902 !faligndata %f0,%f2,%f0 1909 1.1 spz .word 0x85b08904 !faligndata %f2,%f4,%f2 1910 1.1 spz .word 0x89b10906 !faligndata %f4,%f6,%f4 1911 1.1 spz .word 0x8db18906 !faligndata %f6,%f6,%f6 1912 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 1913 1.1 spz std %f0, [%i1 + 8] 1914 1.1 spz std %f2, [%i1 + 16] 1915 1.1 spz std %f4, [%i1 + 24] 1916 1.1 spz add %i1, 32, %i1 1917 1.1 spz orn %g0, %l3, %l3 1918 1.1 spz stda %f6, [%i1 + %l3]0xc0 ! partial store 1919 1.1 spz 1920 1.1 spz brnz,pt %i2, .L128_cbc_dec_loop2x+4 1921 1.1 spz orn %g0, %l3, %l3 1922 1.1 spz st %f12, [%i4 + 0] 1923 1.1 spz st %f13, [%i4 + 4] 1924 1.1 spz st %f14, [%i4 + 8] 1925 1.1 spz st %f15, [%i4 + 12] 1926 1.1 spz ret 1927 1.1 spz restore 1928 1.1 spz 1929 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1930 1.1 spz .align 32 1931 1.1 spz .L128cbc_dec_blk: 1932 1.1 spz add %i1, %i2, %l5 1933 1.1 spz and %l5, 63, %l5 ! tail 1934 1.1 spz sub %i2, %l5, %i2 1935 1.1 spz add %l5, 15, %l5 ! round up to 16n 1936 1.1 spz srlx %i2, 4, %i2 1937 1.1 spz srl %l5, 4, %l5 1938 1.1 spz sub %i2, 1, %i2 1939 1.1 spz add %l5, 1, %l5 1940 1.1 spz 1941 1.1 spz .L128_cbc_dec_blk_loop2x: 1942 1.1 spz ldx [%i0 + 0], %o0 1943 1.1 spz ldx [%i0 + 8], %o1 1944 1.1 spz ldx [%i0 + 16], %o2 1945 1.1 spz brz,pt %l0, 5f 1946 1.1 spz ldx [%i0 + 24], %o3 1947 1.1 spz 1948 1.1 spz ldx [%i0 + 32], %o4 1949 1.1 spz sllx %o0, %l0, %o0 1950 1.1 spz srlx %o1, %l1, %g1 1951 1.1 spz or %g1, %o0, %o0 1952 1.1 spz sllx %o1, %l0, %o1 1953 1.1 spz srlx %o2, %l1, %g1 1954 1.1 spz or %g1, %o1, %o1 1955 1.1 spz sllx %o2, %l0, %o2 1956 1.1 spz srlx %o3, %l1, %g1 1957 1.1 spz or %g1, %o2, %o2 1958 1.1 spz sllx %o3, %l0, %o3 1959 1.1 spz srlx %o4, %l1, %o4 1960 1.1 spz or %o4, %o3, %o3 1961 1.1 spz 5: 1962 1.1 spz xor %g4, %o0, %o4 ! ^= rk[0] 1963 1.1 spz xor %g5, %o1, %o5 1964 1.1 spz .word 0x81b0230c !movxtod %o4,%f0 1965 1.1 spz .word 0x85b0230d !movxtod %o5,%f2 1966 1.1 spz xor %g4, %o2, %o4 1967 1.1 spz xor %g5, %o3, %o5 1968 1.1 spz .word 0x89b0230c !movxtod %o4,%f4 1969 1.1 spz .word 0x8db0230d !movxtod %o5,%f6 1970 1.1 spz 1971 1.1 spz prefetch [%i0 + 32+63], 20 1972 1.1 spz call _aes128_decrypt_2x 1973 1.1 spz add %i0, 32, %i0 1974 1.1 spz subcc %i2, 2, %i2 1975 1.1 spz 1976 1.1 spz .word 0x91b02308 !movxtod %o0,%f8 1977 1.1 spz .word 0x95b02309 !movxtod %o1,%f10 1978 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 1979 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 1980 1.1 spz .word 0x99b0230a !movxtod %o2,%f12 1981 1.1 spz .word 0x9db0230b !movxtod %o3,%f14 1982 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 1983 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 1984 1.1 spz 1985 1.1 spz stda %f0, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 1986 1.1 spz add %i1, 8, %i1 1987 1.1 spz stda %f2, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 1988 1.1 spz add %i1, 8, %i1 1989 1.1 spz stda %f4, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 1990 1.1 spz add %i1, 8, %i1 1991 1.1 spz stda %f6, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 1992 1.4 martin bgu,pt SIZE_T_CC, .L128_cbc_dec_blk_loop2x 1993 1.1 spz add %i1, 8, %i1 1994 1.1 spz 1995 1.1 spz add %l5, %i2, %i2 1996 1.1 spz andcc %i2, 1, %g0 ! is number of blocks even? 1997 1.1 spz membar #StoreLoad|#StoreStore 1998 1.1 spz bnz,pt %icc, .L128_cbc_dec_loop 1999 1.1 spz srl %i2, 0, %i2 2000 1.1 spz brnz,pn %i2, .L128_cbc_dec_loop2x 2001 1.1 spz nop 2002 1.1 spz st %f12, [%i4 + 0] ! write out ivec 2003 1.1 spz st %f13, [%i4 + 4] 2004 1.1 spz st %f14, [%i4 + 8] 2005 1.1 spz st %f15, [%i4 + 12] 2006 1.1 spz ret 2007 1.1 spz restore 2008 1.1 spz .type aes128_t4_cbc_decrypt,#function 2009 1.1 spz .size aes128_t4_cbc_decrypt,.-aes128_t4_cbc_decrypt 2010 1.1 spz .align 32 2011 1.1 spz _aes128_decrypt_1x: 2012 1.1 spz .word 0x88cc0440 !aes_dround01 %f16,%f0,%f2,%f4 2013 1.1 spz .word 0x84cc8460 !aes_dround23 %f18,%f0,%f2,%f2 2014 1.1 spz .word 0x80cd0444 !aes_dround01 %f20,%f4,%f2,%f0 2015 1.1 spz .word 0x84cd8464 !aes_dround23 %f22,%f4,%f2,%f2 2016 1.1 spz .word 0x88ce0440 !aes_dround01 %f24,%f0,%f2,%f4 2017 1.1 spz .word 0x84ce8460 !aes_dround23 %f26,%f0,%f2,%f2 2018 1.1 spz .word 0x80cf0444 !aes_dround01 %f28,%f4,%f2,%f0 2019 1.1 spz .word 0x84cf8464 !aes_dround23 %f30,%f4,%f2,%f2 2020 1.1 spz .word 0x88c84440 !aes_dround01 %f32,%f0,%f2,%f4 2021 1.1 spz .word 0x84c8c460 !aes_dround23 %f34,%f0,%f2,%f2 2022 1.1 spz .word 0x80c94444 !aes_dround01 %f36,%f4,%f2,%f0 2023 1.1 spz .word 0x84c9c464 !aes_dround23 %f38,%f4,%f2,%f2 2024 1.1 spz .word 0x88ca4440 !aes_dround01 %f40,%f0,%f2,%f4 2025 1.1 spz .word 0x84cac460 !aes_dround23 %f42,%f0,%f2,%f2 2026 1.1 spz .word 0x80cb4444 !aes_dround01 %f44,%f4,%f2,%f0 2027 1.1 spz .word 0x84cbc464 !aes_dround23 %f46,%f4,%f2,%f2 2028 1.1 spz .word 0x88cc4440 !aes_dround01 %f48,%f0,%f2,%f4 2029 1.1 spz .word 0x84ccc460 !aes_dround23 %f50,%f0,%f2,%f2 2030 1.1 spz .word 0x80cd44c4 !aes_dround01_l %f52,%f4,%f2,%f0 2031 1.1 spz retl 2032 1.1 spz .word 0x84cdc4e4 !aes_dround23_l %f54,%f4,%f2,%f2 2033 1.1 spz .type _aes128_decrypt_1x,#function 2034 1.1 spz .size _aes128_decrypt_1x,.-_aes128_decrypt_1x 2035 1.1 spz 2036 1.1 spz .align 32 2037 1.1 spz _aes128_decrypt_2x: 2038 1.1 spz .word 0x90cc0440 !aes_dround01 %f16,%f0,%f2,%f8 2039 1.1 spz .word 0x84cc8460 !aes_dround23 %f18,%f0,%f2,%f2 2040 1.1 spz .word 0x94cc0c44 !aes_dround01 %f16,%f4,%f6,%f10 2041 1.1 spz .word 0x8ccc8c64 !aes_dround23 %f18,%f4,%f6,%f6 2042 1.1 spz .word 0x80cd0448 !aes_dround01 %f20,%f8,%f2,%f0 2043 1.1 spz .word 0x84cd8468 !aes_dround23 %f22,%f8,%f2,%f2 2044 1.1 spz .word 0x88cd0c4a !aes_dround01 %f20,%f10,%f6,%f4 2045 1.1 spz .word 0x8ccd8c6a !aes_dround23 %f22,%f10,%f6,%f6 2046 1.1 spz .word 0x90ce0440 !aes_dround01 %f24,%f0,%f2,%f8 2047 1.1 spz .word 0x84ce8460 !aes_dround23 %f26,%f0,%f2,%f2 2048 1.1 spz .word 0x94ce0c44 !aes_dround01 %f24,%f4,%f6,%f10 2049 1.1 spz .word 0x8cce8c64 !aes_dround23 %f26,%f4,%f6,%f6 2050 1.1 spz .word 0x80cf0448 !aes_dround01 %f28,%f8,%f2,%f0 2051 1.1 spz .word 0x84cf8468 !aes_dround23 %f30,%f8,%f2,%f2 2052 1.1 spz .word 0x88cf0c4a !aes_dround01 %f28,%f10,%f6,%f4 2053 1.1 spz .word 0x8ccf8c6a !aes_dround23 %f30,%f10,%f6,%f6 2054 1.1 spz .word 0x90c84440 !aes_dround01 %f32,%f0,%f2,%f8 2055 1.1 spz .word 0x84c8c460 !aes_dround23 %f34,%f0,%f2,%f2 2056 1.1 spz .word 0x94c84c44 !aes_dround01 %f32,%f4,%f6,%f10 2057 1.1 spz .word 0x8cc8cc64 !aes_dround23 %f34,%f4,%f6,%f6 2058 1.1 spz .word 0x80c94448 !aes_dround01 %f36,%f8,%f2,%f0 2059 1.1 spz .word 0x84c9c468 !aes_dround23 %f38,%f8,%f2,%f2 2060 1.1 spz .word 0x88c94c4a !aes_dround01 %f36,%f10,%f6,%f4 2061 1.1 spz .word 0x8cc9cc6a !aes_dround23 %f38,%f10,%f6,%f6 2062 1.1 spz .word 0x90ca4440 !aes_dround01 %f40,%f0,%f2,%f8 2063 1.1 spz .word 0x84cac460 !aes_dround23 %f42,%f0,%f2,%f2 2064 1.1 spz .word 0x94ca4c44 !aes_dround01 %f40,%f4,%f6,%f10 2065 1.1 spz .word 0x8ccacc64 !aes_dround23 %f42,%f4,%f6,%f6 2066 1.1 spz .word 0x80cb4448 !aes_dround01 %f44,%f8,%f2,%f0 2067 1.1 spz .word 0x84cbc468 !aes_dround23 %f46,%f8,%f2,%f2 2068 1.1 spz .word 0x88cb4c4a !aes_dround01 %f44,%f10,%f6,%f4 2069 1.1 spz .word 0x8ccbcc6a !aes_dround23 %f46,%f10,%f6,%f6 2070 1.1 spz .word 0x90cc4440 !aes_dround01 %f48,%f0,%f2,%f8 2071 1.1 spz .word 0x84ccc460 !aes_dround23 %f50,%f0,%f2,%f2 2072 1.1 spz .word 0x94cc4c44 !aes_dround01 %f48,%f4,%f6,%f10 2073 1.1 spz .word 0x8ccccc64 !aes_dround23 %f50,%f4,%f6,%f6 2074 1.1 spz .word 0x80cd44c8 !aes_dround01_l %f52,%f8,%f2,%f0 2075 1.1 spz .word 0x84cdc4e8 !aes_dround23_l %f54,%f8,%f2,%f2 2076 1.1 spz .word 0x88cd4cca !aes_dround01_l %f52,%f10,%f6,%f4 2077 1.1 spz retl 2078 1.1 spz .word 0x8ccdccea !aes_dround23_l %f54,%f10,%f6,%f6 2079 1.1 spz .type _aes128_decrypt_2x,#function 2080 1.1 spz .size _aes128_decrypt_2x,.-_aes128_decrypt_2x 2081 1.1 spz .align 32 2082 1.1 spz _aes192_encrypt_1x: 2083 1.1 spz .word 0x88cc0400 !aes_eround01 %f16,%f0,%f2,%f4 2084 1.1 spz .word 0x84cc8420 !aes_eround23 %f18,%f0,%f2,%f2 2085 1.1 spz .word 0x80cd0404 !aes_eround01 %f20,%f4,%f2,%f0 2086 1.1 spz .word 0x84cd8424 !aes_eround23 %f22,%f4,%f2,%f2 2087 1.1 spz .word 0x88ce0400 !aes_eround01 %f24,%f0,%f2,%f4 2088 1.1 spz .word 0x84ce8420 !aes_eround23 %f26,%f0,%f2,%f2 2089 1.1 spz .word 0x80cf0404 !aes_eround01 %f28,%f4,%f2,%f0 2090 1.1 spz .word 0x84cf8424 !aes_eround23 %f30,%f4,%f2,%f2 2091 1.1 spz .word 0x88c84400 !aes_eround01 %f32,%f0,%f2,%f4 2092 1.1 spz .word 0x84c8c420 !aes_eround23 %f34,%f0,%f2,%f2 2093 1.1 spz .word 0x80c94404 !aes_eround01 %f36,%f4,%f2,%f0 2094 1.1 spz .word 0x84c9c424 !aes_eround23 %f38,%f4,%f2,%f2 2095 1.1 spz .word 0x88ca4400 !aes_eround01 %f40,%f0,%f2,%f4 2096 1.1 spz .word 0x84cac420 !aes_eround23 %f42,%f0,%f2,%f2 2097 1.1 spz .word 0x80cb4404 !aes_eround01 %f44,%f4,%f2,%f0 2098 1.1 spz .word 0x84cbc424 !aes_eround23 %f46,%f4,%f2,%f2 2099 1.1 spz .word 0x88cc4400 !aes_eround01 %f48,%f0,%f2,%f4 2100 1.1 spz .word 0x84ccc420 !aes_eround23 %f50,%f0,%f2,%f2 2101 1.1 spz .word 0x80cd4404 !aes_eround01 %f52,%f4,%f2,%f0 2102 1.1 spz .word 0x84cdc424 !aes_eround23 %f54,%f4,%f2,%f2 2103 1.1 spz .word 0x88ce4400 !aes_eround01 %f56,%f0,%f2,%f4 2104 1.1 spz .word 0x84cec420 !aes_eround23 %f58,%f0,%f2,%f2 2105 1.1 spz .word 0x80cf4484 !aes_eround01_l %f60,%f4,%f2,%f0 2106 1.1 spz retl 2107 1.1 spz .word 0x84cfc4a4 !aes_eround23_l %f62,%f4,%f2,%f2 2108 1.1 spz .type _aes192_encrypt_1x,#function 2109 1.1 spz .size _aes192_encrypt_1x,.-_aes192_encrypt_1x 2110 1.1 spz 2111 1.1 spz .align 32 2112 1.1 spz _aes192_encrypt_2x: 2113 1.1 spz .word 0x90cc0400 !aes_eround01 %f16,%f0,%f2,%f8 2114 1.1 spz .word 0x84cc8420 !aes_eround23 %f18,%f0,%f2,%f2 2115 1.1 spz .word 0x94cc0c04 !aes_eround01 %f16,%f4,%f6,%f10 2116 1.1 spz .word 0x8ccc8c24 !aes_eround23 %f18,%f4,%f6,%f6 2117 1.1 spz .word 0x80cd0408 !aes_eround01 %f20,%f8,%f2,%f0 2118 1.1 spz .word 0x84cd8428 !aes_eround23 %f22,%f8,%f2,%f2 2119 1.1 spz .word 0x88cd0c0a !aes_eround01 %f20,%f10,%f6,%f4 2120 1.1 spz .word 0x8ccd8c2a !aes_eround23 %f22,%f10,%f6,%f6 2121 1.1 spz .word 0x90ce0400 !aes_eround01 %f24,%f0,%f2,%f8 2122 1.1 spz .word 0x84ce8420 !aes_eround23 %f26,%f0,%f2,%f2 2123 1.1 spz .word 0x94ce0c04 !aes_eround01 %f24,%f4,%f6,%f10 2124 1.1 spz .word 0x8cce8c24 !aes_eround23 %f26,%f4,%f6,%f6 2125 1.1 spz .word 0x80cf0408 !aes_eround01 %f28,%f8,%f2,%f0 2126 1.1 spz .word 0x84cf8428 !aes_eround23 %f30,%f8,%f2,%f2 2127 1.1 spz .word 0x88cf0c0a !aes_eround01 %f28,%f10,%f6,%f4 2128 1.1 spz .word 0x8ccf8c2a !aes_eround23 %f30,%f10,%f6,%f6 2129 1.1 spz .word 0x90c84400 !aes_eround01 %f32,%f0,%f2,%f8 2130 1.1 spz .word 0x84c8c420 !aes_eround23 %f34,%f0,%f2,%f2 2131 1.1 spz .word 0x94c84c04 !aes_eround01 %f32,%f4,%f6,%f10 2132 1.1 spz .word 0x8cc8cc24 !aes_eround23 %f34,%f4,%f6,%f6 2133 1.1 spz .word 0x80c94408 !aes_eround01 %f36,%f8,%f2,%f0 2134 1.1 spz .word 0x84c9c428 !aes_eround23 %f38,%f8,%f2,%f2 2135 1.1 spz .word 0x88c94c0a !aes_eround01 %f36,%f10,%f6,%f4 2136 1.1 spz .word 0x8cc9cc2a !aes_eround23 %f38,%f10,%f6,%f6 2137 1.1 spz .word 0x90ca4400 !aes_eround01 %f40,%f0,%f2,%f8 2138 1.1 spz .word 0x84cac420 !aes_eround23 %f42,%f0,%f2,%f2 2139 1.1 spz .word 0x94ca4c04 !aes_eround01 %f40,%f4,%f6,%f10 2140 1.1 spz .word 0x8ccacc24 !aes_eround23 %f42,%f4,%f6,%f6 2141 1.1 spz .word 0x80cb4408 !aes_eround01 %f44,%f8,%f2,%f0 2142 1.1 spz .word 0x84cbc428 !aes_eround23 %f46,%f8,%f2,%f2 2143 1.1 spz .word 0x88cb4c0a !aes_eround01 %f44,%f10,%f6,%f4 2144 1.1 spz .word 0x8ccbcc2a !aes_eround23 %f46,%f10,%f6,%f6 2145 1.1 spz .word 0x90cc4400 !aes_eround01 %f48,%f0,%f2,%f8 2146 1.1 spz .word 0x84ccc420 !aes_eround23 %f50,%f0,%f2,%f2 2147 1.1 spz .word 0x94cc4c04 !aes_eround01 %f48,%f4,%f6,%f10 2148 1.1 spz .word 0x8ccccc24 !aes_eround23 %f50,%f4,%f6,%f6 2149 1.1 spz .word 0x80cd4408 !aes_eround01 %f52,%f8,%f2,%f0 2150 1.1 spz .word 0x84cdc428 !aes_eround23 %f54,%f8,%f2,%f2 2151 1.1 spz .word 0x88cd4c0a !aes_eround01 %f52,%f10,%f6,%f4 2152 1.1 spz .word 0x8ccdcc2a !aes_eround23 %f54,%f10,%f6,%f6 2153 1.1 spz .word 0x90ce4400 !aes_eround01 %f56,%f0,%f2,%f8 2154 1.1 spz .word 0x84cec420 !aes_eround23 %f58,%f0,%f2,%f2 2155 1.1 spz .word 0x94ce4c04 !aes_eround01 %f56,%f4,%f6,%f10 2156 1.1 spz .word 0x8ccecc24 !aes_eround23 %f58,%f4,%f6,%f6 2157 1.1 spz .word 0x80cf4488 !aes_eround01_l %f60,%f8,%f2,%f0 2158 1.1 spz .word 0x84cfc4a8 !aes_eround23_l %f62,%f8,%f2,%f2 2159 1.1 spz .word 0x88cf4c8a !aes_eround01_l %f60,%f10,%f6,%f4 2160 1.1 spz retl 2161 1.1 spz .word 0x8ccfccaa !aes_eround23_l %f62,%f10,%f6,%f6 2162 1.1 spz .type _aes192_encrypt_2x,#function 2163 1.1 spz .size _aes192_encrypt_2x,.-_aes192_encrypt_2x 2164 1.1 spz 2165 1.1 spz .align 32 2166 1.1 spz _aes256_encrypt_1x: 2167 1.1 spz .word 0x88cc0400 !aes_eround01 %f16,%f0,%f2,%f4 2168 1.1 spz .word 0x84cc8420 !aes_eround23 %f18,%f0,%f2,%f2 2169 1.1 spz ldd [%i3 + 208], %f16 2170 1.1 spz ldd [%i3 + 216], %f18 2171 1.1 spz .word 0x80cd0404 !aes_eround01 %f20,%f4,%f2,%f0 2172 1.1 spz .word 0x84cd8424 !aes_eround23 %f22,%f4,%f2,%f2 2173 1.1 spz ldd [%i3 + 224], %f20 2174 1.1 spz ldd [%i3 + 232], %f22 2175 1.1 spz .word 0x88ce0400 !aes_eround01 %f24,%f0,%f2,%f4 2176 1.1 spz .word 0x84ce8420 !aes_eround23 %f26,%f0,%f2,%f2 2177 1.1 spz .word 0x80cf0404 !aes_eround01 %f28,%f4,%f2,%f0 2178 1.1 spz .word 0x84cf8424 !aes_eround23 %f30,%f4,%f2,%f2 2179 1.1 spz .word 0x88c84400 !aes_eround01 %f32,%f0,%f2,%f4 2180 1.1 spz .word 0x84c8c420 !aes_eround23 %f34,%f0,%f2,%f2 2181 1.1 spz .word 0x80c94404 !aes_eround01 %f36,%f4,%f2,%f0 2182 1.1 spz .word 0x84c9c424 !aes_eround23 %f38,%f4,%f2,%f2 2183 1.1 spz .word 0x88ca4400 !aes_eround01 %f40,%f0,%f2,%f4 2184 1.1 spz .word 0x84cac420 !aes_eround23 %f42,%f0,%f2,%f2 2185 1.1 spz .word 0x80cb4404 !aes_eround01 %f44,%f4,%f2,%f0 2186 1.1 spz .word 0x84cbc424 !aes_eround23 %f46,%f4,%f2,%f2 2187 1.1 spz .word 0x88cc4400 !aes_eround01 %f48,%f0,%f2,%f4 2188 1.1 spz .word 0x84ccc420 !aes_eround23 %f50,%f0,%f2,%f2 2189 1.1 spz .word 0x80cd4404 !aes_eround01 %f52,%f4,%f2,%f0 2190 1.1 spz .word 0x84cdc424 !aes_eround23 %f54,%f4,%f2,%f2 2191 1.1 spz .word 0x88ce4400 !aes_eround01 %f56,%f0,%f2,%f4 2192 1.1 spz .word 0x84cec420 !aes_eround23 %f58,%f0,%f2,%f2 2193 1.1 spz .word 0x80cf4404 !aes_eround01 %f60,%f4,%f2,%f0 2194 1.1 spz .word 0x84cfc424 !aes_eround23 %f62,%f4,%f2,%f2 2195 1.1 spz .word 0x88cc0400 !aes_eround01 %f16,%f0,%f2,%f4 2196 1.1 spz .word 0x84cc8420 !aes_eround23 %f18,%f0,%f2,%f2 2197 1.1 spz ldd [%i3 + 16], %f16 2198 1.1 spz ldd [%i3 + 24], %f18 2199 1.1 spz .word 0x80cd0484 !aes_eround01_l %f20,%f4,%f2,%f0 2200 1.1 spz .word 0x84cd84a4 !aes_eround23_l %f22,%f4,%f2,%f2 2201 1.1 spz ldd [%i3 + 32], %f20 2202 1.1 spz retl 2203 1.1 spz ldd [%i3 + 40], %f22 2204 1.1 spz .type _aes256_encrypt_1x,#function 2205 1.1 spz .size _aes256_encrypt_1x,.-_aes256_encrypt_1x 2206 1.1 spz 2207 1.1 spz .align 32 2208 1.1 spz _aes256_encrypt_2x: 2209 1.1 spz .word 0x90cc0400 !aes_eround01 %f16,%f0,%f2,%f8 2210 1.1 spz .word 0x84cc8420 !aes_eround23 %f18,%f0,%f2,%f2 2211 1.1 spz .word 0x94cc0c04 !aes_eround01 %f16,%f4,%f6,%f10 2212 1.1 spz .word 0x8ccc8c24 !aes_eround23 %f18,%f4,%f6,%f6 2213 1.1 spz ldd [%i3 + 208], %f16 2214 1.1 spz ldd [%i3 + 216], %f18 2215 1.1 spz .word 0x80cd0408 !aes_eround01 %f20,%f8,%f2,%f0 2216 1.1 spz .word 0x84cd8428 !aes_eround23 %f22,%f8,%f2,%f2 2217 1.1 spz .word 0x88cd0c0a !aes_eround01 %f20,%f10,%f6,%f4 2218 1.1 spz .word 0x8ccd8c2a !aes_eround23 %f22,%f10,%f6,%f6 2219 1.1 spz ldd [%i3 + 224], %f20 2220 1.1 spz ldd [%i3 + 232], %f22 2221 1.1 spz .word 0x90ce0400 !aes_eround01 %f24,%f0,%f2,%f8 2222 1.1 spz .word 0x84ce8420 !aes_eround23 %f26,%f0,%f2,%f2 2223 1.1 spz .word 0x94ce0c04 !aes_eround01 %f24,%f4,%f6,%f10 2224 1.1 spz .word 0x8cce8c24 !aes_eround23 %f26,%f4,%f6,%f6 2225 1.1 spz .word 0x80cf0408 !aes_eround01 %f28,%f8,%f2,%f0 2226 1.1 spz .word 0x84cf8428 !aes_eround23 %f30,%f8,%f2,%f2 2227 1.1 spz .word 0x88cf0c0a !aes_eround01 %f28,%f10,%f6,%f4 2228 1.1 spz .word 0x8ccf8c2a !aes_eround23 %f30,%f10,%f6,%f6 2229 1.1 spz .word 0x90c84400 !aes_eround01 %f32,%f0,%f2,%f8 2230 1.1 spz .word 0x84c8c420 !aes_eround23 %f34,%f0,%f2,%f2 2231 1.1 spz .word 0x94c84c04 !aes_eround01 %f32,%f4,%f6,%f10 2232 1.1 spz .word 0x8cc8cc24 !aes_eround23 %f34,%f4,%f6,%f6 2233 1.1 spz .word 0x80c94408 !aes_eround01 %f36,%f8,%f2,%f0 2234 1.1 spz .word 0x84c9c428 !aes_eround23 %f38,%f8,%f2,%f2 2235 1.1 spz .word 0x88c94c0a !aes_eround01 %f36,%f10,%f6,%f4 2236 1.1 spz .word 0x8cc9cc2a !aes_eround23 %f38,%f10,%f6,%f6 2237 1.1 spz .word 0x90ca4400 !aes_eround01 %f40,%f0,%f2,%f8 2238 1.1 spz .word 0x84cac420 !aes_eround23 %f42,%f0,%f2,%f2 2239 1.1 spz .word 0x94ca4c04 !aes_eround01 %f40,%f4,%f6,%f10 2240 1.1 spz .word 0x8ccacc24 !aes_eround23 %f42,%f4,%f6,%f6 2241 1.1 spz .word 0x80cb4408 !aes_eround01 %f44,%f8,%f2,%f0 2242 1.1 spz .word 0x84cbc428 !aes_eround23 %f46,%f8,%f2,%f2 2243 1.1 spz .word 0x88cb4c0a !aes_eround01 %f44,%f10,%f6,%f4 2244 1.1 spz .word 0x8ccbcc2a !aes_eround23 %f46,%f10,%f6,%f6 2245 1.1 spz .word 0x90cc4400 !aes_eround01 %f48,%f0,%f2,%f8 2246 1.1 spz .word 0x84ccc420 !aes_eround23 %f50,%f0,%f2,%f2 2247 1.1 spz .word 0x94cc4c04 !aes_eround01 %f48,%f4,%f6,%f10 2248 1.1 spz .word 0x8ccccc24 !aes_eround23 %f50,%f4,%f6,%f6 2249 1.1 spz .word 0x80cd4408 !aes_eround01 %f52,%f8,%f2,%f0 2250 1.1 spz .word 0x84cdc428 !aes_eround23 %f54,%f8,%f2,%f2 2251 1.1 spz .word 0x88cd4c0a !aes_eround01 %f52,%f10,%f6,%f4 2252 1.1 spz .word 0x8ccdcc2a !aes_eround23 %f54,%f10,%f6,%f6 2253 1.1 spz .word 0x90ce4400 !aes_eround01 %f56,%f0,%f2,%f8 2254 1.1 spz .word 0x84cec420 !aes_eround23 %f58,%f0,%f2,%f2 2255 1.1 spz .word 0x94ce4c04 !aes_eround01 %f56,%f4,%f6,%f10 2256 1.1 spz .word 0x8ccecc24 !aes_eround23 %f58,%f4,%f6,%f6 2257 1.1 spz .word 0x80cf4408 !aes_eround01 %f60,%f8,%f2,%f0 2258 1.1 spz .word 0x84cfc428 !aes_eround23 %f62,%f8,%f2,%f2 2259 1.1 spz .word 0x88cf4c0a !aes_eround01 %f60,%f10,%f6,%f4 2260 1.1 spz .word 0x8ccfcc2a !aes_eround23 %f62,%f10,%f6,%f6 2261 1.1 spz .word 0x90cc0400 !aes_eround01 %f16,%f0,%f2,%f8 2262 1.1 spz .word 0x84cc8420 !aes_eround23 %f18,%f0,%f2,%f2 2263 1.1 spz .word 0x94cc0c04 !aes_eround01 %f16,%f4,%f6,%f10 2264 1.1 spz .word 0x8ccc8c24 !aes_eround23 %f18,%f4,%f6,%f6 2265 1.1 spz ldd [%i3 + 16], %f16 2266 1.1 spz ldd [%i3 + 24], %f18 2267 1.1 spz .word 0x80cd0488 !aes_eround01_l %f20,%f8,%f2,%f0 2268 1.1 spz .word 0x84cd84a8 !aes_eround23_l %f22,%f8,%f2,%f2 2269 1.1 spz .word 0x88cd0c8a !aes_eround01_l %f20,%f10,%f6,%f4 2270 1.1 spz .word 0x8ccd8caa !aes_eround23_l %f22,%f10,%f6,%f6 2271 1.1 spz ldd [%i3 + 32], %f20 2272 1.1 spz retl 2273 1.1 spz ldd [%i3 + 40], %f22 2274 1.1 spz .type _aes256_encrypt_2x,#function 2275 1.1 spz .size _aes256_encrypt_2x,.-_aes256_encrypt_2x 2276 1.1 spz 2277 1.1 spz .align 32 2278 1.1 spz _aes192_loadkey: 2279 1.1 spz ldx [%i3 + 0], %g4 2280 1.1 spz ldx [%i3 + 8], %g5 2281 1.1 spz ldd [%i3 + 16], %f16 2282 1.1 spz ldd [%i3 + 24], %f18 2283 1.1 spz ldd [%i3 + 32], %f20 2284 1.1 spz ldd [%i3 + 40], %f22 2285 1.1 spz ldd [%i3 + 48], %f24 2286 1.1 spz ldd [%i3 + 56], %f26 2287 1.1 spz ldd [%i3 + 64], %f28 2288 1.1 spz ldd [%i3 + 72], %f30 2289 1.1 spz ldd [%i3 + 80], %f32 2290 1.1 spz ldd [%i3 + 88], %f34 2291 1.1 spz ldd [%i3 + 96], %f36 2292 1.1 spz ldd [%i3 + 104], %f38 2293 1.1 spz ldd [%i3 + 112], %f40 2294 1.1 spz ldd [%i3 + 120], %f42 2295 1.1 spz ldd [%i3 + 128], %f44 2296 1.1 spz ldd [%i3 + 136], %f46 2297 1.1 spz ldd [%i3 + 144], %f48 2298 1.1 spz ldd [%i3 + 152], %f50 2299 1.1 spz ldd [%i3 + 160], %f52 2300 1.1 spz ldd [%i3 + 168], %f54 2301 1.1 spz ldd [%i3 + 176], %f56 2302 1.1 spz ldd [%i3 + 184], %f58 2303 1.1 spz ldd [%i3 + 192], %f60 2304 1.1 spz ldd [%i3 + 200], %f62 2305 1.1 spz retl 2306 1.1 spz nop 2307 1.1 spz .type _aes192_loadkey,#function 2308 1.1 spz .size _aes192_loadkey,.-_aes192_loadkey 2309 1.1 spz _aes256_loadkey=_aes192_loadkey 2310 1.1 spz _aes192_load_enckey=_aes192_loadkey 2311 1.1 spz _aes192_load_deckey=_aes192_loadkey 2312 1.1 spz _aes256_load_enckey=_aes192_loadkey 2313 1.1 spz _aes256_load_deckey=_aes192_loadkey 2314 1.1 spz .globl aes256_t4_cbc_encrypt 2315 1.1 spz .align 32 2316 1.1 spz aes256_t4_cbc_encrypt: 2317 1.4 martin save %sp, -STACK_FRAME, %sp 2318 1.1 spz cmp %i2, 0 2319 1.4 martin be,pn SIZE_T_CC, .L256_cbc_enc_abort 2320 1.1 spz srln %i2, 0, %i2 ! needed on v8+, "nop" on v9 2321 1.1 spz sub %i0, %i1, %l5 ! %i0!=%i1 2322 1.1 spz ld [%i4 + 0], %f0 2323 1.1 spz ld [%i4 + 4], %f1 2324 1.1 spz ld [%i4 + 8], %f2 2325 1.1 spz ld [%i4 + 12], %f3 2326 1.1 spz prefetch [%i0], 20 2327 1.1 spz prefetch [%i0 + 63], 20 2328 1.1 spz call _aes256_load_enckey 2329 1.1 spz and %i0, 7, %l0 2330 1.1 spz andn %i0, 7, %i0 2331 1.1 spz sll %l0, 3, %l0 2332 1.1 spz mov 64, %l1 2333 1.1 spz mov 0xff, %l3 2334 1.1 spz sub %l1, %l0, %l1 2335 1.1 spz and %i1, 7, %l2 2336 1.1 spz cmp %i2, 127 2337 1.1 spz movrnz %l2, 0, %l5 ! if ( %i1&7 || 2338 1.4 martin movleu SIZE_T_CC, 0, %l5 ! %i2<128 || 2339 1.1 spz brnz,pn %l5, .L256cbc_enc_blk ! %i0==%i1) 2340 1.1 spz srl %l3, %l2, %l3 2341 1.1 spz 2342 1.1 spz .word 0xb3b64340 !alignaddrl %i1,%g0,%i1 2343 1.1 spz srlx %i2, 4, %i2 2344 1.1 spz prefetch [%i1], 22 2345 1.1 spz 2346 1.1 spz .L256_cbc_enc_loop: 2347 1.1 spz ldx [%i0 + 0], %o0 2348 1.1 spz brz,pt %l0, 4f 2349 1.1 spz ldx [%i0 + 8], %o1 2350 1.1 spz 2351 1.1 spz ldx [%i0 + 16], %o2 2352 1.1 spz sllx %o0, %l0, %o0 2353 1.1 spz srlx %o1, %l1, %g1 2354 1.1 spz sllx %o1, %l0, %o1 2355 1.1 spz or %g1, %o0, %o0 2356 1.1 spz srlx %o2, %l1, %o2 2357 1.1 spz or %o2, %o1, %o1 2358 1.1 spz 4: 2359 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 2360 1.1 spz xor %g5, %o1, %o1 2361 1.1 spz .word 0x99b02308 !movxtod %o0,%f12 2362 1.1 spz .word 0x9db02309 !movxtod %o1,%f14 2363 1.1 spz 2364 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 2365 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 2366 1.1 spz prefetch [%i1 + 63], 22 2367 1.1 spz prefetch [%i0 + 16+63], 20 2368 1.1 spz call _aes256_encrypt_1x 2369 1.1 spz add %i0, 16, %i0 2370 1.1 spz 2371 1.1 spz brnz,pn %l2, 2f 2372 1.1 spz sub %i2, 1, %i2 2373 1.5 christos 2374 1.1 spz std %f0, [%i1 + 0] 2375 1.1 spz std %f2, [%i1 + 8] 2376 1.1 spz brnz,pt %i2, .L256_cbc_enc_loop 2377 1.1 spz add %i1, 16, %i1 2378 1.1 spz st %f0, [%i4 + 0] 2379 1.1 spz st %f1, [%i4 + 4] 2380 1.1 spz st %f2, [%i4 + 8] 2381 1.1 spz st %f3, [%i4 + 12] 2382 1.1 spz .L256_cbc_enc_abort: 2383 1.1 spz ret 2384 1.1 spz restore 2385 1.1 spz 2386 1.1 spz .align 16 2387 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 2388 1.1 spz ! and ~3x deterioration 2389 1.1 spz ! in inp==out case 2390 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 ! handle unaligned output 2391 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 2392 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 2393 1.1 spz 2394 1.1 spz stda %f4, [%i1 + %l3]0xc0 ! partial store 2395 1.1 spz std %f6, [%i1 + 8] 2396 1.1 spz add %i1, 16, %i1 2397 1.1 spz orn %g0, %l3, %l3 2398 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 2399 1.1 spz 2400 1.1 spz brnz,pt %i2, .L256_cbc_enc_loop+4 2401 1.1 spz orn %g0, %l3, %l3 2402 1.1 spz st %f0, [%i4 + 0] 2403 1.1 spz st %f1, [%i4 + 4] 2404 1.1 spz st %f2, [%i4 + 8] 2405 1.1 spz st %f3, [%i4 + 12] 2406 1.1 spz ret 2407 1.1 spz restore 2408 1.1 spz 2409 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2410 1.1 spz .align 32 2411 1.1 spz .L256cbc_enc_blk: 2412 1.1 spz add %i1, %i2, %l5 2413 1.1 spz and %l5, 63, %l5 ! tail 2414 1.1 spz sub %i2, %l5, %i2 2415 1.1 spz add %l5, 15, %l5 ! round up to 16n 2416 1.1 spz srlx %i2, 4, %i2 2417 1.1 spz srl %l5, 4, %l5 2418 1.1 spz 2419 1.1 spz .L256_cbc_enc_blk_loop: 2420 1.1 spz ldx [%i0 + 0], %o0 2421 1.1 spz brz,pt %l0, 5f 2422 1.1 spz ldx [%i0 + 8], %o1 2423 1.1 spz 2424 1.1 spz ldx [%i0 + 16], %o2 2425 1.1 spz sllx %o0, %l0, %o0 2426 1.1 spz srlx %o1, %l1, %g1 2427 1.1 spz sllx %o1, %l0, %o1 2428 1.1 spz or %g1, %o0, %o0 2429 1.1 spz srlx %o2, %l1, %o2 2430 1.1 spz or %o2, %o1, %o1 2431 1.1 spz 5: 2432 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 2433 1.1 spz xor %g5, %o1, %o1 2434 1.1 spz .word 0x99b02308 !movxtod %o0,%f12 2435 1.1 spz .word 0x9db02309 !movxtod %o1,%f14 2436 1.1 spz 2437 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 2438 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 2439 1.1 spz prefetch [%i0 + 16+63], 20 2440 1.1 spz call _aes256_encrypt_1x 2441 1.1 spz add %i0, 16, %i0 2442 1.1 spz sub %i2, 1, %i2 2443 1.5 christos 2444 1.1 spz stda %f0, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 2445 1.1 spz add %i1, 8, %i1 2446 1.1 spz stda %f2, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 2447 1.1 spz brnz,pt %i2, .L256_cbc_enc_blk_loop 2448 1.1 spz add %i1, 8, %i1 2449 1.1 spz 2450 1.1 spz membar #StoreLoad|#StoreStore 2451 1.1 spz brnz,pt %l5, .L256_cbc_enc_loop 2452 1.1 spz mov %l5, %i2 2453 1.1 spz st %f0, [%i4 + 0] 2454 1.1 spz st %f1, [%i4 + 4] 2455 1.1 spz st %f2, [%i4 + 8] 2456 1.1 spz st %f3, [%i4 + 12] 2457 1.1 spz ret 2458 1.1 spz restore 2459 1.1 spz .type aes256_t4_cbc_encrypt,#function 2460 1.1 spz .size aes256_t4_cbc_encrypt,.-aes256_t4_cbc_encrypt 2461 1.1 spz .globl aes192_t4_cbc_encrypt 2462 1.1 spz .align 32 2463 1.1 spz aes192_t4_cbc_encrypt: 2464 1.4 martin save %sp, -STACK_FRAME, %sp 2465 1.1 spz cmp %i2, 0 2466 1.4 martin be,pn SIZE_T_CC, .L192_cbc_enc_abort 2467 1.1 spz srln %i2, 0, %i2 ! needed on v8+, "nop" on v9 2468 1.1 spz sub %i0, %i1, %l5 ! %i0!=%i1 2469 1.1 spz ld [%i4 + 0], %f0 2470 1.1 spz ld [%i4 + 4], %f1 2471 1.1 spz ld [%i4 + 8], %f2 2472 1.1 spz ld [%i4 + 12], %f3 2473 1.1 spz prefetch [%i0], 20 2474 1.1 spz prefetch [%i0 + 63], 20 2475 1.1 spz call _aes192_load_enckey 2476 1.1 spz and %i0, 7, %l0 2477 1.1 spz andn %i0, 7, %i0 2478 1.1 spz sll %l0, 3, %l0 2479 1.1 spz mov 64, %l1 2480 1.1 spz mov 0xff, %l3 2481 1.1 spz sub %l1, %l0, %l1 2482 1.1 spz and %i1, 7, %l2 2483 1.1 spz cmp %i2, 127 2484 1.1 spz movrnz %l2, 0, %l5 ! if ( %i1&7 || 2485 1.4 martin movleu SIZE_T_CC, 0, %l5 ! %i2<128 || 2486 1.1 spz brnz,pn %l5, .L192cbc_enc_blk ! %i0==%i1) 2487 1.1 spz srl %l3, %l2, %l3 2488 1.1 spz 2489 1.1 spz .word 0xb3b64340 !alignaddrl %i1,%g0,%i1 2490 1.1 spz srlx %i2, 4, %i2 2491 1.1 spz prefetch [%i1], 22 2492 1.1 spz 2493 1.1 spz .L192_cbc_enc_loop: 2494 1.1 spz ldx [%i0 + 0], %o0 2495 1.1 spz brz,pt %l0, 4f 2496 1.1 spz ldx [%i0 + 8], %o1 2497 1.1 spz 2498 1.1 spz ldx [%i0 + 16], %o2 2499 1.1 spz sllx %o0, %l0, %o0 2500 1.1 spz srlx %o1, %l1, %g1 2501 1.1 spz sllx %o1, %l0, %o1 2502 1.1 spz or %g1, %o0, %o0 2503 1.1 spz srlx %o2, %l1, %o2 2504 1.1 spz or %o2, %o1, %o1 2505 1.1 spz 4: 2506 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 2507 1.1 spz xor %g5, %o1, %o1 2508 1.1 spz .word 0x99b02308 !movxtod %o0,%f12 2509 1.1 spz .word 0x9db02309 !movxtod %o1,%f14 2510 1.1 spz 2511 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 2512 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 2513 1.1 spz prefetch [%i1 + 63], 22 2514 1.1 spz prefetch [%i0 + 16+63], 20 2515 1.1 spz call _aes192_encrypt_1x 2516 1.1 spz add %i0, 16, %i0 2517 1.1 spz 2518 1.1 spz brnz,pn %l2, 2f 2519 1.1 spz sub %i2, 1, %i2 2520 1.5 christos 2521 1.1 spz std %f0, [%i1 + 0] 2522 1.1 spz std %f2, [%i1 + 8] 2523 1.1 spz brnz,pt %i2, .L192_cbc_enc_loop 2524 1.1 spz add %i1, 16, %i1 2525 1.1 spz st %f0, [%i4 + 0] 2526 1.1 spz st %f1, [%i4 + 4] 2527 1.1 spz st %f2, [%i4 + 8] 2528 1.1 spz st %f3, [%i4 + 12] 2529 1.1 spz .L192_cbc_enc_abort: 2530 1.1 spz ret 2531 1.1 spz restore 2532 1.1 spz 2533 1.1 spz .align 16 2534 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 2535 1.1 spz ! and ~3x deterioration 2536 1.1 spz ! in inp==out case 2537 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 ! handle unaligned output 2538 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 2539 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 2540 1.1 spz 2541 1.1 spz stda %f4, [%i1 + %l3]0xc0 ! partial store 2542 1.1 spz std %f6, [%i1 + 8] 2543 1.1 spz add %i1, 16, %i1 2544 1.1 spz orn %g0, %l3, %l3 2545 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 2546 1.1 spz 2547 1.1 spz brnz,pt %i2, .L192_cbc_enc_loop+4 2548 1.1 spz orn %g0, %l3, %l3 2549 1.1 spz st %f0, [%i4 + 0] 2550 1.1 spz st %f1, [%i4 + 4] 2551 1.1 spz st %f2, [%i4 + 8] 2552 1.1 spz st %f3, [%i4 + 12] 2553 1.1 spz ret 2554 1.1 spz restore 2555 1.1 spz 2556 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2557 1.1 spz .align 32 2558 1.1 spz .L192cbc_enc_blk: 2559 1.1 spz add %i1, %i2, %l5 2560 1.1 spz and %l5, 63, %l5 ! tail 2561 1.1 spz sub %i2, %l5, %i2 2562 1.1 spz add %l5, 15, %l5 ! round up to 16n 2563 1.1 spz srlx %i2, 4, %i2 2564 1.1 spz srl %l5, 4, %l5 2565 1.1 spz 2566 1.1 spz .L192_cbc_enc_blk_loop: 2567 1.1 spz ldx [%i0 + 0], %o0 2568 1.1 spz brz,pt %l0, 5f 2569 1.1 spz ldx [%i0 + 8], %o1 2570 1.1 spz 2571 1.1 spz ldx [%i0 + 16], %o2 2572 1.1 spz sllx %o0, %l0, %o0 2573 1.1 spz srlx %o1, %l1, %g1 2574 1.1 spz sllx %o1, %l0, %o1 2575 1.1 spz or %g1, %o0, %o0 2576 1.1 spz srlx %o2, %l1, %o2 2577 1.1 spz or %o2, %o1, %o1 2578 1.1 spz 5: 2579 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 2580 1.1 spz xor %g5, %o1, %o1 2581 1.1 spz .word 0x99b02308 !movxtod %o0,%f12 2582 1.1 spz .word 0x9db02309 !movxtod %o1,%f14 2583 1.1 spz 2584 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 2585 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 2586 1.1 spz prefetch [%i0 + 16+63], 20 2587 1.1 spz call _aes192_encrypt_1x 2588 1.1 spz add %i0, 16, %i0 2589 1.1 spz sub %i2, 1, %i2 2590 1.5 christos 2591 1.1 spz stda %f0, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 2592 1.1 spz add %i1, 8, %i1 2593 1.1 spz stda %f2, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 2594 1.1 spz brnz,pt %i2, .L192_cbc_enc_blk_loop 2595 1.1 spz add %i1, 8, %i1 2596 1.1 spz 2597 1.1 spz membar #StoreLoad|#StoreStore 2598 1.1 spz brnz,pt %l5, .L192_cbc_enc_loop 2599 1.1 spz mov %l5, %i2 2600 1.1 spz st %f0, [%i4 + 0] 2601 1.1 spz st %f1, [%i4 + 4] 2602 1.1 spz st %f2, [%i4 + 8] 2603 1.1 spz st %f3, [%i4 + 12] 2604 1.1 spz ret 2605 1.1 spz restore 2606 1.1 spz .type aes192_t4_cbc_encrypt,#function 2607 1.1 spz .size aes192_t4_cbc_encrypt,.-aes192_t4_cbc_encrypt 2608 1.1 spz .globl aes256_t4_ctr32_encrypt 2609 1.1 spz .align 32 2610 1.1 spz aes256_t4_ctr32_encrypt: 2611 1.4 martin save %sp, -STACK_FRAME, %sp 2612 1.1 spz srln %i2, 0, %i2 ! needed on v8+, "nop" on v9 2613 1.1 spz 2614 1.1 spz prefetch [%i0], 20 2615 1.1 spz prefetch [%i0 + 63], 20 2616 1.1 spz call _aes256_load_enckey 2617 1.1 spz sllx %i2, 4, %i2 2618 1.1 spz 2619 1.1 spz ld [%i4 + 0], %l4 ! counter 2620 1.1 spz ld [%i4 + 4], %l5 2621 1.1 spz ld [%i4 + 8], %l6 2622 1.1 spz ld [%i4 + 12], %l7 2623 1.1 spz 2624 1.1 spz sllx %l4, 32, %o5 2625 1.1 spz or %l5, %o5, %o5 2626 1.1 spz sllx %l6, 32, %g1 2627 1.1 spz xor %o5, %g4, %g4 ! ^= rk[0] 2628 1.1 spz xor %g1, %g5, %g5 2629 1.1 spz .word 0x9db02304 !movxtod %g4,%f14 ! most significant 64 bits 2630 1.1 spz 2631 1.1 spz sub %i0, %i1, %l5 ! %i0!=%i1 2632 1.1 spz and %i0, 7, %l0 2633 1.1 spz andn %i0, 7, %i0 2634 1.1 spz sll %l0, 3, %l0 2635 1.1 spz mov 64, %l1 2636 1.1 spz mov 0xff, %l3 2637 1.1 spz sub %l1, %l0, %l1 2638 1.1 spz and %i1, 7, %l2 2639 1.1 spz cmp %i2, 255 2640 1.1 spz movrnz %l2, 0, %l5 ! if ( %i1&7 || 2641 1.4 martin movleu SIZE_T_CC, 0, %l5 ! %i2<256 || 2642 1.1 spz brnz,pn %l5, .L256_ctr32_blk ! %i0==%i1) 2643 1.1 spz srl %l3, %l2, %l3 2644 1.1 spz 2645 1.1 spz andcc %i2, 16, %g0 ! is number of blocks even? 2646 1.1 spz .word 0xb3b64340 !alignaddrl %i1,%g0,%i1 2647 1.1 spz bz %icc, .L256_ctr32_loop2x 2648 1.1 spz srlx %i2, 4, %i2 2649 1.1 spz .L256_ctr32_loop: 2650 1.1 spz ldx [%i0 + 0], %o0 2651 1.1 spz brz,pt %l0, 4f 2652 1.1 spz ldx [%i0 + 8], %o1 2653 1.1 spz 2654 1.1 spz ldx [%i0 + 16], %o2 2655 1.1 spz sllx %o0, %l0, %o0 2656 1.1 spz srlx %o1, %l1, %g1 2657 1.1 spz sllx %o1, %l0, %o1 2658 1.1 spz or %g1, %o0, %o0 2659 1.1 spz srlx %o2, %l1, %o2 2660 1.1 spz or %o2, %o1, %o1 2661 1.1 spz 4: 2662 1.1 spz xor %g5, %l7, %g1 ! ^= rk[0] 2663 1.1 spz add %l7, 1, %l7 2664 1.1 spz .word 0x85b02301 !movxtod %g1,%f2 2665 1.1 spz srl %l7, 0, %l7 ! clruw 2666 1.1 spz prefetch [%i1 + 63], 22 2667 1.1 spz prefetch [%i0 + 16+63], 20 2668 1.1 spz .word 0x88cc040e !aes_eround01 %f16,%f14,%f2,%f4 2669 1.1 spz .word 0x84cc842e !aes_eround23 %f18,%f14,%f2,%f2 2670 1.1 spz call _aes256_encrypt_1x+8 2671 1.1 spz add %i0, 16, %i0 2672 1.1 spz 2673 1.1 spz .word 0x95b02308 !movxtod %o0,%f10 2674 1.1 spz .word 0x99b02309 !movxtod %o1,%f12 2675 1.1 spz .word 0x81b28d80 !fxor %f10,%f0,%f0 ! ^= inp 2676 1.1 spz .word 0x85b30d82 !fxor %f12,%f2,%f2 2677 1.1 spz 2678 1.1 spz brnz,pn %l2, 2f 2679 1.1 spz sub %i2, 1, %i2 2680 1.5 christos 2681 1.1 spz std %f0, [%i1 + 0] 2682 1.1 spz std %f2, [%i1 + 8] 2683 1.1 spz brnz,pt %i2, .L256_ctr32_loop2x 2684 1.1 spz add %i1, 16, %i1 2685 1.1 spz 2686 1.1 spz ret 2687 1.1 spz restore 2688 1.1 spz 2689 1.1 spz .align 16 2690 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 2691 1.1 spz ! and ~3x deterioration 2692 1.1 spz ! in inp==out case 2693 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 ! handle unaligned output 2694 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 2695 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 2696 1.1 spz stda %f4, [%i1 + %l3]0xc0 ! partial store 2697 1.1 spz std %f6, [%i1 + 8] 2698 1.1 spz add %i1, 16, %i1 2699 1.1 spz orn %g0, %l3, %l3 2700 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 2701 1.1 spz 2702 1.1 spz brnz,pt %i2, .L256_ctr32_loop2x+4 2703 1.1 spz orn %g0, %l3, %l3 2704 1.1 spz 2705 1.1 spz ret 2706 1.1 spz restore 2707 1.1 spz 2708 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2709 1.1 spz .align 32 2710 1.1 spz .L256_ctr32_loop2x: 2711 1.1 spz ldx [%i0 + 0], %o0 2712 1.1 spz ldx [%i0 + 8], %o1 2713 1.1 spz ldx [%i0 + 16], %o2 2714 1.1 spz brz,pt %l0, 4f 2715 1.1 spz ldx [%i0 + 24], %o3 2716 1.1 spz 2717 1.1 spz ldx [%i0 + 32], %o4 2718 1.1 spz sllx %o0, %l0, %o0 2719 1.1 spz srlx %o1, %l1, %g1 2720 1.1 spz or %g1, %o0, %o0 2721 1.1 spz sllx %o1, %l0, %o1 2722 1.1 spz srlx %o2, %l1, %g1 2723 1.1 spz or %g1, %o1, %o1 2724 1.1 spz sllx %o2, %l0, %o2 2725 1.1 spz srlx %o3, %l1, %g1 2726 1.1 spz or %g1, %o2, %o2 2727 1.1 spz sllx %o3, %l0, %o3 2728 1.1 spz srlx %o4, %l1, %o4 2729 1.1 spz or %o4, %o3, %o3 2730 1.1 spz 4: 2731 1.1 spz xor %g5, %l7, %g1 ! ^= rk[0] 2732 1.1 spz add %l7, 1, %l7 2733 1.1 spz .word 0x85b02301 !movxtod %g1,%f2 2734 1.1 spz srl %l7, 0, %l7 ! clruw 2735 1.1 spz xor %g5, %l7, %g1 2736 1.1 spz add %l7, 1, %l7 2737 1.1 spz .word 0x8db02301 !movxtod %g1,%f6 2738 1.1 spz srl %l7, 0, %l7 ! clruw 2739 1.1 spz prefetch [%i1 + 63], 22 2740 1.1 spz prefetch [%i0 + 32+63], 20 2741 1.1 spz .word 0x90cc040e !aes_eround01 %f16,%f14,%f2,%f8 2742 1.1 spz .word 0x84cc842e !aes_eround23 %f18,%f14,%f2,%f2 2743 1.1 spz .word 0x94cc0c0e !aes_eround01 %f16,%f14,%f6,%f10 2744 1.1 spz .word 0x8ccc8c2e !aes_eround23 %f18,%f14,%f6,%f6 2745 1.1 spz call _aes256_encrypt_2x+16 2746 1.1 spz add %i0, 32, %i0 2747 1.1 spz 2748 1.1 spz .word 0x91b02308 !movxtod %o0,%f8 2749 1.1 spz .word 0x95b02309 !movxtod %o1,%f10 2750 1.1 spz .word 0x99b0230a !movxtod %o2,%f12 2751 1.1 spz .word 0x81b20d80 !fxor %f8,%f0,%f0 ! ^= inp 2752 1.1 spz .word 0x91b0230b !movxtod %o3,%f8 2753 1.1 spz .word 0x85b28d82 !fxor %f10,%f2,%f2 2754 1.1 spz .word 0x89b30d84 !fxor %f12,%f4,%f4 2755 1.1 spz .word 0x8db20d86 !fxor %f8,%f6,%f6 2756 1.1 spz 2757 1.1 spz brnz,pn %l2, 2f 2758 1.1 spz sub %i2, 2, %i2 2759 1.5 christos 2760 1.1 spz std %f0, [%i1 + 0] 2761 1.1 spz std %f2, [%i1 + 8] 2762 1.1 spz std %f4, [%i1 + 16] 2763 1.1 spz std %f6, [%i1 + 24] 2764 1.1 spz brnz,pt %i2, .L256_ctr32_loop2x 2765 1.1 spz add %i1, 32, %i1 2766 1.1 spz 2767 1.1 spz ret 2768 1.1 spz restore 2769 1.1 spz 2770 1.1 spz .align 16 2771 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 2772 1.1 spz ! and ~3x deterioration 2773 1.1 spz ! in inp==out case 2774 1.1 spz .word 0x91b00900 !faligndata %f0,%f0,%f8 ! handle unaligned output 2775 1.1 spz .word 0x81b00902 !faligndata %f0,%f2,%f0 2776 1.1 spz .word 0x85b08904 !faligndata %f2,%f4,%f2 2777 1.1 spz .word 0x89b10906 !faligndata %f4,%f6,%f4 2778 1.1 spz .word 0x8db18906 !faligndata %f6,%f6,%f6 2779 1.1 spz 2780 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 2781 1.1 spz std %f0, [%i1 + 8] 2782 1.1 spz std %f2, [%i1 + 16] 2783 1.1 spz std %f4, [%i1 + 24] 2784 1.1 spz add %i1, 32, %i1 2785 1.1 spz orn %g0, %l3, %l3 2786 1.1 spz stda %f6, [%i1 + %l3]0xc0 ! partial store 2787 1.1 spz 2788 1.1 spz brnz,pt %i2, .L256_ctr32_loop2x+4 2789 1.1 spz orn %g0, %l3, %l3 2790 1.1 spz 2791 1.1 spz ret 2792 1.1 spz restore 2793 1.1 spz 2794 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2795 1.1 spz .align 32 2796 1.1 spz .L256_ctr32_blk: 2797 1.1 spz add %i1, %i2, %l5 2798 1.1 spz and %l5, 63, %l5 ! tail 2799 1.1 spz sub %i2, %l5, %i2 2800 1.1 spz add %l5, 15, %l5 ! round up to 16n 2801 1.1 spz srlx %i2, 4, %i2 2802 1.1 spz srl %l5, 4, %l5 2803 1.1 spz sub %i2, 1, %i2 2804 1.1 spz add %l5, 1, %l5 2805 1.1 spz 2806 1.1 spz .L256_ctr32_blk_loop2x: 2807 1.1 spz ldx [%i0 + 0], %o0 2808 1.1 spz ldx [%i0 + 8], %o1 2809 1.1 spz ldx [%i0 + 16], %o2 2810 1.1 spz brz,pt %l0, 5f 2811 1.1 spz ldx [%i0 + 24], %o3 2812 1.1 spz 2813 1.1 spz ldx [%i0 + 32], %o4 2814 1.1 spz sllx %o0, %l0, %o0 2815 1.1 spz srlx %o1, %l1, %g1 2816 1.1 spz or %g1, %o0, %o0 2817 1.1 spz sllx %o1, %l0, %o1 2818 1.1 spz srlx %o2, %l1, %g1 2819 1.1 spz or %g1, %o1, %o1 2820 1.1 spz sllx %o2, %l0, %o2 2821 1.1 spz srlx %o3, %l1, %g1 2822 1.1 spz or %g1, %o2, %o2 2823 1.1 spz sllx %o3, %l0, %o3 2824 1.1 spz srlx %o4, %l1, %o4 2825 1.1 spz or %o4, %o3, %o3 2826 1.1 spz 5: 2827 1.1 spz xor %g5, %l7, %g1 ! ^= rk[0] 2828 1.1 spz add %l7, 1, %l7 2829 1.1 spz .word 0x85b02301 !movxtod %g1,%f2 2830 1.1 spz srl %l7, 0, %l7 ! clruw 2831 1.1 spz xor %g5, %l7, %g1 2832 1.1 spz add %l7, 1, %l7 2833 1.1 spz .word 0x8db02301 !movxtod %g1,%f6 2834 1.1 spz srl %l7, 0, %l7 ! clruw 2835 1.1 spz prefetch [%i0 + 32+63], 20 2836 1.1 spz .word 0x90cc040e !aes_eround01 %f16,%f14,%f2,%f8 2837 1.1 spz .word 0x84cc842e !aes_eround23 %f18,%f14,%f2,%f2 2838 1.1 spz .word 0x94cc0c0e !aes_eround01 %f16,%f14,%f6,%f10 2839 1.1 spz .word 0x8ccc8c2e !aes_eround23 %f18,%f14,%f6,%f6 2840 1.1 spz call _aes256_encrypt_2x+16 2841 1.1 spz add %i0, 32, %i0 2842 1.1 spz subcc %i2, 2, %i2 2843 1.1 spz 2844 1.1 spz .word 0x91b02308 !movxtod %o0,%f8 2845 1.1 spz .word 0x95b02309 !movxtod %o1,%f10 2846 1.1 spz .word 0x99b0230a !movxtod %o2,%f12 2847 1.1 spz .word 0x81b20d80 !fxor %f8,%f0,%f0 ! ^= inp 2848 1.1 spz .word 0x91b0230b !movxtod %o3,%f8 2849 1.1 spz .word 0x85b28d82 !fxor %f10,%f2,%f2 2850 1.1 spz .word 0x89b30d84 !fxor %f12,%f4,%f4 2851 1.1 spz .word 0x8db20d86 !fxor %f8,%f6,%f6 2852 1.1 spz 2853 1.1 spz stda %f0, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 2854 1.1 spz add %i1, 8, %i1 2855 1.1 spz stda %f2, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 2856 1.1 spz add %i1, 8, %i1 2857 1.1 spz stda %f4, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 2858 1.1 spz add %i1, 8, %i1 2859 1.1 spz stda %f6, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 2860 1.4 martin bgu,pt SIZE_T_CC, .L256_ctr32_blk_loop2x 2861 1.1 spz add %i1, 8, %i1 2862 1.1 spz 2863 1.1 spz add %l5, %i2, %i2 2864 1.1 spz andcc %i2, 1, %g0 ! is number of blocks even? 2865 1.1 spz membar #StoreLoad|#StoreStore 2866 1.1 spz bnz,pt %icc, .L256_ctr32_loop 2867 1.1 spz srl %i2, 0, %i2 2868 1.1 spz brnz,pn %i2, .L256_ctr32_loop2x 2869 1.1 spz nop 2870 1.1 spz 2871 1.1 spz ret 2872 1.1 spz restore 2873 1.1 spz .type aes256_t4_ctr32_encrypt,#function 2874 1.1 spz .size aes256_t4_ctr32_encrypt,.-aes256_t4_ctr32_encrypt 2875 1.1 spz .globl aes256_t4_xts_encrypt 2876 1.1 spz .align 32 2877 1.1 spz aes256_t4_xts_encrypt: 2878 1.4 martin save %sp, -STACK_FRAME-16, %sp 2879 1.1 spz srln %i2, 0, %i2 ! needed on v8+, "nop" on v9 2880 1.1 spz 2881 1.1 spz mov %i5, %o0 2882 1.4 martin add %fp, STACK_BIAS-16, %o1 2883 1.1 spz call aes_t4_encrypt 2884 1.1 spz mov %i4, %o2 2885 1.1 spz 2886 1.4 martin add %fp, STACK_BIAS-16, %l7 2887 1.1 spz ldxa [%l7]0x88, %g2 2888 1.4 martin add %fp, STACK_BIAS-8, %l7 2889 1.1 spz ldxa [%l7]0x88, %g3 ! %g3:%g2 is tweak 2890 1.1 spz 2891 1.1 spz sethi %hi(0x76543210), %l7 2892 1.1 spz or %l7, %lo(0x76543210), %l7 2893 1.1 spz .word 0x81b5c320 !bmask %l7,%g0,%g0 ! byte swap mask 2894 1.1 spz 2895 1.1 spz prefetch [%i0], 20 2896 1.1 spz prefetch [%i0 + 63], 20 2897 1.1 spz call _aes256_load_enckey 2898 1.1 spz and %i2, 15, %i5 2899 1.1 spz and %i2, -16, %i2 2900 1.1 spz 2901 1.1 spz sub %i0, %i1, %l5 ! %i0!=%i1 2902 1.1 spz and %i0, 7, %l0 2903 1.1 spz andn %i0, 7, %i0 2904 1.1 spz sll %l0, 3, %l0 2905 1.1 spz mov 64, %l1 2906 1.1 spz mov 0xff, %l3 2907 1.1 spz sub %l1, %l0, %l1 2908 1.1 spz and %i1, 7, %l2 2909 1.1 spz cmp %i2, 255 2910 1.1 spz movrnz %l2, 0, %l5 ! if ( %i1&7 || 2911 1.4 martin movleu SIZE_T_CC, 0, %l5 ! %i2<256 || 2912 1.1 spz brnz,pn %l5, .L256_xts_enblk ! %i0==%i1) 2913 1.1 spz srl %l3, %l2, %l3 2914 1.1 spz 2915 1.1 spz andcc %i2, 16, %g0 ! is number of blocks even? 2916 1.1 spz .word 0xb3b64340 !alignaddrl %i1,%g0,%i1 2917 1.1 spz bz %icc, .L256_xts_enloop2x 2918 1.1 spz srlx %i2, 4, %i2 2919 1.1 spz .L256_xts_enloop: 2920 1.1 spz ldx [%i0 + 0], %o0 2921 1.1 spz brz,pt %l0, 4f 2922 1.1 spz ldx [%i0 + 8], %o1 2923 1.1 spz 2924 1.1 spz ldx [%i0 + 16], %o2 2925 1.1 spz sllx %o0, %l0, %o0 2926 1.1 spz srlx %o1, %l1, %g1 2927 1.1 spz sllx %o1, %l0, %o1 2928 1.1 spz or %g1, %o0, %o0 2929 1.1 spz srlx %o2, %l1, %o2 2930 1.1 spz or %o2, %o1, %o1 2931 1.1 spz 4: 2932 1.1 spz .word 0x99b02302 !movxtod %g2,%f12 2933 1.1 spz .word 0x9db02303 !movxtod %g3,%f14 2934 1.1 spz .word 0x99b3098c !bshuffle %f12,%f12,%f12 2935 1.1 spz .word 0x9db3898e !bshuffle %f14,%f14,%f14 2936 1.1 spz 2937 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 2938 1.1 spz xor %g5, %o1, %o1 2939 1.1 spz .word 0x81b02308 !movxtod %o0,%f0 2940 1.1 spz .word 0x85b02309 !movxtod %o1,%f2 2941 1.1 spz 2942 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 2943 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 2944 1.1 spz 2945 1.1 spz prefetch [%i1 + 63], 22 2946 1.1 spz prefetch [%i0 + 16+63], 20 2947 1.1 spz call _aes256_encrypt_1x 2948 1.1 spz add %i0, 16, %i0 2949 1.1 spz 2950 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 2951 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 2952 1.1 spz 2953 1.1 spz srax %g3, 63, %l7 ! next tweak value 2954 1.1 spz addcc %g2, %g2, %g2 2955 1.1 spz and %l7, 0x87, %l7 2956 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 2957 1.1 spz xor %l7, %g2, %g2 2958 1.1 spz 2959 1.1 spz brnz,pn %l2, 2f 2960 1.1 spz sub %i2, 1, %i2 2961 1.5 christos 2962 1.1 spz std %f0, [%i1 + 0] 2963 1.1 spz std %f2, [%i1 + 8] 2964 1.1 spz brnz,pt %i2, .L256_xts_enloop2x 2965 1.1 spz add %i1, 16, %i1 2966 1.1 spz 2967 1.1 spz brnz,pn %i5, .L256_xts_ensteal 2968 1.1 spz nop 2969 1.1 spz 2970 1.1 spz ret 2971 1.1 spz restore 2972 1.1 spz 2973 1.1 spz .align 16 2974 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 2975 1.1 spz ! and ~3x deterioration 2976 1.1 spz ! in inp==out case 2977 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 ! handle unaligned output 2978 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 2979 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 2980 1.1 spz stda %f4, [%i1 + %l3]0xc0 ! partial store 2981 1.1 spz std %f6, [%i1 + 8] 2982 1.1 spz add %i1, 16, %i1 2983 1.1 spz orn %g0, %l3, %l3 2984 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 2985 1.1 spz 2986 1.1 spz brnz,pt %i2, .L256_xts_enloop2x+4 2987 1.1 spz orn %g0, %l3, %l3 2988 1.1 spz 2989 1.1 spz brnz,pn %i5, .L256_xts_ensteal 2990 1.1 spz nop 2991 1.1 spz 2992 1.1 spz ret 2993 1.1 spz restore 2994 1.1 spz 2995 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2996 1.1 spz .align 32 2997 1.1 spz .L256_xts_enloop2x: 2998 1.1 spz ldx [%i0 + 0], %o0 2999 1.1 spz ldx [%i0 + 8], %o1 3000 1.1 spz ldx [%i0 + 16], %o2 3001 1.1 spz brz,pt %l0, 4f 3002 1.1 spz ldx [%i0 + 24], %o3 3003 1.1 spz 3004 1.1 spz ldx [%i0 + 32], %o4 3005 1.1 spz sllx %o0, %l0, %o0 3006 1.1 spz srlx %o1, %l1, %g1 3007 1.1 spz or %g1, %o0, %o0 3008 1.1 spz sllx %o1, %l0, %o1 3009 1.1 spz srlx %o2, %l1, %g1 3010 1.1 spz or %g1, %o1, %o1 3011 1.1 spz sllx %o2, %l0, %o2 3012 1.1 spz srlx %o3, %l1, %g1 3013 1.1 spz or %g1, %o2, %o2 3014 1.1 spz sllx %o3, %l0, %o3 3015 1.1 spz srlx %o4, %l1, %o4 3016 1.1 spz or %o4, %o3, %o3 3017 1.1 spz 4: 3018 1.1 spz .word 0x99b02302 !movxtod %g2,%f12 3019 1.1 spz .word 0x9db02303 !movxtod %g3,%f14 3020 1.1 spz .word 0x99b3098c !bshuffle %f12,%f12,%f12 3021 1.1 spz .word 0x9db3898e !bshuffle %f14,%f14,%f14 3022 1.1 spz 3023 1.1 spz srax %g3, 63, %l7 ! next tweak value 3024 1.1 spz addcc %g2, %g2, %g2 3025 1.1 spz and %l7, 0x87, %l7 3026 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 3027 1.1 spz xor %l7, %g2, %g2 3028 1.1 spz 3029 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 3030 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 3031 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 3032 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 3033 1.1 spz 3034 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 3035 1.1 spz xor %g5, %o1, %o1 3036 1.1 spz xor %g4, %o2, %o2 ! ^= rk[0] 3037 1.1 spz xor %g5, %o3, %o3 3038 1.1 spz .word 0x81b02308 !movxtod %o0,%f0 3039 1.1 spz .word 0x85b02309 !movxtod %o1,%f2 3040 1.1 spz .word 0x89b0230a !movxtod %o2,%f4 3041 1.1 spz .word 0x8db0230b !movxtod %o3,%f6 3042 1.1 spz 3043 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 3044 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 3045 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 ! ^= tweak[0] 3046 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 3047 1.1 spz 3048 1.1 spz prefetch [%i1 + 63], 22 3049 1.1 spz prefetch [%i0 + 32+63], 20 3050 1.1 spz call _aes256_encrypt_2x 3051 1.1 spz add %i0, 32, %i0 3052 1.1 spz 3053 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 3054 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 3055 1.1 spz 3056 1.1 spz srax %g3, 63, %l7 ! next tweak value 3057 1.1 spz addcc %g2, %g2, %g2 3058 1.1 spz and %l7, 0x87, %l7 3059 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 3060 1.1 spz xor %l7, %g2, %g2 3061 1.1 spz 3062 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 3063 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 3064 1.1 spz 3065 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 3066 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 3067 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 3068 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 3069 1.1 spz 3070 1.1 spz brnz,pn %l2, 2f 3071 1.1 spz sub %i2, 2, %i2 3072 1.5 christos 3073 1.1 spz std %f0, [%i1 + 0] 3074 1.1 spz std %f2, [%i1 + 8] 3075 1.1 spz std %f4, [%i1 + 16] 3076 1.1 spz std %f6, [%i1 + 24] 3077 1.1 spz brnz,pt %i2, .L256_xts_enloop2x 3078 1.1 spz add %i1, 32, %i1 3079 1.1 spz 3080 1.1 spz .word 0x81b00f04 !fsrc2 %f0,%f4,%f0 3081 1.1 spz .word 0x85b00f06 !fsrc2 %f0,%f6,%f2 3082 1.1 spz brnz,pn %i5, .L256_xts_ensteal 3083 1.1 spz nop 3084 1.1 spz 3085 1.1 spz ret 3086 1.1 spz restore 3087 1.1 spz 3088 1.1 spz .align 16 3089 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 3090 1.1 spz ! and ~3x deterioration 3091 1.1 spz ! in inp==out case 3092 1.1 spz .word 0x91b00900 !faligndata %f0,%f0,%f8 ! handle unaligned output 3093 1.1 spz .word 0x95b00902 !faligndata %f0,%f2,%f10 3094 1.1 spz .word 0x99b08904 !faligndata %f2,%f4,%f12 3095 1.1 spz .word 0x9db10906 !faligndata %f4,%f6,%f14 3096 1.1 spz .word 0x81b18906 !faligndata %f6,%f6,%f0 3097 1.1 spz 3098 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 3099 1.1 spz std %f10, [%i1 + 8] 3100 1.1 spz std %f12, [%i1 + 16] 3101 1.1 spz std %f14, [%i1 + 24] 3102 1.1 spz add %i1, 32, %i1 3103 1.1 spz orn %g0, %l3, %l3 3104 1.1 spz stda %f0, [%i1 + %l3]0xc0 ! partial store 3105 1.1 spz 3106 1.1 spz brnz,pt %i2, .L256_xts_enloop2x+4 3107 1.1 spz orn %g0, %l3, %l3 3108 1.1 spz 3109 1.1 spz .word 0x81b00f04 !fsrc2 %f0,%f4,%f0 3110 1.1 spz .word 0x85b00f06 !fsrc2 %f0,%f6,%f2 3111 1.1 spz brnz,pn %i5, .L256_xts_ensteal 3112 1.1 spz nop 3113 1.1 spz 3114 1.1 spz ret 3115 1.1 spz restore 3116 1.1 spz 3117 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 3118 1.1 spz .align 32 3119 1.1 spz .L256_xts_enblk: 3120 1.1 spz add %i1, %i2, %l5 3121 1.1 spz and %l5, 63, %l5 ! tail 3122 1.1 spz sub %i2, %l5, %i2 3123 1.1 spz add %l5, 15, %l5 ! round up to 16n 3124 1.1 spz srlx %i2, 4, %i2 3125 1.1 spz srl %l5, 4, %l5 3126 1.1 spz sub %i2, 1, %i2 3127 1.1 spz add %l5, 1, %l5 3128 1.1 spz 3129 1.1 spz .L256_xts_enblk2x: 3130 1.1 spz ldx [%i0 + 0], %o0 3131 1.1 spz ldx [%i0 + 8], %o1 3132 1.1 spz ldx [%i0 + 16], %o2 3133 1.1 spz brz,pt %l0, 5f 3134 1.1 spz ldx [%i0 + 24], %o3 3135 1.1 spz 3136 1.1 spz ldx [%i0 + 32], %o4 3137 1.1 spz sllx %o0, %l0, %o0 3138 1.1 spz srlx %o1, %l1, %g1 3139 1.1 spz or %g1, %o0, %o0 3140 1.1 spz sllx %o1, %l0, %o1 3141 1.1 spz srlx %o2, %l1, %g1 3142 1.1 spz or %g1, %o1, %o1 3143 1.1 spz sllx %o2, %l0, %o2 3144 1.1 spz srlx %o3, %l1, %g1 3145 1.1 spz or %g1, %o2, %o2 3146 1.1 spz sllx %o3, %l0, %o3 3147 1.1 spz srlx %o4, %l1, %o4 3148 1.1 spz or %o4, %o3, %o3 3149 1.1 spz 5: 3150 1.1 spz .word 0x99b02302 !movxtod %g2,%f12 3151 1.1 spz .word 0x9db02303 !movxtod %g3,%f14 3152 1.1 spz .word 0x99b3098c !bshuffle %f12,%f12,%f12 3153 1.1 spz .word 0x9db3898e !bshuffle %f14,%f14,%f14 3154 1.1 spz 3155 1.1 spz srax %g3, 63, %l7 ! next tweak value 3156 1.1 spz addcc %g2, %g2, %g2 3157 1.1 spz and %l7, 0x87, %l7 3158 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 3159 1.1 spz xor %l7, %g2, %g2 3160 1.1 spz 3161 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 3162 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 3163 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 3164 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 3165 1.1 spz 3166 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 3167 1.1 spz xor %g5, %o1, %o1 3168 1.1 spz xor %g4, %o2, %o2 ! ^= rk[0] 3169 1.1 spz xor %g5, %o3, %o3 3170 1.1 spz .word 0x81b02308 !movxtod %o0,%f0 3171 1.1 spz .word 0x85b02309 !movxtod %o1,%f2 3172 1.1 spz .word 0x89b0230a !movxtod %o2,%f4 3173 1.1 spz .word 0x8db0230b !movxtod %o3,%f6 3174 1.1 spz 3175 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 3176 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 3177 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 ! ^= tweak[0] 3178 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 3179 1.1 spz 3180 1.1 spz prefetch [%i0 + 32+63], 20 3181 1.1 spz call _aes256_encrypt_2x 3182 1.1 spz add %i0, 32, %i0 3183 1.1 spz 3184 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 3185 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 3186 1.1 spz 3187 1.1 spz srax %g3, 63, %l7 ! next tweak value 3188 1.1 spz addcc %g2, %g2, %g2 3189 1.1 spz and %l7, 0x87, %l7 3190 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 3191 1.1 spz xor %l7, %g2, %g2 3192 1.1 spz 3193 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 3194 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 3195 1.1 spz 3196 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 3197 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 3198 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 3199 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 3200 1.1 spz 3201 1.1 spz subcc %i2, 2, %i2 3202 1.1 spz stda %f0, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 3203 1.1 spz add %i1, 8, %i1 3204 1.1 spz stda %f2, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 3205 1.1 spz add %i1, 8, %i1 3206 1.1 spz stda %f4, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 3207 1.1 spz add %i1, 8, %i1 3208 1.1 spz stda %f6, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 3209 1.4 martin bgu,pt SIZE_T_CC, .L256_xts_enblk2x 3210 1.1 spz add %i1, 8, %i1 3211 1.1 spz 3212 1.1 spz add %l5, %i2, %i2 3213 1.1 spz andcc %i2, 1, %g0 ! is number of blocks even? 3214 1.1 spz membar #StoreLoad|#StoreStore 3215 1.1 spz bnz,pt %icc, .L256_xts_enloop 3216 1.1 spz srl %i2, 0, %i2 3217 1.1 spz brnz,pn %i2, .L256_xts_enloop2x 3218 1.1 spz nop 3219 1.1 spz 3220 1.1 spz .word 0x81b00f04 !fsrc2 %f0,%f4,%f0 3221 1.1 spz .word 0x85b00f06 !fsrc2 %f0,%f6,%f2 3222 1.1 spz brnz,pn %i5, .L256_xts_ensteal 3223 1.1 spz nop 3224 1.1 spz 3225 1.1 spz ret 3226 1.1 spz restore 3227 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 3228 1.1 spz .align 32 3229 1.1 spz .L256_xts_ensteal: 3230 1.4 martin std %f0, [%fp + STACK_BIAS-16] ! copy of output 3231 1.4 martin std %f2, [%fp + STACK_BIAS-8] 3232 1.1 spz 3233 1.1 spz srl %l0, 3, %l0 3234 1.4 martin add %fp, STACK_BIAS-16, %l7 3235 1.1 spz add %i0, %l0, %i0 ! original %i0+%i2&-15 3236 1.1 spz add %i1, %l2, %i1 ! original %i1+%i2&-15 3237 1.1 spz mov 0, %l0 3238 1.1 spz nop ! align 3239 1.1 spz 3240 1.1 spz .L256_xts_enstealing: 3241 1.1 spz ldub [%i0 + %l0], %o0 3242 1.1 spz ldub [%l7 + %l0], %o1 3243 1.1 spz dec %i5 3244 1.1 spz stb %o0, [%l7 + %l0] 3245 1.1 spz stb %o1, [%i1 + %l0] 3246 1.1 spz brnz %i5, .L256_xts_enstealing 3247 1.1 spz inc %l0 3248 1.1 spz 3249 1.1 spz mov %l7, %i0 3250 1.1 spz sub %i1, 16, %i1 3251 1.1 spz mov 0, %l0 3252 1.1 spz sub %i1, %l2, %i1 3253 1.1 spz ba .L256_xts_enloop ! one more time 3254 1.1 spz mov 1, %i2 ! %i5 is 0 3255 1.1 spz ret 3256 1.1 spz restore 3257 1.1 spz .type aes256_t4_xts_encrypt,#function 3258 1.1 spz .size aes256_t4_xts_encrypt,.-aes256_t4_xts_encrypt 3259 1.1 spz .globl aes256_t4_xts_decrypt 3260 1.1 spz .align 32 3261 1.1 spz aes256_t4_xts_decrypt: 3262 1.4 martin save %sp, -STACK_FRAME-16, %sp 3263 1.1 spz srln %i2, 0, %i2 ! needed on v8+, "nop" on v9 3264 1.1 spz 3265 1.1 spz mov %i5, %o0 3266 1.4 martin add %fp, STACK_BIAS-16, %o1 3267 1.1 spz call aes_t4_encrypt 3268 1.1 spz mov %i4, %o2 3269 1.1 spz 3270 1.4 martin add %fp, STACK_BIAS-16, %l7 3271 1.1 spz ldxa [%l7]0x88, %g2 3272 1.4 martin add %fp, STACK_BIAS-8, %l7 3273 1.1 spz ldxa [%l7]0x88, %g3 ! %g3:%g2 is tweak 3274 1.1 spz 3275 1.1 spz sethi %hi(0x76543210), %l7 3276 1.1 spz or %l7, %lo(0x76543210), %l7 3277 1.1 spz .word 0x81b5c320 !bmask %l7,%g0,%g0 ! byte swap mask 3278 1.1 spz 3279 1.1 spz prefetch [%i0], 20 3280 1.1 spz prefetch [%i0 + 63], 20 3281 1.1 spz call _aes256_load_deckey 3282 1.1 spz and %i2, 15, %i5 3283 1.1 spz and %i2, -16, %i2 3284 1.1 spz mov 0, %l7 3285 1.1 spz movrnz %i5, 16, %l7 3286 1.1 spz sub %i2, %l7, %i2 3287 1.1 spz 3288 1.1 spz sub %i0, %i1, %l5 ! %i0!=%i1 3289 1.1 spz and %i0, 7, %l0 3290 1.1 spz andn %i0, 7, %i0 3291 1.1 spz sll %l0, 3, %l0 3292 1.1 spz mov 64, %l1 3293 1.1 spz mov 0xff, %l3 3294 1.1 spz sub %l1, %l0, %l1 3295 1.1 spz and %i1, 7, %l2 3296 1.1 spz cmp %i2, 255 3297 1.1 spz movrnz %l2, 0, %l5 ! if ( %i1&7 || 3298 1.4 martin movleu SIZE_T_CC, 0, %l5 ! %i2<256 || 3299 1.1 spz brnz,pn %l5, .L256_xts_deblk ! %i0==%i1) 3300 1.1 spz srl %l3, %l2, %l3 3301 1.1 spz 3302 1.1 spz andcc %i2, 16, %g0 ! is number of blocks even? 3303 1.1 spz brz,pn %i2, .L256_xts_desteal 3304 1.1 spz .word 0xb3b64340 !alignaddrl %i1,%g0,%i1 3305 1.1 spz bz %icc, .L256_xts_deloop2x 3306 1.1 spz srlx %i2, 4, %i2 3307 1.1 spz .L256_xts_deloop: 3308 1.1 spz ldx [%i0 + 0], %o0 3309 1.1 spz brz,pt %l0, 4f 3310 1.1 spz ldx [%i0 + 8], %o1 3311 1.1 spz 3312 1.1 spz ldx [%i0 + 16], %o2 3313 1.1 spz sllx %o0, %l0, %o0 3314 1.1 spz srlx %o1, %l1, %g1 3315 1.1 spz sllx %o1, %l0, %o1 3316 1.1 spz or %g1, %o0, %o0 3317 1.1 spz srlx %o2, %l1, %o2 3318 1.1 spz or %o2, %o1, %o1 3319 1.1 spz 4: 3320 1.1 spz .word 0x99b02302 !movxtod %g2,%f12 3321 1.1 spz .word 0x9db02303 !movxtod %g3,%f14 3322 1.1 spz .word 0x99b3098c !bshuffle %f12,%f12,%f12 3323 1.1 spz .word 0x9db3898e !bshuffle %f14,%f14,%f14 3324 1.1 spz 3325 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 3326 1.1 spz xor %g5, %o1, %o1 3327 1.1 spz .word 0x81b02308 !movxtod %o0,%f0 3328 1.1 spz .word 0x85b02309 !movxtod %o1,%f2 3329 1.1 spz 3330 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 3331 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 3332 1.1 spz 3333 1.1 spz prefetch [%i1 + 63], 22 3334 1.1 spz prefetch [%i0 + 16+63], 20 3335 1.1 spz call _aes256_decrypt_1x 3336 1.1 spz add %i0, 16, %i0 3337 1.1 spz 3338 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 3339 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 3340 1.1 spz 3341 1.1 spz srax %g3, 63, %l7 ! next tweak value 3342 1.1 spz addcc %g2, %g2, %g2 3343 1.1 spz and %l7, 0x87, %l7 3344 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 3345 1.1 spz xor %l7, %g2, %g2 3346 1.1 spz 3347 1.1 spz brnz,pn %l2, 2f 3348 1.1 spz sub %i2, 1, %i2 3349 1.5 christos 3350 1.1 spz std %f0, [%i1 + 0] 3351 1.1 spz std %f2, [%i1 + 8] 3352 1.1 spz brnz,pt %i2, .L256_xts_deloop2x 3353 1.1 spz add %i1, 16, %i1 3354 1.1 spz 3355 1.1 spz brnz,pn %i5, .L256_xts_desteal 3356 1.1 spz nop 3357 1.1 spz 3358 1.1 spz ret 3359 1.1 spz restore 3360 1.1 spz 3361 1.1 spz .align 16 3362 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 3363 1.1 spz ! and ~3x deterioration 3364 1.1 spz ! in inp==out case 3365 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 ! handle unaligned output 3366 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 3367 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 3368 1.1 spz stda %f4, [%i1 + %l3]0xc0 ! partial store 3369 1.1 spz std %f6, [%i1 + 8] 3370 1.1 spz add %i1, 16, %i1 3371 1.1 spz orn %g0, %l3, %l3 3372 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 3373 1.1 spz 3374 1.1 spz brnz,pt %i2, .L256_xts_deloop2x+4 3375 1.1 spz orn %g0, %l3, %l3 3376 1.1 spz 3377 1.1 spz brnz,pn %i5, .L256_xts_desteal 3378 1.1 spz nop 3379 1.1 spz 3380 1.1 spz ret 3381 1.1 spz restore 3382 1.1 spz 3383 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 3384 1.1 spz .align 32 3385 1.1 spz .L256_xts_deloop2x: 3386 1.1 spz ldx [%i0 + 0], %o0 3387 1.1 spz ldx [%i0 + 8], %o1 3388 1.1 spz ldx [%i0 + 16], %o2 3389 1.1 spz brz,pt %l0, 4f 3390 1.1 spz ldx [%i0 + 24], %o3 3391 1.1 spz 3392 1.1 spz ldx [%i0 + 32], %o4 3393 1.1 spz sllx %o0, %l0, %o0 3394 1.1 spz srlx %o1, %l1, %g1 3395 1.1 spz or %g1, %o0, %o0 3396 1.1 spz sllx %o1, %l0, %o1 3397 1.1 spz srlx %o2, %l1, %g1 3398 1.1 spz or %g1, %o1, %o1 3399 1.1 spz sllx %o2, %l0, %o2 3400 1.1 spz srlx %o3, %l1, %g1 3401 1.1 spz or %g1, %o2, %o2 3402 1.1 spz sllx %o3, %l0, %o3 3403 1.1 spz srlx %o4, %l1, %o4 3404 1.1 spz or %o4, %o3, %o3 3405 1.1 spz 4: 3406 1.1 spz .word 0x99b02302 !movxtod %g2,%f12 3407 1.1 spz .word 0x9db02303 !movxtod %g3,%f14 3408 1.1 spz .word 0x99b3098c !bshuffle %f12,%f12,%f12 3409 1.1 spz .word 0x9db3898e !bshuffle %f14,%f14,%f14 3410 1.1 spz 3411 1.1 spz srax %g3, 63, %l7 ! next tweak value 3412 1.1 spz addcc %g2, %g2, %g2 3413 1.1 spz and %l7, 0x87, %l7 3414 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 3415 1.1 spz xor %l7, %g2, %g2 3416 1.1 spz 3417 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 3418 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 3419 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 3420 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 3421 1.1 spz 3422 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 3423 1.1 spz xor %g5, %o1, %o1 3424 1.1 spz xor %g4, %o2, %o2 ! ^= rk[0] 3425 1.1 spz xor %g5, %o3, %o3 3426 1.1 spz .word 0x81b02308 !movxtod %o0,%f0 3427 1.1 spz .word 0x85b02309 !movxtod %o1,%f2 3428 1.1 spz .word 0x89b0230a !movxtod %o2,%f4 3429 1.1 spz .word 0x8db0230b !movxtod %o3,%f6 3430 1.1 spz 3431 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 3432 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 3433 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 ! ^= tweak[0] 3434 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 3435 1.1 spz 3436 1.1 spz prefetch [%i1 + 63], 22 3437 1.1 spz prefetch [%i0 + 32+63], 20 3438 1.1 spz call _aes256_decrypt_2x 3439 1.1 spz add %i0, 32, %i0 3440 1.1 spz 3441 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 3442 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 3443 1.1 spz 3444 1.1 spz srax %g3, 63, %l7 ! next tweak value 3445 1.1 spz addcc %g2, %g2, %g2 3446 1.1 spz and %l7, 0x87, %l7 3447 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 3448 1.1 spz xor %l7, %g2, %g2 3449 1.1 spz 3450 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 3451 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 3452 1.1 spz 3453 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 3454 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 3455 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 3456 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 3457 1.1 spz 3458 1.1 spz brnz,pn %l2, 2f 3459 1.1 spz sub %i2, 2, %i2 3460 1.5 christos 3461 1.1 spz std %f0, [%i1 + 0] 3462 1.1 spz std %f2, [%i1 + 8] 3463 1.1 spz std %f4, [%i1 + 16] 3464 1.1 spz std %f6, [%i1 + 24] 3465 1.1 spz brnz,pt %i2, .L256_xts_deloop2x 3466 1.1 spz add %i1, 32, %i1 3467 1.1 spz 3468 1.1 spz .word 0x81b00f04 !fsrc2 %f0,%f4,%f0 3469 1.1 spz .word 0x85b00f06 !fsrc2 %f0,%f6,%f2 3470 1.1 spz brnz,pn %i5, .L256_xts_desteal 3471 1.1 spz nop 3472 1.1 spz 3473 1.1 spz ret 3474 1.1 spz restore 3475 1.1 spz 3476 1.1 spz .align 16 3477 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 3478 1.1 spz ! and ~3x deterioration 3479 1.1 spz ! in inp==out case 3480 1.1 spz .word 0x91b00900 !faligndata %f0,%f0,%f8 ! handle unaligned output 3481 1.1 spz .word 0x95b00902 !faligndata %f0,%f2,%f10 3482 1.1 spz .word 0x99b08904 !faligndata %f2,%f4,%f12 3483 1.1 spz .word 0x9db10906 !faligndata %f4,%f6,%f14 3484 1.1 spz .word 0x81b18906 !faligndata %f6,%f6,%f0 3485 1.1 spz 3486 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 3487 1.1 spz std %f10, [%i1 + 8] 3488 1.1 spz std %f12, [%i1 + 16] 3489 1.1 spz std %f14, [%i1 + 24] 3490 1.1 spz add %i1, 32, %i1 3491 1.1 spz orn %g0, %l3, %l3 3492 1.1 spz stda %f0, [%i1 + %l3]0xc0 ! partial store 3493 1.1 spz 3494 1.1 spz brnz,pt %i2, .L256_xts_deloop2x+4 3495 1.1 spz orn %g0, %l3, %l3 3496 1.1 spz 3497 1.1 spz .word 0x81b00f04 !fsrc2 %f0,%f4,%f0 3498 1.1 spz .word 0x85b00f06 !fsrc2 %f0,%f6,%f2 3499 1.1 spz brnz,pn %i5, .L256_xts_desteal 3500 1.1 spz nop 3501 1.1 spz 3502 1.1 spz ret 3503 1.1 spz restore 3504 1.1 spz 3505 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 3506 1.1 spz .align 32 3507 1.1 spz .L256_xts_deblk: 3508 1.1 spz add %i1, %i2, %l5 3509 1.1 spz and %l5, 63, %l5 ! tail 3510 1.1 spz sub %i2, %l5, %i2 3511 1.1 spz add %l5, 15, %l5 ! round up to 16n 3512 1.1 spz srlx %i2, 4, %i2 3513 1.1 spz srl %l5, 4, %l5 3514 1.1 spz sub %i2, 1, %i2 3515 1.1 spz add %l5, 1, %l5 3516 1.1 spz 3517 1.1 spz .L256_xts_deblk2x: 3518 1.1 spz ldx [%i0 + 0], %o0 3519 1.1 spz ldx [%i0 + 8], %o1 3520 1.1 spz ldx [%i0 + 16], %o2 3521 1.1 spz brz,pt %l0, 5f 3522 1.1 spz ldx [%i0 + 24], %o3 3523 1.1 spz 3524 1.1 spz ldx [%i0 + 32], %o4 3525 1.1 spz sllx %o0, %l0, %o0 3526 1.1 spz srlx %o1, %l1, %g1 3527 1.1 spz or %g1, %o0, %o0 3528 1.1 spz sllx %o1, %l0, %o1 3529 1.1 spz srlx %o2, %l1, %g1 3530 1.1 spz or %g1, %o1, %o1 3531 1.1 spz sllx %o2, %l0, %o2 3532 1.1 spz srlx %o3, %l1, %g1 3533 1.1 spz or %g1, %o2, %o2 3534 1.1 spz sllx %o3, %l0, %o3 3535 1.1 spz srlx %o4, %l1, %o4 3536 1.1 spz or %o4, %o3, %o3 3537 1.1 spz 5: 3538 1.1 spz .word 0x99b02302 !movxtod %g2,%f12 3539 1.1 spz .word 0x9db02303 !movxtod %g3,%f14 3540 1.1 spz .word 0x99b3098c !bshuffle %f12,%f12,%f12 3541 1.1 spz .word 0x9db3898e !bshuffle %f14,%f14,%f14 3542 1.1 spz 3543 1.1 spz srax %g3, 63, %l7 ! next tweak value 3544 1.1 spz addcc %g2, %g2, %g2 3545 1.1 spz and %l7, 0x87, %l7 3546 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 3547 1.1 spz xor %l7, %g2, %g2 3548 1.1 spz 3549 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 3550 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 3551 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 3552 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 3553 1.1 spz 3554 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 3555 1.1 spz xor %g5, %o1, %o1 3556 1.1 spz xor %g4, %o2, %o2 ! ^= rk[0] 3557 1.1 spz xor %g5, %o3, %o3 3558 1.1 spz .word 0x81b02308 !movxtod %o0,%f0 3559 1.1 spz .word 0x85b02309 !movxtod %o1,%f2 3560 1.1 spz .word 0x89b0230a !movxtod %o2,%f4 3561 1.1 spz .word 0x8db0230b !movxtod %o3,%f6 3562 1.1 spz 3563 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 3564 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 3565 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 ! ^= tweak[0] 3566 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 3567 1.1 spz 3568 1.1 spz prefetch [%i0 + 32+63], 20 3569 1.1 spz call _aes256_decrypt_2x 3570 1.1 spz add %i0, 32, %i0 3571 1.1 spz 3572 1.1 spz .word 0x91b02302 !movxtod %g2,%f8 3573 1.1 spz .word 0x95b02303 !movxtod %g3,%f10 3574 1.1 spz 3575 1.1 spz srax %g3, 63, %l7 ! next tweak value 3576 1.1 spz addcc %g2, %g2, %g2 3577 1.1 spz and %l7, 0x87, %l7 3578 1.1 spz .word 0x87b0c223 !addxc %g3,%g3,%g3 3579 1.1 spz xor %l7, %g2, %g2 3580 1.1 spz 3581 1.1 spz .word 0x91b20988 !bshuffle %f8,%f8,%f8 3582 1.1 spz .word 0x95b2898a !bshuffle %f10,%f10,%f10 3583 1.1 spz 3584 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 3585 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 3586 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 3587 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 3588 1.1 spz 3589 1.1 spz subcc %i2, 2, %i2 3590 1.1 spz stda %f0, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 3591 1.1 spz add %i1, 8, %i1 3592 1.1 spz stda %f2, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 3593 1.1 spz add %i1, 8, %i1 3594 1.1 spz stda %f4, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 3595 1.1 spz add %i1, 8, %i1 3596 1.1 spz stda %f6, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 3597 1.4 martin bgu,pt SIZE_T_CC, .L256_xts_deblk2x 3598 1.1 spz add %i1, 8, %i1 3599 1.1 spz 3600 1.1 spz add %l5, %i2, %i2 3601 1.1 spz andcc %i2, 1, %g0 ! is number of blocks even? 3602 1.1 spz membar #StoreLoad|#StoreStore 3603 1.1 spz bnz,pt %icc, .L256_xts_deloop 3604 1.1 spz srl %i2, 0, %i2 3605 1.1 spz brnz,pn %i2, .L256_xts_deloop2x 3606 1.1 spz nop 3607 1.1 spz 3608 1.1 spz .word 0x81b00f04 !fsrc2 %f0,%f4,%f0 3609 1.1 spz .word 0x85b00f06 !fsrc2 %f0,%f6,%f2 3610 1.1 spz brnz,pn %i5, .L256_xts_desteal 3611 1.1 spz nop 3612 1.1 spz 3613 1.1 spz ret 3614 1.1 spz restore 3615 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 3616 1.1 spz .align 32 3617 1.1 spz .L256_xts_desteal: 3618 1.1 spz ldx [%i0 + 0], %o0 3619 1.1 spz brz,pt %l0, 8f 3620 1.1 spz ldx [%i0 + 8], %o1 3621 1.1 spz 3622 1.1 spz ldx [%i0 + 16], %o2 3623 1.1 spz sllx %o0, %l0, %o0 3624 1.1 spz srlx %o1, %l1, %g1 3625 1.1 spz sllx %o1, %l0, %o1 3626 1.1 spz or %g1, %o0, %o0 3627 1.1 spz srlx %o2, %l1, %o2 3628 1.1 spz or %o2, %o1, %o1 3629 1.1 spz 8: 3630 1.1 spz srax %g3, 63, %l7 ! next tweak value 3631 1.1 spz addcc %g2, %g2, %o2 3632 1.1 spz and %l7, 0x87, %l7 3633 1.1 spz .word 0x97b0c223 !addxc %g3,%g3,%o3 3634 1.1 spz xor %l7, %o2, %o2 3635 1.1 spz 3636 1.1 spz .word 0x99b0230a !movxtod %o2,%f12 3637 1.1 spz .word 0x9db0230b !movxtod %o3,%f14 3638 1.1 spz .word 0x99b3098c !bshuffle %f12,%f12,%f12 3639 1.1 spz .word 0x9db3898e !bshuffle %f14,%f14,%f14 3640 1.1 spz 3641 1.1 spz xor %g4, %o0, %o0 ! ^= rk[0] 3642 1.1 spz xor %g5, %o1, %o1 3643 1.1 spz .word 0x81b02308 !movxtod %o0,%f0 3644 1.1 spz .word 0x85b02309 !movxtod %o1,%f2 3645 1.1 spz 3646 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 3647 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 3648 1.1 spz 3649 1.1 spz call _aes256_decrypt_1x 3650 1.1 spz add %i0, 16, %i0 3651 1.1 spz 3652 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= tweak[0] 3653 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 3654 1.1 spz 3655 1.4 martin std %f0, [%fp + STACK_BIAS-16] 3656 1.4 martin std %f2, [%fp + STACK_BIAS-8] 3657 1.1 spz 3658 1.1 spz srl %l0, 3, %l0 3659 1.4 martin add %fp, STACK_BIAS-16, %l7 3660 1.1 spz add %i0, %l0, %i0 ! original %i0+%i2&-15 3661 1.1 spz add %i1, %l2, %i1 ! original %i1+%i2&-15 3662 1.1 spz mov 0, %l0 3663 1.1 spz add %i1, 16, %i1 3664 1.1 spz nop ! align 3665 1.1 spz 3666 1.1 spz .L256_xts_destealing: 3667 1.1 spz ldub [%i0 + %l0], %o0 3668 1.1 spz ldub [%l7 + %l0], %o1 3669 1.1 spz dec %i5 3670 1.1 spz stb %o0, [%l7 + %l0] 3671 1.1 spz stb %o1, [%i1 + %l0] 3672 1.1 spz brnz %i5, .L256_xts_destealing 3673 1.1 spz inc %l0 3674 1.1 spz 3675 1.1 spz mov %l7, %i0 3676 1.1 spz sub %i1, 16, %i1 3677 1.1 spz mov 0, %l0 3678 1.1 spz sub %i1, %l2, %i1 3679 1.1 spz ba .L256_xts_deloop ! one more time 3680 1.1 spz mov 1, %i2 ! %i5 is 0 3681 1.1 spz ret 3682 1.1 spz restore 3683 1.1 spz .type aes256_t4_xts_decrypt,#function 3684 1.1 spz .size aes256_t4_xts_decrypt,.-aes256_t4_xts_decrypt 3685 1.1 spz .globl aes192_t4_ctr32_encrypt 3686 1.1 spz .align 32 3687 1.1 spz aes192_t4_ctr32_encrypt: 3688 1.4 martin save %sp, -STACK_FRAME, %sp 3689 1.1 spz srln %i2, 0, %i2 ! needed on v8+, "nop" on v9 3690 1.1 spz 3691 1.1 spz prefetch [%i0], 20 3692 1.1 spz prefetch [%i0 + 63], 20 3693 1.1 spz call _aes192_load_enckey 3694 1.1 spz sllx %i2, 4, %i2 3695 1.1 spz 3696 1.1 spz ld [%i4 + 0], %l4 ! counter 3697 1.1 spz ld [%i4 + 4], %l5 3698 1.1 spz ld [%i4 + 8], %l6 3699 1.1 spz ld [%i4 + 12], %l7 3700 1.1 spz 3701 1.1 spz sllx %l4, 32, %o5 3702 1.1 spz or %l5, %o5, %o5 3703 1.1 spz sllx %l6, 32, %g1 3704 1.1 spz xor %o5, %g4, %g4 ! ^= rk[0] 3705 1.1 spz xor %g1, %g5, %g5 3706 1.1 spz .word 0x9db02304 !movxtod %g4,%f14 ! most significant 64 bits 3707 1.1 spz 3708 1.1 spz sub %i0, %i1, %l5 ! %i0!=%i1 3709 1.1 spz and %i0, 7, %l0 3710 1.1 spz andn %i0, 7, %i0 3711 1.1 spz sll %l0, 3, %l0 3712 1.1 spz mov 64, %l1 3713 1.1 spz mov 0xff, %l3 3714 1.1 spz sub %l1, %l0, %l1 3715 1.1 spz and %i1, 7, %l2 3716 1.1 spz cmp %i2, 255 3717 1.1 spz movrnz %l2, 0, %l5 ! if ( %i1&7 || 3718 1.4 martin movleu SIZE_T_CC, 0, %l5 ! %i2<256 || 3719 1.1 spz brnz,pn %l5, .L192_ctr32_blk ! %i0==%i1) 3720 1.1 spz srl %l3, %l2, %l3 3721 1.1 spz 3722 1.1 spz andcc %i2, 16, %g0 ! is number of blocks even? 3723 1.1 spz .word 0xb3b64340 !alignaddrl %i1,%g0,%i1 3724 1.1 spz bz %icc, .L192_ctr32_loop2x 3725 1.1 spz srlx %i2, 4, %i2 3726 1.1 spz .L192_ctr32_loop: 3727 1.1 spz ldx [%i0 + 0], %o0 3728 1.1 spz brz,pt %l0, 4f 3729 1.1 spz ldx [%i0 + 8], %o1 3730 1.1 spz 3731 1.1 spz ldx [%i0 + 16], %o2 3732 1.1 spz sllx %o0, %l0, %o0 3733 1.1 spz srlx %o1, %l1, %g1 3734 1.1 spz sllx %o1, %l0, %o1 3735 1.1 spz or %g1, %o0, %o0 3736 1.1 spz srlx %o2, %l1, %o2 3737 1.1 spz or %o2, %o1, %o1 3738 1.1 spz 4: 3739 1.1 spz xor %g5, %l7, %g1 ! ^= rk[0] 3740 1.1 spz add %l7, 1, %l7 3741 1.1 spz .word 0x85b02301 !movxtod %g1,%f2 3742 1.1 spz srl %l7, 0, %l7 ! clruw 3743 1.1 spz prefetch [%i1 + 63], 22 3744 1.1 spz prefetch [%i0 + 16+63], 20 3745 1.1 spz .word 0x88cc040e !aes_eround01 %f16,%f14,%f2,%f4 3746 1.1 spz .word 0x84cc842e !aes_eround23 %f18,%f14,%f2,%f2 3747 1.1 spz call _aes192_encrypt_1x+8 3748 1.1 spz add %i0, 16, %i0 3749 1.1 spz 3750 1.1 spz .word 0x95b02308 !movxtod %o0,%f10 3751 1.1 spz .word 0x99b02309 !movxtod %o1,%f12 3752 1.1 spz .word 0x81b28d80 !fxor %f10,%f0,%f0 ! ^= inp 3753 1.1 spz .word 0x85b30d82 !fxor %f12,%f2,%f2 3754 1.1 spz 3755 1.1 spz brnz,pn %l2, 2f 3756 1.1 spz sub %i2, 1, %i2 3757 1.5 christos 3758 1.1 spz std %f0, [%i1 + 0] 3759 1.1 spz std %f2, [%i1 + 8] 3760 1.1 spz brnz,pt %i2, .L192_ctr32_loop2x 3761 1.1 spz add %i1, 16, %i1 3762 1.1 spz 3763 1.1 spz ret 3764 1.1 spz restore 3765 1.1 spz 3766 1.1 spz .align 16 3767 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 3768 1.1 spz ! and ~3x deterioration 3769 1.1 spz ! in inp==out case 3770 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 ! handle unaligned output 3771 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 3772 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 3773 1.1 spz stda %f4, [%i1 + %l3]0xc0 ! partial store 3774 1.1 spz std %f6, [%i1 + 8] 3775 1.1 spz add %i1, 16, %i1 3776 1.1 spz orn %g0, %l3, %l3 3777 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 3778 1.1 spz 3779 1.1 spz brnz,pt %i2, .L192_ctr32_loop2x+4 3780 1.1 spz orn %g0, %l3, %l3 3781 1.1 spz 3782 1.1 spz ret 3783 1.1 spz restore 3784 1.1 spz 3785 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 3786 1.1 spz .align 32 3787 1.1 spz .L192_ctr32_loop2x: 3788 1.1 spz ldx [%i0 + 0], %o0 3789 1.1 spz ldx [%i0 + 8], %o1 3790 1.1 spz ldx [%i0 + 16], %o2 3791 1.1 spz brz,pt %l0, 4f 3792 1.1 spz ldx [%i0 + 24], %o3 3793 1.1 spz 3794 1.1 spz ldx [%i0 + 32], %o4 3795 1.1 spz sllx %o0, %l0, %o0 3796 1.1 spz srlx %o1, %l1, %g1 3797 1.1 spz or %g1, %o0, %o0 3798 1.1 spz sllx %o1, %l0, %o1 3799 1.1 spz srlx %o2, %l1, %g1 3800 1.1 spz or %g1, %o1, %o1 3801 1.1 spz sllx %o2, %l0, %o2 3802 1.1 spz srlx %o3, %l1, %g1 3803 1.1 spz or %g1, %o2, %o2 3804 1.1 spz sllx %o3, %l0, %o3 3805 1.1 spz srlx %o4, %l1, %o4 3806 1.1 spz or %o4, %o3, %o3 3807 1.1 spz 4: 3808 1.1 spz xor %g5, %l7, %g1 ! ^= rk[0] 3809 1.1 spz add %l7, 1, %l7 3810 1.1 spz .word 0x85b02301 !movxtod %g1,%f2 3811 1.1 spz srl %l7, 0, %l7 ! clruw 3812 1.1 spz xor %g5, %l7, %g1 3813 1.1 spz add %l7, 1, %l7 3814 1.1 spz .word 0x8db02301 !movxtod %g1,%f6 3815 1.1 spz srl %l7, 0, %l7 ! clruw 3816 1.1 spz prefetch [%i1 + 63], 22 3817 1.1 spz prefetch [%i0 + 32+63], 20 3818 1.1 spz .word 0x90cc040e !aes_eround01 %f16,%f14,%f2,%f8 3819 1.1 spz .word 0x84cc842e !aes_eround23 %f18,%f14,%f2,%f2 3820 1.1 spz .word 0x94cc0c0e !aes_eround01 %f16,%f14,%f6,%f10 3821 1.1 spz .word 0x8ccc8c2e !aes_eround23 %f18,%f14,%f6,%f6 3822 1.1 spz call _aes192_encrypt_2x+16 3823 1.1 spz add %i0, 32, %i0 3824 1.1 spz 3825 1.1 spz .word 0x91b02308 !movxtod %o0,%f8 3826 1.1 spz .word 0x95b02309 !movxtod %o1,%f10 3827 1.1 spz .word 0x99b0230a !movxtod %o2,%f12 3828 1.1 spz .word 0x81b20d80 !fxor %f8,%f0,%f0 ! ^= inp 3829 1.1 spz .word 0x91b0230b !movxtod %o3,%f8 3830 1.1 spz .word 0x85b28d82 !fxor %f10,%f2,%f2 3831 1.1 spz .word 0x89b30d84 !fxor %f12,%f4,%f4 3832 1.1 spz .word 0x8db20d86 !fxor %f8,%f6,%f6 3833 1.1 spz 3834 1.1 spz brnz,pn %l2, 2f 3835 1.1 spz sub %i2, 2, %i2 3836 1.5 christos 3837 1.1 spz std %f0, [%i1 + 0] 3838 1.1 spz std %f2, [%i1 + 8] 3839 1.1 spz std %f4, [%i1 + 16] 3840 1.1 spz std %f6, [%i1 + 24] 3841 1.1 spz brnz,pt %i2, .L192_ctr32_loop2x 3842 1.1 spz add %i1, 32, %i1 3843 1.1 spz 3844 1.1 spz ret 3845 1.1 spz restore 3846 1.1 spz 3847 1.1 spz .align 16 3848 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 3849 1.1 spz ! and ~3x deterioration 3850 1.1 spz ! in inp==out case 3851 1.1 spz .word 0x91b00900 !faligndata %f0,%f0,%f8 ! handle unaligned output 3852 1.1 spz .word 0x81b00902 !faligndata %f0,%f2,%f0 3853 1.1 spz .word 0x85b08904 !faligndata %f2,%f4,%f2 3854 1.1 spz .word 0x89b10906 !faligndata %f4,%f6,%f4 3855 1.1 spz .word 0x8db18906 !faligndata %f6,%f6,%f6 3856 1.1 spz 3857 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 3858 1.1 spz std %f0, [%i1 + 8] 3859 1.1 spz std %f2, [%i1 + 16] 3860 1.1 spz std %f4, [%i1 + 24] 3861 1.1 spz add %i1, 32, %i1 3862 1.1 spz orn %g0, %l3, %l3 3863 1.1 spz stda %f6, [%i1 + %l3]0xc0 ! partial store 3864 1.1 spz 3865 1.1 spz brnz,pt %i2, .L192_ctr32_loop2x+4 3866 1.1 spz orn %g0, %l3, %l3 3867 1.1 spz 3868 1.1 spz ret 3869 1.1 spz restore 3870 1.1 spz 3871 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 3872 1.1 spz .align 32 3873 1.1 spz .L192_ctr32_blk: 3874 1.1 spz add %i1, %i2, %l5 3875 1.1 spz and %l5, 63, %l5 ! tail 3876 1.1 spz sub %i2, %l5, %i2 3877 1.1 spz add %l5, 15, %l5 ! round up to 16n 3878 1.1 spz srlx %i2, 4, %i2 3879 1.1 spz srl %l5, 4, %l5 3880 1.1 spz sub %i2, 1, %i2 3881 1.1 spz add %l5, 1, %l5 3882 1.1 spz 3883 1.1 spz .L192_ctr32_blk_loop2x: 3884 1.1 spz ldx [%i0 + 0], %o0 3885 1.1 spz ldx [%i0 + 8], %o1 3886 1.1 spz ldx [%i0 + 16], %o2 3887 1.1 spz brz,pt %l0, 5f 3888 1.1 spz ldx [%i0 + 24], %o3 3889 1.1 spz 3890 1.1 spz ldx [%i0 + 32], %o4 3891 1.1 spz sllx %o0, %l0, %o0 3892 1.1 spz srlx %o1, %l1, %g1 3893 1.1 spz or %g1, %o0, %o0 3894 1.1 spz sllx %o1, %l0, %o1 3895 1.1 spz srlx %o2, %l1, %g1 3896 1.1 spz or %g1, %o1, %o1 3897 1.1 spz sllx %o2, %l0, %o2 3898 1.1 spz srlx %o3, %l1, %g1 3899 1.1 spz or %g1, %o2, %o2 3900 1.1 spz sllx %o3, %l0, %o3 3901 1.1 spz srlx %o4, %l1, %o4 3902 1.1 spz or %o4, %o3, %o3 3903 1.1 spz 5: 3904 1.1 spz xor %g5, %l7, %g1 ! ^= rk[0] 3905 1.1 spz add %l7, 1, %l7 3906 1.1 spz .word 0x85b02301 !movxtod %g1,%f2 3907 1.1 spz srl %l7, 0, %l7 ! clruw 3908 1.1 spz xor %g5, %l7, %g1 3909 1.1 spz add %l7, 1, %l7 3910 1.1 spz .word 0x8db02301 !movxtod %g1,%f6 3911 1.1 spz srl %l7, 0, %l7 ! clruw 3912 1.1 spz prefetch [%i0 + 32+63], 20 3913 1.1 spz .word 0x90cc040e !aes_eround01 %f16,%f14,%f2,%f8 3914 1.1 spz .word 0x84cc842e !aes_eround23 %f18,%f14,%f2,%f2 3915 1.1 spz .word 0x94cc0c0e !aes_eround01 %f16,%f14,%f6,%f10 3916 1.1 spz .word 0x8ccc8c2e !aes_eround23 %f18,%f14,%f6,%f6 3917 1.1 spz call _aes192_encrypt_2x+16 3918 1.1 spz add %i0, 32, %i0 3919 1.1 spz subcc %i2, 2, %i2 3920 1.1 spz 3921 1.1 spz .word 0x91b02308 !movxtod %o0,%f8 3922 1.1 spz .word 0x95b02309 !movxtod %o1,%f10 3923 1.1 spz .word 0x99b0230a !movxtod %o2,%f12 3924 1.1 spz .word 0x81b20d80 !fxor %f8,%f0,%f0 ! ^= inp 3925 1.1 spz .word 0x91b0230b !movxtod %o3,%f8 3926 1.1 spz .word 0x85b28d82 !fxor %f10,%f2,%f2 3927 1.1 spz .word 0x89b30d84 !fxor %f12,%f4,%f4 3928 1.1 spz .word 0x8db20d86 !fxor %f8,%f6,%f6 3929 1.1 spz 3930 1.1 spz stda %f0, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 3931 1.1 spz add %i1, 8, %i1 3932 1.1 spz stda %f2, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 3933 1.1 spz add %i1, 8, %i1 3934 1.1 spz stda %f4, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 3935 1.1 spz add %i1, 8, %i1 3936 1.1 spz stda %f6, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 3937 1.4 martin bgu,pt SIZE_T_CC, .L192_ctr32_blk_loop2x 3938 1.1 spz add %i1, 8, %i1 3939 1.1 spz 3940 1.1 spz add %l5, %i2, %i2 3941 1.1 spz andcc %i2, 1, %g0 ! is number of blocks even? 3942 1.1 spz membar #StoreLoad|#StoreStore 3943 1.1 spz bnz,pt %icc, .L192_ctr32_loop 3944 1.1 spz srl %i2, 0, %i2 3945 1.1 spz brnz,pn %i2, .L192_ctr32_loop2x 3946 1.1 spz nop 3947 1.1 spz 3948 1.1 spz ret 3949 1.1 spz restore 3950 1.1 spz .type aes192_t4_ctr32_encrypt,#function 3951 1.1 spz .size aes192_t4_ctr32_encrypt,.-aes192_t4_ctr32_encrypt 3952 1.1 spz .globl aes192_t4_cbc_decrypt 3953 1.1 spz .align 32 3954 1.1 spz aes192_t4_cbc_decrypt: 3955 1.4 martin save %sp, -STACK_FRAME, %sp 3956 1.1 spz cmp %i2, 0 3957 1.4 martin be,pn SIZE_T_CC, .L192_cbc_dec_abort 3958 1.1 spz srln %i2, 0, %i2 ! needed on v8+, "nop" on v9 3959 1.1 spz sub %i0, %i1, %l5 ! %i0!=%i1 3960 1.1 spz ld [%i4 + 0], %f12 ! load ivec 3961 1.1 spz ld [%i4 + 4], %f13 3962 1.1 spz ld [%i4 + 8], %f14 3963 1.1 spz ld [%i4 + 12], %f15 3964 1.1 spz prefetch [%i0], 20 3965 1.1 spz prefetch [%i0 + 63], 20 3966 1.1 spz call _aes192_load_deckey 3967 1.1 spz and %i0, 7, %l0 3968 1.1 spz andn %i0, 7, %i0 3969 1.1 spz sll %l0, 3, %l0 3970 1.1 spz mov 64, %l1 3971 1.1 spz mov 0xff, %l3 3972 1.1 spz sub %l1, %l0, %l1 3973 1.1 spz and %i1, 7, %l2 3974 1.1 spz cmp %i2, 255 3975 1.1 spz movrnz %l2, 0, %l5 ! if ( %i1&7 || 3976 1.4 martin movleu SIZE_T_CC, 0, %l5 ! %i2<256 || 3977 1.1 spz brnz,pn %l5, .L192cbc_dec_blk ! %i0==%i1) 3978 1.1 spz srl %l3, %l2, %l3 3979 1.1 spz 3980 1.1 spz andcc %i2, 16, %g0 ! is number of blocks even? 3981 1.1 spz srlx %i2, 4, %i2 3982 1.1 spz .word 0xb3b64340 !alignaddrl %i1,%g0,%i1 3983 1.1 spz bz %icc, .L192_cbc_dec_loop2x 3984 1.1 spz prefetch [%i1], 22 3985 1.1 spz .L192_cbc_dec_loop: 3986 1.1 spz ldx [%i0 + 0], %o0 3987 1.1 spz brz,pt %l0, 4f 3988 1.1 spz ldx [%i0 + 8], %o1 3989 1.1 spz 3990 1.1 spz ldx [%i0 + 16], %o2 3991 1.1 spz sllx %o0, %l0, %o0 3992 1.1 spz srlx %o1, %l1, %g1 3993 1.1 spz sllx %o1, %l0, %o1 3994 1.1 spz or %g1, %o0, %o0 3995 1.1 spz srlx %o2, %l1, %o2 3996 1.1 spz or %o2, %o1, %o1 3997 1.1 spz 4: 3998 1.1 spz xor %g4, %o0, %o2 ! ^= rk[0] 3999 1.1 spz xor %g5, %o1, %o3 4000 1.1 spz .word 0x81b0230a !movxtod %o2,%f0 4001 1.1 spz .word 0x85b0230b !movxtod %o3,%f2 4002 1.1 spz 4003 1.1 spz prefetch [%i1 + 63], 22 4004 1.1 spz prefetch [%i0 + 16+63], 20 4005 1.1 spz call _aes192_decrypt_1x 4006 1.1 spz add %i0, 16, %i0 4007 1.1 spz 4008 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 4009 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 4010 1.1 spz .word 0x99b02308 !movxtod %o0,%f12 4011 1.1 spz .word 0x9db02309 !movxtod %o1,%f14 4012 1.1 spz 4013 1.1 spz brnz,pn %l2, 2f 4014 1.1 spz sub %i2, 1, %i2 4015 1.5 christos 4016 1.1 spz std %f0, [%i1 + 0] 4017 1.1 spz std %f2, [%i1 + 8] 4018 1.1 spz brnz,pt %i2, .L192_cbc_dec_loop2x 4019 1.1 spz add %i1, 16, %i1 4020 1.1 spz st %f12, [%i4 + 0] 4021 1.1 spz st %f13, [%i4 + 4] 4022 1.1 spz st %f14, [%i4 + 8] 4023 1.1 spz st %f15, [%i4 + 12] 4024 1.1 spz .L192_cbc_dec_abort: 4025 1.1 spz ret 4026 1.1 spz restore 4027 1.1 spz 4028 1.1 spz .align 16 4029 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 4030 1.1 spz ! and ~3x deterioration 4031 1.1 spz ! in inp==out case 4032 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 ! handle unaligned output 4033 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 4034 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 4035 1.1 spz 4036 1.1 spz stda %f4, [%i1 + %l3]0xc0 ! partial store 4037 1.1 spz std %f6, [%i1 + 8] 4038 1.1 spz add %i1, 16, %i1 4039 1.1 spz orn %g0, %l3, %l3 4040 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 4041 1.1 spz 4042 1.1 spz brnz,pt %i2, .L192_cbc_dec_loop2x+4 4043 1.1 spz orn %g0, %l3, %l3 4044 1.1 spz st %f12, [%i4 + 0] 4045 1.1 spz st %f13, [%i4 + 4] 4046 1.1 spz st %f14, [%i4 + 8] 4047 1.1 spz st %f15, [%i4 + 12] 4048 1.1 spz ret 4049 1.1 spz restore 4050 1.1 spz 4051 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4052 1.1 spz .align 32 4053 1.1 spz .L192_cbc_dec_loop2x: 4054 1.1 spz ldx [%i0 + 0], %o0 4055 1.1 spz ldx [%i0 + 8], %o1 4056 1.1 spz ldx [%i0 + 16], %o2 4057 1.1 spz brz,pt %l0, 4f 4058 1.1 spz ldx [%i0 + 24], %o3 4059 1.1 spz 4060 1.1 spz ldx [%i0 + 32], %o4 4061 1.1 spz sllx %o0, %l0, %o0 4062 1.1 spz srlx %o1, %l1, %g1 4063 1.1 spz or %g1, %o0, %o0 4064 1.1 spz sllx %o1, %l0, %o1 4065 1.1 spz srlx %o2, %l1, %g1 4066 1.1 spz or %g1, %o1, %o1 4067 1.1 spz sllx %o2, %l0, %o2 4068 1.1 spz srlx %o3, %l1, %g1 4069 1.1 spz or %g1, %o2, %o2 4070 1.1 spz sllx %o3, %l0, %o3 4071 1.1 spz srlx %o4, %l1, %o4 4072 1.1 spz or %o4, %o3, %o3 4073 1.1 spz 4: 4074 1.1 spz xor %g4, %o0, %o4 ! ^= rk[0] 4075 1.1 spz xor %g5, %o1, %o5 4076 1.1 spz .word 0x81b0230c !movxtod %o4,%f0 4077 1.1 spz .word 0x85b0230d !movxtod %o5,%f2 4078 1.1 spz xor %g4, %o2, %o4 4079 1.1 spz xor %g5, %o3, %o5 4080 1.1 spz .word 0x89b0230c !movxtod %o4,%f4 4081 1.1 spz .word 0x8db0230d !movxtod %o5,%f6 4082 1.1 spz 4083 1.1 spz prefetch [%i1 + 63], 22 4084 1.1 spz prefetch [%i0 + 32+63], 20 4085 1.1 spz call _aes192_decrypt_2x 4086 1.1 spz add %i0, 32, %i0 4087 1.1 spz 4088 1.1 spz .word 0x91b02308 !movxtod %o0,%f8 4089 1.1 spz .word 0x95b02309 !movxtod %o1,%f10 4090 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 4091 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 4092 1.1 spz .word 0x99b0230a !movxtod %o2,%f12 4093 1.1 spz .word 0x9db0230b !movxtod %o3,%f14 4094 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 4095 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 4096 1.1 spz 4097 1.1 spz brnz,pn %l2, 2f 4098 1.1 spz sub %i2, 2, %i2 4099 1.5 christos 4100 1.1 spz std %f0, [%i1 + 0] 4101 1.1 spz std %f2, [%i1 + 8] 4102 1.1 spz std %f4, [%i1 + 16] 4103 1.1 spz std %f6, [%i1 + 24] 4104 1.1 spz brnz,pt %i2, .L192_cbc_dec_loop2x 4105 1.1 spz add %i1, 32, %i1 4106 1.1 spz st %f12, [%i4 + 0] 4107 1.1 spz st %f13, [%i4 + 4] 4108 1.1 spz st %f14, [%i4 + 8] 4109 1.1 spz st %f15, [%i4 + 12] 4110 1.1 spz ret 4111 1.1 spz restore 4112 1.1 spz 4113 1.1 spz .align 16 4114 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 4115 1.1 spz ! and ~3x deterioration 4116 1.1 spz ! in inp==out case 4117 1.1 spz .word 0x91b00900 !faligndata %f0,%f0,%f8 ! handle unaligned output 4118 1.1 spz .word 0x81b00902 !faligndata %f0,%f2,%f0 4119 1.1 spz .word 0x85b08904 !faligndata %f2,%f4,%f2 4120 1.1 spz .word 0x89b10906 !faligndata %f4,%f6,%f4 4121 1.1 spz .word 0x8db18906 !faligndata %f6,%f6,%f6 4122 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 4123 1.1 spz std %f0, [%i1 + 8] 4124 1.1 spz std %f2, [%i1 + 16] 4125 1.1 spz std %f4, [%i1 + 24] 4126 1.1 spz add %i1, 32, %i1 4127 1.1 spz orn %g0, %l3, %l3 4128 1.1 spz stda %f6, [%i1 + %l3]0xc0 ! partial store 4129 1.1 spz 4130 1.1 spz brnz,pt %i2, .L192_cbc_dec_loop2x+4 4131 1.1 spz orn %g0, %l3, %l3 4132 1.1 spz st %f12, [%i4 + 0] 4133 1.1 spz st %f13, [%i4 + 4] 4134 1.1 spz st %f14, [%i4 + 8] 4135 1.1 spz st %f15, [%i4 + 12] 4136 1.1 spz ret 4137 1.1 spz restore 4138 1.1 spz 4139 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4140 1.1 spz .align 32 4141 1.1 spz .L192cbc_dec_blk: 4142 1.1 spz add %i1, %i2, %l5 4143 1.1 spz and %l5, 63, %l5 ! tail 4144 1.1 spz sub %i2, %l5, %i2 4145 1.1 spz add %l5, 15, %l5 ! round up to 16n 4146 1.1 spz srlx %i2, 4, %i2 4147 1.1 spz srl %l5, 4, %l5 4148 1.1 spz sub %i2, 1, %i2 4149 1.1 spz add %l5, 1, %l5 4150 1.1 spz 4151 1.1 spz .L192_cbc_dec_blk_loop2x: 4152 1.1 spz ldx [%i0 + 0], %o0 4153 1.1 spz ldx [%i0 + 8], %o1 4154 1.1 spz ldx [%i0 + 16], %o2 4155 1.1 spz brz,pt %l0, 5f 4156 1.1 spz ldx [%i0 + 24], %o3 4157 1.1 spz 4158 1.1 spz ldx [%i0 + 32], %o4 4159 1.1 spz sllx %o0, %l0, %o0 4160 1.1 spz srlx %o1, %l1, %g1 4161 1.1 spz or %g1, %o0, %o0 4162 1.1 spz sllx %o1, %l0, %o1 4163 1.1 spz srlx %o2, %l1, %g1 4164 1.1 spz or %g1, %o1, %o1 4165 1.1 spz sllx %o2, %l0, %o2 4166 1.1 spz srlx %o3, %l1, %g1 4167 1.1 spz or %g1, %o2, %o2 4168 1.1 spz sllx %o3, %l0, %o3 4169 1.1 spz srlx %o4, %l1, %o4 4170 1.1 spz or %o4, %o3, %o3 4171 1.1 spz 5: 4172 1.1 spz xor %g4, %o0, %o4 ! ^= rk[0] 4173 1.1 spz xor %g5, %o1, %o5 4174 1.1 spz .word 0x81b0230c !movxtod %o4,%f0 4175 1.1 spz .word 0x85b0230d !movxtod %o5,%f2 4176 1.1 spz xor %g4, %o2, %o4 4177 1.1 spz xor %g5, %o3, %o5 4178 1.1 spz .word 0x89b0230c !movxtod %o4,%f4 4179 1.1 spz .word 0x8db0230d !movxtod %o5,%f6 4180 1.1 spz 4181 1.1 spz prefetch [%i0 + 32+63], 20 4182 1.1 spz call _aes192_decrypt_2x 4183 1.1 spz add %i0, 32, %i0 4184 1.1 spz subcc %i2, 2, %i2 4185 1.1 spz 4186 1.1 spz .word 0x91b02308 !movxtod %o0,%f8 4187 1.1 spz .word 0x95b02309 !movxtod %o1,%f10 4188 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 4189 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 4190 1.1 spz .word 0x99b0230a !movxtod %o2,%f12 4191 1.1 spz .word 0x9db0230b !movxtod %o3,%f14 4192 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 4193 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 4194 1.1 spz 4195 1.1 spz stda %f0, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 4196 1.1 spz add %i1, 8, %i1 4197 1.1 spz stda %f2, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 4198 1.1 spz add %i1, 8, %i1 4199 1.1 spz stda %f4, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 4200 1.1 spz add %i1, 8, %i1 4201 1.1 spz stda %f6, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 4202 1.4 martin bgu,pt SIZE_T_CC, .L192_cbc_dec_blk_loop2x 4203 1.1 spz add %i1, 8, %i1 4204 1.1 spz 4205 1.1 spz add %l5, %i2, %i2 4206 1.1 spz andcc %i2, 1, %g0 ! is number of blocks even? 4207 1.1 spz membar #StoreLoad|#StoreStore 4208 1.1 spz bnz,pt %icc, .L192_cbc_dec_loop 4209 1.1 spz srl %i2, 0, %i2 4210 1.1 spz brnz,pn %i2, .L192_cbc_dec_loop2x 4211 1.1 spz nop 4212 1.1 spz st %f12, [%i4 + 0] ! write out ivec 4213 1.1 spz st %f13, [%i4 + 4] 4214 1.1 spz st %f14, [%i4 + 8] 4215 1.1 spz st %f15, [%i4 + 12] 4216 1.1 spz ret 4217 1.1 spz restore 4218 1.1 spz .type aes192_t4_cbc_decrypt,#function 4219 1.1 spz .size aes192_t4_cbc_decrypt,.-aes192_t4_cbc_decrypt 4220 1.1 spz .globl aes256_t4_cbc_decrypt 4221 1.1 spz .align 32 4222 1.1 spz aes256_t4_cbc_decrypt: 4223 1.4 martin save %sp, -STACK_FRAME, %sp 4224 1.1 spz cmp %i2, 0 4225 1.4 martin be,pn SIZE_T_CC, .L256_cbc_dec_abort 4226 1.1 spz srln %i2, 0, %i2 ! needed on v8+, "nop" on v9 4227 1.1 spz sub %i0, %i1, %l5 ! %i0!=%i1 4228 1.1 spz ld [%i4 + 0], %f12 ! load ivec 4229 1.1 spz ld [%i4 + 4], %f13 4230 1.1 spz ld [%i4 + 8], %f14 4231 1.1 spz ld [%i4 + 12], %f15 4232 1.1 spz prefetch [%i0], 20 4233 1.1 spz prefetch [%i0 + 63], 20 4234 1.1 spz call _aes256_load_deckey 4235 1.1 spz and %i0, 7, %l0 4236 1.1 spz andn %i0, 7, %i0 4237 1.1 spz sll %l0, 3, %l0 4238 1.1 spz mov 64, %l1 4239 1.1 spz mov 0xff, %l3 4240 1.1 spz sub %l1, %l0, %l1 4241 1.1 spz and %i1, 7, %l2 4242 1.1 spz cmp %i2, 255 4243 1.1 spz movrnz %l2, 0, %l5 ! if ( %i1&7 || 4244 1.4 martin movleu SIZE_T_CC, 0, %l5 ! %i2<256 || 4245 1.1 spz brnz,pn %l5, .L256cbc_dec_blk ! %i0==%i1) 4246 1.1 spz srl %l3, %l2, %l3 4247 1.1 spz 4248 1.1 spz andcc %i2, 16, %g0 ! is number of blocks even? 4249 1.1 spz srlx %i2, 4, %i2 4250 1.1 spz .word 0xb3b64340 !alignaddrl %i1,%g0,%i1 4251 1.1 spz bz %icc, .L256_cbc_dec_loop2x 4252 1.1 spz prefetch [%i1], 22 4253 1.1 spz .L256_cbc_dec_loop: 4254 1.1 spz ldx [%i0 + 0], %o0 4255 1.1 spz brz,pt %l0, 4f 4256 1.1 spz ldx [%i0 + 8], %o1 4257 1.1 spz 4258 1.1 spz ldx [%i0 + 16], %o2 4259 1.1 spz sllx %o0, %l0, %o0 4260 1.1 spz srlx %o1, %l1, %g1 4261 1.1 spz sllx %o1, %l0, %o1 4262 1.1 spz or %g1, %o0, %o0 4263 1.1 spz srlx %o2, %l1, %o2 4264 1.1 spz or %o2, %o1, %o1 4265 1.1 spz 4: 4266 1.1 spz xor %g4, %o0, %o2 ! ^= rk[0] 4267 1.1 spz xor %g5, %o1, %o3 4268 1.1 spz .word 0x81b0230a !movxtod %o2,%f0 4269 1.1 spz .word 0x85b0230b !movxtod %o3,%f2 4270 1.1 spz 4271 1.1 spz prefetch [%i1 + 63], 22 4272 1.1 spz prefetch [%i0 + 16+63], 20 4273 1.1 spz call _aes256_decrypt_1x 4274 1.1 spz add %i0, 16, %i0 4275 1.1 spz 4276 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 4277 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 4278 1.1 spz .word 0x99b02308 !movxtod %o0,%f12 4279 1.1 spz .word 0x9db02309 !movxtod %o1,%f14 4280 1.1 spz 4281 1.1 spz brnz,pn %l2, 2f 4282 1.1 spz sub %i2, 1, %i2 4283 1.5 christos 4284 1.1 spz std %f0, [%i1 + 0] 4285 1.1 spz std %f2, [%i1 + 8] 4286 1.1 spz brnz,pt %i2, .L256_cbc_dec_loop2x 4287 1.1 spz add %i1, 16, %i1 4288 1.1 spz st %f12, [%i4 + 0] 4289 1.1 spz st %f13, [%i4 + 4] 4290 1.1 spz st %f14, [%i4 + 8] 4291 1.1 spz st %f15, [%i4 + 12] 4292 1.1 spz .L256_cbc_dec_abort: 4293 1.1 spz ret 4294 1.1 spz restore 4295 1.1 spz 4296 1.1 spz .align 16 4297 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 4298 1.1 spz ! and ~3x deterioration 4299 1.1 spz ! in inp==out case 4300 1.1 spz .word 0x89b00900 !faligndata %f0,%f0,%f4 ! handle unaligned output 4301 1.1 spz .word 0x8db00902 !faligndata %f0,%f2,%f6 4302 1.1 spz .word 0x91b08902 !faligndata %f2,%f2,%f8 4303 1.1 spz 4304 1.1 spz stda %f4, [%i1 + %l3]0xc0 ! partial store 4305 1.1 spz std %f6, [%i1 + 8] 4306 1.1 spz add %i1, 16, %i1 4307 1.1 spz orn %g0, %l3, %l3 4308 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 4309 1.1 spz 4310 1.1 spz brnz,pt %i2, .L256_cbc_dec_loop2x+4 4311 1.1 spz orn %g0, %l3, %l3 4312 1.1 spz st %f12, [%i4 + 0] 4313 1.1 spz st %f13, [%i4 + 4] 4314 1.1 spz st %f14, [%i4 + 8] 4315 1.1 spz st %f15, [%i4 + 12] 4316 1.1 spz ret 4317 1.1 spz restore 4318 1.1 spz 4319 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4320 1.1 spz .align 32 4321 1.1 spz .L256_cbc_dec_loop2x: 4322 1.1 spz ldx [%i0 + 0], %o0 4323 1.1 spz ldx [%i0 + 8], %o1 4324 1.1 spz ldx [%i0 + 16], %o2 4325 1.1 spz brz,pt %l0, 4f 4326 1.1 spz ldx [%i0 + 24], %o3 4327 1.1 spz 4328 1.1 spz ldx [%i0 + 32], %o4 4329 1.1 spz sllx %o0, %l0, %o0 4330 1.1 spz srlx %o1, %l1, %g1 4331 1.1 spz or %g1, %o0, %o0 4332 1.1 spz sllx %o1, %l0, %o1 4333 1.1 spz srlx %o2, %l1, %g1 4334 1.1 spz or %g1, %o1, %o1 4335 1.1 spz sllx %o2, %l0, %o2 4336 1.1 spz srlx %o3, %l1, %g1 4337 1.1 spz or %g1, %o2, %o2 4338 1.1 spz sllx %o3, %l0, %o3 4339 1.1 spz srlx %o4, %l1, %o4 4340 1.1 spz or %o4, %o3, %o3 4341 1.1 spz 4: 4342 1.1 spz xor %g4, %o0, %o4 ! ^= rk[0] 4343 1.1 spz xor %g5, %o1, %o5 4344 1.1 spz .word 0x81b0230c !movxtod %o4,%f0 4345 1.1 spz .word 0x85b0230d !movxtod %o5,%f2 4346 1.1 spz xor %g4, %o2, %o4 4347 1.1 spz xor %g5, %o3, %o5 4348 1.1 spz .word 0x89b0230c !movxtod %o4,%f4 4349 1.1 spz .word 0x8db0230d !movxtod %o5,%f6 4350 1.1 spz 4351 1.1 spz prefetch [%i1 + 63], 22 4352 1.1 spz prefetch [%i0 + 32+63], 20 4353 1.1 spz call _aes256_decrypt_2x 4354 1.1 spz add %i0, 32, %i0 4355 1.1 spz 4356 1.1 spz .word 0x91b02308 !movxtod %o0,%f8 4357 1.1 spz .word 0x95b02309 !movxtod %o1,%f10 4358 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 4359 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 4360 1.1 spz .word 0x99b0230a !movxtod %o2,%f12 4361 1.1 spz .word 0x9db0230b !movxtod %o3,%f14 4362 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 4363 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 4364 1.1 spz 4365 1.1 spz brnz,pn %l2, 2f 4366 1.1 spz sub %i2, 2, %i2 4367 1.5 christos 4368 1.1 spz std %f0, [%i1 + 0] 4369 1.1 spz std %f2, [%i1 + 8] 4370 1.1 spz std %f4, [%i1 + 16] 4371 1.1 spz std %f6, [%i1 + 24] 4372 1.1 spz brnz,pt %i2, .L256_cbc_dec_loop2x 4373 1.1 spz add %i1, 32, %i1 4374 1.1 spz st %f12, [%i4 + 0] 4375 1.1 spz st %f13, [%i4 + 4] 4376 1.1 spz st %f14, [%i4 + 8] 4377 1.1 spz st %f15, [%i4 + 12] 4378 1.1 spz ret 4379 1.1 spz restore 4380 1.1 spz 4381 1.1 spz .align 16 4382 1.1 spz 2: ldxa [%i0]0x82, %o0 ! avoid read-after-write hazard 4383 1.1 spz ! and ~3x deterioration 4384 1.1 spz ! in inp==out case 4385 1.1 spz .word 0x91b00900 !faligndata %f0,%f0,%f8 ! handle unaligned output 4386 1.1 spz .word 0x81b00902 !faligndata %f0,%f2,%f0 4387 1.1 spz .word 0x85b08904 !faligndata %f2,%f4,%f2 4388 1.1 spz .word 0x89b10906 !faligndata %f4,%f6,%f4 4389 1.1 spz .word 0x8db18906 !faligndata %f6,%f6,%f6 4390 1.1 spz stda %f8, [%i1 + %l3]0xc0 ! partial store 4391 1.1 spz std %f0, [%i1 + 8] 4392 1.1 spz std %f2, [%i1 + 16] 4393 1.1 spz std %f4, [%i1 + 24] 4394 1.1 spz add %i1, 32, %i1 4395 1.1 spz orn %g0, %l3, %l3 4396 1.1 spz stda %f6, [%i1 + %l3]0xc0 ! partial store 4397 1.1 spz 4398 1.1 spz brnz,pt %i2, .L256_cbc_dec_loop2x+4 4399 1.1 spz orn %g0, %l3, %l3 4400 1.1 spz st %f12, [%i4 + 0] 4401 1.1 spz st %f13, [%i4 + 4] 4402 1.1 spz st %f14, [%i4 + 8] 4403 1.1 spz st %f15, [%i4 + 12] 4404 1.1 spz ret 4405 1.1 spz restore 4406 1.1 spz 4407 1.1 spz !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4408 1.1 spz .align 32 4409 1.1 spz .L256cbc_dec_blk: 4410 1.1 spz add %i1, %i2, %l5 4411 1.1 spz and %l5, 63, %l5 ! tail 4412 1.1 spz sub %i2, %l5, %i2 4413 1.1 spz add %l5, 15, %l5 ! round up to 16n 4414 1.1 spz srlx %i2, 4, %i2 4415 1.1 spz srl %l5, 4, %l5 4416 1.1 spz sub %i2, 1, %i2 4417 1.1 spz add %l5, 1, %l5 4418 1.1 spz 4419 1.1 spz .L256_cbc_dec_blk_loop2x: 4420 1.1 spz ldx [%i0 + 0], %o0 4421 1.1 spz ldx [%i0 + 8], %o1 4422 1.1 spz ldx [%i0 + 16], %o2 4423 1.1 spz brz,pt %l0, 5f 4424 1.1 spz ldx [%i0 + 24], %o3 4425 1.1 spz 4426 1.1 spz ldx [%i0 + 32], %o4 4427 1.1 spz sllx %o0, %l0, %o0 4428 1.1 spz srlx %o1, %l1, %g1 4429 1.1 spz or %g1, %o0, %o0 4430 1.1 spz sllx %o1, %l0, %o1 4431 1.1 spz srlx %o2, %l1, %g1 4432 1.1 spz or %g1, %o1, %o1 4433 1.1 spz sllx %o2, %l0, %o2 4434 1.1 spz srlx %o3, %l1, %g1 4435 1.1 spz or %g1, %o2, %o2 4436 1.1 spz sllx %o3, %l0, %o3 4437 1.1 spz srlx %o4, %l1, %o4 4438 1.1 spz or %o4, %o3, %o3 4439 1.1 spz 5: 4440 1.1 spz xor %g4, %o0, %o4 ! ^= rk[0] 4441 1.1 spz xor %g5, %o1, %o5 4442 1.1 spz .word 0x81b0230c !movxtod %o4,%f0 4443 1.1 spz .word 0x85b0230d !movxtod %o5,%f2 4444 1.1 spz xor %g4, %o2, %o4 4445 1.1 spz xor %g5, %o3, %o5 4446 1.1 spz .word 0x89b0230c !movxtod %o4,%f4 4447 1.1 spz .word 0x8db0230d !movxtod %o5,%f6 4448 1.1 spz 4449 1.1 spz prefetch [%i0 + 32+63], 20 4450 1.1 spz call _aes256_decrypt_2x 4451 1.1 spz add %i0, 32, %i0 4452 1.1 spz subcc %i2, 2, %i2 4453 1.1 spz 4454 1.1 spz .word 0x91b02308 !movxtod %o0,%f8 4455 1.1 spz .word 0x95b02309 !movxtod %o1,%f10 4456 1.1 spz .word 0x81b30d80 !fxor %f12,%f0,%f0 ! ^= ivec 4457 1.1 spz .word 0x85b38d82 !fxor %f14,%f2,%f2 4458 1.1 spz .word 0x99b0230a !movxtod %o2,%f12 4459 1.1 spz .word 0x9db0230b !movxtod %o3,%f14 4460 1.1 spz .word 0x89b20d84 !fxor %f8,%f4,%f4 4461 1.1 spz .word 0x8db28d86 !fxor %f10,%f6,%f6 4462 1.1 spz 4463 1.1 spz stda %f0, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 4464 1.1 spz add %i1, 8, %i1 4465 1.1 spz stda %f2, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 4466 1.1 spz add %i1, 8, %i1 4467 1.1 spz stda %f4, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 4468 1.1 spz add %i1, 8, %i1 4469 1.1 spz stda %f6, [%i1]0xe2 ! ASI_BLK_INIT, T4-specific 4470 1.4 martin bgu,pt SIZE_T_CC, .L256_cbc_dec_blk_loop2x 4471 1.1 spz add %i1, 8, %i1 4472 1.1 spz 4473 1.1 spz add %l5, %i2, %i2 4474 1.1 spz andcc %i2, 1, %g0 ! is number of blocks even? 4475 1.1 spz membar #StoreLoad|#StoreStore 4476 1.1 spz bnz,pt %icc, .L256_cbc_dec_loop 4477 1.1 spz srl %i2, 0, %i2 4478 1.1 spz brnz,pn %i2, .L256_cbc_dec_loop2x 4479 1.1 spz nop 4480 1.1 spz st %f12, [%i4 + 0] ! write out ivec 4481 1.1 spz st %f13, [%i4 + 4] 4482 1.1 spz st %f14, [%i4 + 8] 4483 1.1 spz st %f15, [%i4 + 12] 4484 1.1 spz ret 4485 1.1 spz restore 4486 1.1 spz .type aes256_t4_cbc_decrypt,#function 4487 1.1 spz .size aes256_t4_cbc_decrypt,.-aes256_t4_cbc_decrypt 4488 1.1 spz .align 32 4489 1.1 spz _aes256_decrypt_1x: 4490 1.1 spz .word 0x88cc0440 !aes_dround01 %f16,%f0,%f2,%f4 4491 1.1 spz .word 0x84cc8460 !aes_dround23 %f18,%f0,%f2,%f2 4492 1.1 spz ldd [%i3 + 208], %f16 4493 1.1 spz ldd [%i3 + 216], %f18 4494 1.1 spz .word 0x80cd0444 !aes_dround01 %f20,%f4,%f2,%f0 4495 1.1 spz .word 0x84cd8464 !aes_dround23 %f22,%f4,%f2,%f2 4496 1.1 spz ldd [%i3 + 224], %f20 4497 1.1 spz ldd [%i3 + 232], %f22 4498 1.1 spz .word 0x88ce0440 !aes_dround01 %f24,%f0,%f2,%f4 4499 1.1 spz .word 0x84ce8460 !aes_dround23 %f26,%f0,%f2,%f2 4500 1.1 spz .word 0x80cf0444 !aes_dround01 %f28,%f4,%f2,%f0 4501 1.1 spz .word 0x84cf8464 !aes_dround23 %f30,%f4,%f2,%f2 4502 1.1 spz .word 0x88c84440 !aes_dround01 %f32,%f0,%f2,%f4 4503 1.1 spz .word 0x84c8c460 !aes_dround23 %f34,%f0,%f2,%f2 4504 1.1 spz .word 0x80c94444 !aes_dround01 %f36,%f4,%f2,%f0 4505 1.1 spz .word 0x84c9c464 !aes_dround23 %f38,%f4,%f2,%f2 4506 1.1 spz .word 0x88ca4440 !aes_dround01 %f40,%f0,%f2,%f4 4507 1.1 spz .word 0x84cac460 !aes_dround23 %f42,%f0,%f2,%f2 4508 1.1 spz .word 0x80cb4444 !aes_dround01 %f44,%f4,%f2,%f0 4509 1.1 spz .word 0x84cbc464 !aes_dround23 %f46,%f4,%f2,%f2 4510 1.1 spz .word 0x88cc4440 !aes_dround01 %f48,%f0,%f2,%f4 4511 1.1 spz .word 0x84ccc460 !aes_dround23 %f50,%f0,%f2,%f2 4512 1.1 spz .word 0x80cd4444 !aes_dround01 %f52,%f4,%f2,%f0 4513 1.1 spz .word 0x84cdc464 !aes_dround23 %f54,%f4,%f2,%f2 4514 1.1 spz .word 0x88ce4440 !aes_dround01 %f56,%f0,%f2,%f4 4515 1.1 spz .word 0x84cec460 !aes_dround23 %f58,%f0,%f2,%f2 4516 1.1 spz .word 0x80cf4444 !aes_dround01 %f60,%f4,%f2,%f0 4517 1.1 spz .word 0x84cfc464 !aes_dround23 %f62,%f4,%f2,%f2 4518 1.1 spz .word 0x88cc0440 !aes_dround01 %f16,%f0,%f2,%f4 4519 1.1 spz .word 0x84cc8460 !aes_dround23 %f18,%f0,%f2,%f2 4520 1.1 spz ldd [%i3 + 16], %f16 4521 1.1 spz ldd [%i3 + 24], %f18 4522 1.1 spz .word 0x80cd04c4 !aes_dround01_l %f20,%f4,%f2,%f0 4523 1.1 spz .word 0x84cd84e4 !aes_dround23_l %f22,%f4,%f2,%f2 4524 1.1 spz ldd [%i3 + 32], %f20 4525 1.1 spz retl 4526 1.1 spz ldd [%i3 + 40], %f22 4527 1.1 spz .type _aes256_decrypt_1x,#function 4528 1.1 spz .size _aes256_decrypt_1x,.-_aes256_decrypt_1x 4529 1.1 spz 4530 1.1 spz .align 32 4531 1.1 spz _aes256_decrypt_2x: 4532 1.1 spz .word 0x90cc0440 !aes_dround01 %f16,%f0,%f2,%f8 4533 1.1 spz .word 0x84cc8460 !aes_dround23 %f18,%f0,%f2,%f2 4534 1.1 spz .word 0x94cc0c44 !aes_dround01 %f16,%f4,%f6,%f10 4535 1.1 spz .word 0x8ccc8c64 !aes_dround23 %f18,%f4,%f6,%f6 4536 1.1 spz ldd [%i3 + 208], %f16 4537 1.1 spz ldd [%i3 + 216], %f18 4538 1.1 spz .word 0x80cd0448 !aes_dround01 %f20,%f8,%f2,%f0 4539 1.1 spz .word 0x84cd8468 !aes_dround23 %f22,%f8,%f2,%f2 4540 1.1 spz .word 0x88cd0c4a !aes_dround01 %f20,%f10,%f6,%f4 4541 1.1 spz .word 0x8ccd8c6a !aes_dround23 %f22,%f10,%f6,%f6 4542 1.1 spz ldd [%i3 + 224], %f20 4543 1.1 spz ldd [%i3 + 232], %f22 4544 1.1 spz .word 0x90ce0440 !aes_dround01 %f24,%f0,%f2,%f8 4545 1.1 spz .word 0x84ce8460 !aes_dround23 %f26,%f0,%f2,%f2 4546 1.1 spz .word 0x94ce0c44 !aes_dround01 %f24,%f4,%f6,%f10 4547 1.1 spz .word 0x8cce8c64 !aes_dround23 %f26,%f4,%f6,%f6 4548 1.1 spz .word 0x80cf0448 !aes_dround01 %f28,%f8,%f2,%f0 4549 1.1 spz .word 0x84cf8468 !aes_dround23 %f30,%f8,%f2,%f2 4550 1.1 spz .word 0x88cf0c4a !aes_dround01 %f28,%f10,%f6,%f4 4551 1.1 spz .word 0x8ccf8c6a !aes_dround23 %f30,%f10,%f6,%f6 4552 1.1 spz .word 0x90c84440 !aes_dround01 %f32,%f0,%f2,%f8 4553 1.1 spz .word 0x84c8c460 !aes_dround23 %f34,%f0,%f2,%f2 4554 1.1 spz .word 0x94c84c44 !aes_dround01 %f32,%f4,%f6,%f10 4555 1.1 spz .word 0x8cc8cc64 !aes_dround23 %f34,%f4,%f6,%f6 4556 1.1 spz .word 0x80c94448 !aes_dround01 %f36,%f8,%f2,%f0 4557 1.1 spz .word 0x84c9c468 !aes_dround23 %f38,%f8,%f2,%f2 4558 1.1 spz .word 0x88c94c4a !aes_dround01 %f36,%f10,%f6,%f4 4559 1.1 spz .word 0x8cc9cc6a !aes_dround23 %f38,%f10,%f6,%f6 4560 1.1 spz .word 0x90ca4440 !aes_dround01 %f40,%f0,%f2,%f8 4561 1.1 spz .word 0x84cac460 !aes_dround23 %f42,%f0,%f2,%f2 4562 1.1 spz .word 0x94ca4c44 !aes_dround01 %f40,%f4,%f6,%f10 4563 1.1 spz .word 0x8ccacc64 !aes_dround23 %f42,%f4,%f6,%f6 4564 1.1 spz .word 0x80cb4448 !aes_dround01 %f44,%f8,%f2,%f0 4565 1.1 spz .word 0x84cbc468 !aes_dround23 %f46,%f8,%f2,%f2 4566 1.1 spz .word 0x88cb4c4a !aes_dround01 %f44,%f10,%f6,%f4 4567 1.1 spz .word 0x8ccbcc6a !aes_dround23 %f46,%f10,%f6,%f6 4568 1.1 spz .word 0x90cc4440 !aes_dround01 %f48,%f0,%f2,%f8 4569 1.1 spz .word 0x84ccc460 !aes_dround23 %f50,%f0,%f2,%f2 4570 1.1 spz .word 0x94cc4c44 !aes_dround01 %f48,%f4,%f6,%f10 4571 1.1 spz .word 0x8ccccc64 !aes_dround23 %f50,%f4,%f6,%f6 4572 1.1 spz .word 0x80cd4448 !aes_dround01 %f52,%f8,%f2,%f0 4573 1.1 spz .word 0x84cdc468 !aes_dround23 %f54,%f8,%f2,%f2 4574 1.1 spz .word 0x88cd4c4a !aes_dround01 %f52,%f10,%f6,%f4 4575 1.1 spz .word 0x8ccdcc6a !aes_dround23 %f54,%f10,%f6,%f6 4576 1.1 spz .word 0x90ce4440 !aes_dround01 %f56,%f0,%f2,%f8 4577 1.1 spz .word 0x84cec460 !aes_dround23 %f58,%f0,%f2,%f2 4578 1.1 spz .word 0x94ce4c44 !aes_dround01 %f56,%f4,%f6,%f10 4579 1.1 spz .word 0x8ccecc64 !aes_dround23 %f58,%f4,%f6,%f6 4580 1.1 spz .word 0x80cf4448 !aes_dround01 %f60,%f8,%f2,%f0 4581 1.1 spz .word 0x84cfc468 !aes_dround23 %f62,%f8,%f2,%f2 4582 1.1 spz .word 0x88cf4c4a !aes_dround01 %f60,%f10,%f6,%f4 4583 1.1 spz .word 0x8ccfcc6a !aes_dround23 %f62,%f10,%f6,%f6 4584 1.1 spz .word 0x90cc0440 !aes_dround01 %f16,%f0,%f2,%f8 4585 1.1 spz .word 0x84cc8460 !aes_dround23 %f18,%f0,%f2,%f2 4586 1.1 spz .word 0x94cc0c44 !aes_dround01 %f16,%f4,%f6,%f10 4587 1.1 spz .word 0x8ccc8c64 !aes_dround23 %f18,%f4,%f6,%f6 4588 1.1 spz ldd [%i3 + 16], %f16 4589 1.1 spz ldd [%i3 + 24], %f18 4590 1.1 spz .word 0x80cd04c8 !aes_dround01_l %f20,%f8,%f2,%f0 4591 1.1 spz .word 0x84cd84e8 !aes_dround23_l %f22,%f8,%f2,%f2 4592 1.1 spz .word 0x88cd0cca !aes_dround01_l %f20,%f10,%f6,%f4 4593 1.1 spz .word 0x8ccd8cea !aes_dround23_l %f22,%f10,%f6,%f6 4594 1.1 spz ldd [%i3 + 32], %f20 4595 1.1 spz retl 4596 1.1 spz ldd [%i3 + 40], %f22 4597 1.1 spz .type _aes256_decrypt_2x,#function 4598 1.1 spz .size _aes256_decrypt_2x,.-_aes256_decrypt_2x 4599 1.1 spz 4600 1.1 spz .align 32 4601 1.1 spz _aes192_decrypt_1x: 4602 1.1 spz .word 0x88cc0440 !aes_dround01 %f16,%f0,%f2,%f4 4603 1.1 spz .word 0x84cc8460 !aes_dround23 %f18,%f0,%f2,%f2 4604 1.1 spz .word 0x80cd0444 !aes_dround01 %f20,%f4,%f2,%f0 4605 1.1 spz .word 0x84cd8464 !aes_dround23 %f22,%f4,%f2,%f2 4606 1.1 spz .word 0x88ce0440 !aes_dround01 %f24,%f0,%f2,%f4 4607 1.1 spz .word 0x84ce8460 !aes_dround23 %f26,%f0,%f2,%f2 4608 1.1 spz .word 0x80cf0444 !aes_dround01 %f28,%f4,%f2,%f0 4609 1.1 spz .word 0x84cf8464 !aes_dround23 %f30,%f4,%f2,%f2 4610 1.1 spz .word 0x88c84440 !aes_dround01 %f32,%f0,%f2,%f4 4611 1.1 spz .word 0x84c8c460 !aes_dround23 %f34,%f0,%f2,%f2 4612 1.1 spz .word 0x80c94444 !aes_dround01 %f36,%f4,%f2,%f0 4613 1.1 spz .word 0x84c9c464 !aes_dround23 %f38,%f4,%f2,%f2 4614 1.1 spz .word 0x88ca4440 !aes_dround01 %f40,%f0,%f2,%f4 4615 1.1 spz .word 0x84cac460 !aes_dround23 %f42,%f0,%f2,%f2 4616 1.1 spz .word 0x80cb4444 !aes_dround01 %f44,%f4,%f2,%f0 4617 1.1 spz .word 0x84cbc464 !aes_dround23 %f46,%f4,%f2,%f2 4618 1.1 spz .word 0x88cc4440 !aes_dround01 %f48,%f0,%f2,%f4 4619 1.1 spz .word 0x84ccc460 !aes_dround23 %f50,%f0,%f2,%f2 4620 1.1 spz .word 0x80cd4444 !aes_dround01 %f52,%f4,%f2,%f0 4621 1.1 spz .word 0x84cdc464 !aes_dround23 %f54,%f4,%f2,%f2 4622 1.1 spz .word 0x88ce4440 !aes_dround01 %f56,%f0,%f2,%f4 4623 1.1 spz .word 0x84cec460 !aes_dround23 %f58,%f0,%f2,%f2 4624 1.1 spz .word 0x80cf44c4 !aes_dround01_l %f60,%f4,%f2,%f0 4625 1.1 spz retl 4626 1.1 spz .word 0x84cfc4e4 !aes_dround23_l %f62,%f4,%f2,%f2 4627 1.1 spz .type _aes192_decrypt_1x,#function 4628 1.1 spz .size _aes192_decrypt_1x,.-_aes192_decrypt_1x 4629 1.1 spz 4630 1.1 spz .align 32 4631 1.1 spz _aes192_decrypt_2x: 4632 1.1 spz .word 0x90cc0440 !aes_dround01 %f16,%f0,%f2,%f8 4633 1.1 spz .word 0x84cc8460 !aes_dround23 %f18,%f0,%f2,%f2 4634 1.1 spz .word 0x94cc0c44 !aes_dround01 %f16,%f4,%f6,%f10 4635 1.1 spz .word 0x8ccc8c64 !aes_dround23 %f18,%f4,%f6,%f6 4636 1.1 spz .word 0x80cd0448 !aes_dround01 %f20,%f8,%f2,%f0 4637 1.1 spz .word 0x84cd8468 !aes_dround23 %f22,%f8,%f2,%f2 4638 1.1 spz .word 0x88cd0c4a !aes_dround01 %f20,%f10,%f6,%f4 4639 1.1 spz .word 0x8ccd8c6a !aes_dround23 %f22,%f10,%f6,%f6 4640 1.1 spz .word 0x90ce0440 !aes_dround01 %f24,%f0,%f2,%f8 4641 1.1 spz .word 0x84ce8460 !aes_dround23 %f26,%f0,%f2,%f2 4642 1.1 spz .word 0x94ce0c44 !aes_dround01 %f24,%f4,%f6,%f10 4643 1.1 spz .word 0x8cce8c64 !aes_dround23 %f26,%f4,%f6,%f6 4644 1.1 spz .word 0x80cf0448 !aes_dround01 %f28,%f8,%f2,%f0 4645 1.1 spz .word 0x84cf8468 !aes_dround23 %f30,%f8,%f2,%f2 4646 1.1 spz .word 0x88cf0c4a !aes_dround01 %f28,%f10,%f6,%f4 4647 1.1 spz .word 0x8ccf8c6a !aes_dround23 %f30,%f10,%f6,%f6 4648 1.1 spz .word 0x90c84440 !aes_dround01 %f32,%f0,%f2,%f8 4649 1.1 spz .word 0x84c8c460 !aes_dround23 %f34,%f0,%f2,%f2 4650 1.1 spz .word 0x94c84c44 !aes_dround01 %f32,%f4,%f6,%f10 4651 1.1 spz .word 0x8cc8cc64 !aes_dround23 %f34,%f4,%f6,%f6 4652 1.1 spz .word 0x80c94448 !aes_dround01 %f36,%f8,%f2,%f0 4653 1.1 spz .word 0x84c9c468 !aes_dround23 %f38,%f8,%f2,%f2 4654 1.1 spz .word 0x88c94c4a !aes_dround01 %f36,%f10,%f6,%f4 4655 1.1 spz .word 0x8cc9cc6a !aes_dround23 %f38,%f10,%f6,%f6 4656 1.1 spz .word 0x90ca4440 !aes_dround01 %f40,%f0,%f2,%f8 4657 1.1 spz .word 0x84cac460 !aes_dround23 %f42,%f0,%f2,%f2 4658 1.1 spz .word 0x94ca4c44 !aes_dround01 %f40,%f4,%f6,%f10 4659 1.1 spz .word 0x8ccacc64 !aes_dround23 %f42,%f4,%f6,%f6 4660 1.1 spz .word 0x80cb4448 !aes_dround01 %f44,%f8,%f2,%f0 4661 1.1 spz .word 0x84cbc468 !aes_dround23 %f46,%f8,%f2,%f2 4662 1.1 spz .word 0x88cb4c4a !aes_dround01 %f44,%f10,%f6,%f4 4663 1.1 spz .word 0x8ccbcc6a !aes_dround23 %f46,%f10,%f6,%f6 4664 1.1 spz .word 0x90cc4440 !aes_dround01 %f48,%f0,%f2,%f8 4665 1.1 spz .word 0x84ccc460 !aes_dround23 %f50,%f0,%f2,%f2 4666 1.1 spz .word 0x94cc4c44 !aes_dround01 %f48,%f4,%f6,%f10 4667 1.1 spz .word 0x8ccccc64 !aes_dround23 %f50,%f4,%f6,%f6 4668 1.1 spz .word 0x80cd4448 !aes_dround01 %f52,%f8,%f2,%f0 4669 1.1 spz .word 0x84cdc468 !aes_dround23 %f54,%f8,%f2,%f2 4670 1.1 spz .word 0x88cd4c4a !aes_dround01 %f52,%f10,%f6,%f4 4671 1.1 spz .word 0x8ccdcc6a !aes_dround23 %f54,%f10,%f6,%f6 4672 1.1 spz .word 0x90ce4440 !aes_dround01 %f56,%f0,%f2,%f8 4673 1.1 spz .word 0x84cec460 !aes_dround23 %f58,%f0,%f2,%f2 4674 1.1 spz .word 0x94ce4c44 !aes_dround01 %f56,%f4,%f6,%f10 4675 1.1 spz .word 0x8ccecc64 !aes_dround23 %f58,%f4,%f6,%f6 4676 1.1 spz .word 0x80cf44c8 !aes_dround01_l %f60,%f8,%f2,%f0 4677 1.1 spz .word 0x84cfc4e8 !aes_dround23_l %f62,%f8,%f2,%f2 4678 1.1 spz .word 0x88cf4cca !aes_dround01_l %f60,%f10,%f6,%f4 4679 1.1 spz retl 4680 1.1 spz .word 0x8ccfccea !aes_dround23_l %f62,%f10,%f6,%f6 4681 1.1 spz .type _aes192_decrypt_2x,#function 4682 1.1 spz .size _aes192_decrypt_2x,.-_aes192_decrypt_2x 4683 1.1 spz .asciz "AES for SPARC T4, David S. Miller, Andy Polyakov" 4684 1.1 spz .align 4 4685