1*3a608692SPiotr Kubaj/* Do not modify. This file is auto-generated from vpaes-ppc.pl. */ 2*3a608692SPiotr Kubaj.machine "any" 3*3a608692SPiotr Kubaj 4*3a608692SPiotr Kubaj.text 5*3a608692SPiotr Kubaj 6*3a608692SPiotr Kubaj.align 7 7*3a608692SPiotr Kubaj_vpaes_consts: 8*3a608692SPiotr Kubaj.Lk_mc_forward: 9*3a608692SPiotr Kubaj.byte 0x01,0x02,0x03,0x00,0x05,0x06,0x07,0x04,0x09,0x0a,0x0b,0x08,0x0d,0x0e,0x0f,0x0c 10*3a608692SPiotr Kubaj.byte 0x05,0x06,0x07,0x04,0x09,0x0a,0x0b,0x08,0x0d,0x0e,0x0f,0x0c,0x01,0x02,0x03,0x00 11*3a608692SPiotr Kubaj.byte 0x09,0x0a,0x0b,0x08,0x0d,0x0e,0x0f,0x0c,0x01,0x02,0x03,0x00,0x05,0x06,0x07,0x04 12*3a608692SPiotr Kubaj.byte 0x0d,0x0e,0x0f,0x0c,0x01,0x02,0x03,0x00,0x05,0x06,0x07,0x04,0x09,0x0a,0x0b,0x08 13*3a608692SPiotr Kubaj.Lk_mc_backward: 14*3a608692SPiotr Kubaj.byte 0x03,0x00,0x01,0x02,0x07,0x04,0x05,0x06,0x0b,0x08,0x09,0x0a,0x0f,0x0c,0x0d,0x0e 15*3a608692SPiotr Kubaj.byte 0x0f,0x0c,0x0d,0x0e,0x03,0x00,0x01,0x02,0x07,0x04,0x05,0x06,0x0b,0x08,0x09,0x0a 16*3a608692SPiotr Kubaj.byte 0x0b,0x08,0x09,0x0a,0x0f,0x0c,0x0d,0x0e,0x03,0x00,0x01,0x02,0x07,0x04,0x05,0x06 17*3a608692SPiotr Kubaj.byte 0x07,0x04,0x05,0x06,0x0b,0x08,0x09,0x0a,0x0f,0x0c,0x0d,0x0e,0x03,0x00,0x01,0x02 18*3a608692SPiotr Kubaj.Lk_sr: 19*3a608692SPiotr Kubaj.byte 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f 20*3a608692SPiotr Kubaj.byte 0x00,0x05,0x0a,0x0f,0x04,0x09,0x0e,0x03,0x08,0x0d,0x02,0x07,0x0c,0x01,0x06,0x0b 21*3a608692SPiotr Kubaj.byte 0x00,0x09,0x02,0x0b,0x04,0x0d,0x06,0x0f,0x08,0x01,0x0a,0x03,0x0c,0x05,0x0e,0x07 22*3a608692SPiotr Kubaj.byte 0x00,0x0d,0x0a,0x07,0x04,0x01,0x0e,0x0b,0x08,0x05,0x02,0x0f,0x0c,0x09,0x06,0x03 23*3a608692SPiotr Kubaj 24*3a608692SPiotr Kubaj 25*3a608692SPiotr Kubaj 26*3a608692SPiotr Kubaj 27*3a608692SPiotr Kubaj.Lk_inv: 28*3a608692SPiotr Kubaj.byte 0xf0,0x01,0x08,0x0d,0x0f,0x06,0x05,0x0e,0x02,0x0c,0x0b,0x0a,0x09,0x03,0x07,0x04 29*3a608692SPiotr Kubaj.byte 0xf0,0x07,0x0b,0x0f,0x06,0x0a,0x04,0x01,0x09,0x08,0x05,0x02,0x0c,0x0e,0x0d,0x03 30*3a608692SPiotr Kubaj.Lk_ipt: 31*3a608692SPiotr Kubaj.byte 0x00,0x70,0x2a,0x5a,0x98,0xe8,0xb2,0xc2,0x08,0x78,0x22,0x52,0x90,0xe0,0xba,0xca 32*3a608692SPiotr Kubaj.byte 0x00,0x4d,0x7c,0x31,0x7d,0x30,0x01,0x4c,0x81,0xcc,0xfd,0xb0,0xfc,0xb1,0x80,0xcd 33*3a608692SPiotr Kubaj.Lk_sbo: 34*3a608692SPiotr Kubaj.byte 0x00,0xc7,0xbd,0x6f,0x17,0x6d,0xd2,0xd0,0x78,0xa8,0x02,0xc5,0x7a,0xbf,0xaa,0x15 35*3a608692SPiotr Kubaj.byte 0x00,0x6a,0xbb,0x5f,0xa5,0x74,0xe4,0xcf,0xfa,0x35,0x2b,0x41,0xd1,0x90,0x1e,0x8e 36*3a608692SPiotr Kubaj.Lk_sb1: 37*3a608692SPiotr Kubaj.byte 0x00,0x23,0xe2,0xfa,0x15,0xd4,0x18,0x36,0xef,0xd9,0x2e,0x0d,0xc1,0xcc,0xf7,0x3b 38*3a608692SPiotr Kubaj.byte 0x00,0x3e,0x50,0xcb,0x8f,0xe1,0x9b,0xb1,0x44,0xf5,0x2a,0x14,0x6e,0x7a,0xdf,0xa5 39*3a608692SPiotr Kubaj.Lk_sb2: 40*3a608692SPiotr Kubaj.byte 0x00,0x29,0xe1,0x0a,0x40,0x88,0xeb,0x69,0x4a,0x23,0x82,0xab,0xc8,0x63,0xa1,0xc2 41*3a608692SPiotr Kubaj.byte 0x00,0x24,0x71,0x0b,0xc6,0x93,0x7a,0xe2,0xcd,0x2f,0x98,0xbc,0x55,0xe9,0xb7,0x5e 42*3a608692SPiotr Kubaj 43*3a608692SPiotr Kubaj 44*3a608692SPiotr Kubaj 45*3a608692SPiotr Kubaj 46*3a608692SPiotr Kubaj.Lk_dipt: 47*3a608692SPiotr Kubaj.byte 0x00,0x5f,0x54,0x0b,0x04,0x5b,0x50,0x0f,0x1a,0x45,0x4e,0x11,0x1e,0x41,0x4a,0x15 48*3a608692SPiotr Kubaj.byte 0x00,0x65,0x05,0x60,0xe6,0x83,0xe3,0x86,0x94,0xf1,0x91,0xf4,0x72,0x17,0x77,0x12 49*3a608692SPiotr Kubaj.Lk_dsbo: 50*3a608692SPiotr Kubaj.byte 0x00,0x40,0xf9,0x7e,0x53,0xea,0x87,0x13,0x2d,0x3e,0x94,0xd4,0xb9,0x6d,0xaa,0xc7 51*3a608692SPiotr Kubaj.byte 0x00,0x1d,0x44,0x93,0x0f,0x56,0xd7,0x12,0x9c,0x8e,0xc5,0xd8,0x59,0x81,0x4b,0xca 52*3a608692SPiotr Kubaj.Lk_dsb9: 53*3a608692SPiotr Kubaj.byte 0x00,0xd6,0x86,0x9a,0x53,0x03,0x1c,0x85,0xc9,0x4c,0x99,0x4f,0x50,0x1f,0xd5,0xca 54*3a608692SPiotr Kubaj.byte 0x00,0x49,0xd7,0xec,0x89,0x17,0x3b,0xc0,0x65,0xa5,0xfb,0xb2,0x9e,0x2c,0x5e,0x72 55*3a608692SPiotr Kubaj.Lk_dsbd: 56*3a608692SPiotr Kubaj.byte 0x00,0xa2,0xb1,0xe6,0xdf,0xcc,0x57,0x7d,0x39,0x44,0x2a,0x88,0x13,0x9b,0x6e,0xf5 57*3a608692SPiotr Kubaj.byte 0x00,0xcb,0xc6,0x24,0xf7,0xfa,0xe2,0x3c,0xd3,0xef,0xde,0x15,0x0d,0x18,0x31,0x29 58*3a608692SPiotr Kubaj.Lk_dsbb: 59*3a608692SPiotr Kubaj.byte 0x00,0x42,0xb4,0x96,0x92,0x64,0x22,0xd0,0x04,0xd4,0xf2,0xb0,0xf6,0x46,0x26,0x60 60*3a608692SPiotr Kubaj.byte 0x00,0x67,0x59,0xcd,0xa6,0x98,0x94,0xc1,0x6b,0xaa,0x55,0x32,0x3e,0x0c,0xff,0xf3 61*3a608692SPiotr Kubaj.Lk_dsbe: 62*3a608692SPiotr Kubaj.byte 0x00,0xd0,0xd4,0x26,0x96,0x92,0xf2,0x46,0xb0,0xf6,0xb4,0x64,0x04,0x60,0x42,0x22 63*3a608692SPiotr Kubaj.byte 0x00,0xc1,0xaa,0xff,0xcd,0xa6,0x55,0x0c,0x32,0x3e,0x59,0x98,0x6b,0xf3,0x67,0x94 64*3a608692SPiotr Kubaj 65*3a608692SPiotr Kubaj 66*3a608692SPiotr Kubaj 67*3a608692SPiotr Kubaj 68*3a608692SPiotr Kubaj.Lk_dksd: 69*3a608692SPiotr Kubaj.byte 0x00,0x47,0xe4,0xa3,0x5d,0x1a,0xb9,0xfe,0xf9,0xbe,0x1d,0x5a,0xa4,0xe3,0x40,0x07 70*3a608692SPiotr Kubaj.byte 0x00,0x83,0x36,0xb5,0xf4,0x77,0xc2,0x41,0x1e,0x9d,0x28,0xab,0xea,0x69,0xdc,0x5f 71*3a608692SPiotr Kubaj.Lk_dksb: 72*3a608692SPiotr Kubaj.byte 0x00,0xd5,0x50,0x85,0x1f,0xca,0x4f,0x9a,0x99,0x4c,0xc9,0x1c,0x86,0x53,0xd6,0x03 73*3a608692SPiotr Kubaj.byte 0x00,0x4a,0xfc,0xb6,0xa7,0xed,0x5b,0x11,0xc8,0x82,0x34,0x7e,0x6f,0x25,0x93,0xd9 74*3a608692SPiotr Kubaj.Lk_dkse: 75*3a608692SPiotr Kubaj.byte 0x00,0xd6,0xc9,0x1f,0xca,0x1c,0x03,0xd5,0x86,0x50,0x4f,0x99,0x4c,0x9a,0x85,0x53 76*3a608692SPiotr Kubaj.byte 0xe8,0x7b,0xdc,0x4f,0x05,0x96,0x31,0xa2,0x87,0x14,0xb3,0x20,0x6a,0xf9,0x5e,0xcd 77*3a608692SPiotr Kubaj.Lk_dks9: 78*3a608692SPiotr Kubaj.byte 0x00,0xa7,0xd9,0x7e,0xc8,0x6f,0x11,0xb6,0xfc,0x5b,0x25,0x82,0x34,0x93,0xed,0x4a 79*3a608692SPiotr Kubaj.byte 0x00,0x33,0x14,0x27,0x62,0x51,0x76,0x45,0xce,0xfd,0xda,0xe9,0xac,0x9f,0xb8,0x8b 80*3a608692SPiotr Kubaj 81*3a608692SPiotr Kubaj.Lk_rcon: 82*3a608692SPiotr Kubaj.byte 0xb6,0xee,0x9d,0xaf,0xb9,0x91,0x83,0x1f,0x81,0x7d,0x7c,0x4d,0x08,0x98,0x2a,0x70 83*3a608692SPiotr Kubaj.Lk_s63: 84*3a608692SPiotr Kubaj.byte 0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b 85*3a608692SPiotr Kubaj 86*3a608692SPiotr Kubaj.Lk_opt: 87*3a608692SPiotr Kubaj.byte 0x00,0x60,0xb6,0xd6,0x29,0x49,0x9f,0xff,0x08,0x68,0xbe,0xde,0x21,0x41,0x97,0xf7 88*3a608692SPiotr Kubaj.byte 0x00,0xec,0xbc,0x50,0x51,0xbd,0xed,0x01,0xe0,0x0c,0x5c,0xb0,0xb1,0x5d,0x0d,0xe1 89*3a608692SPiotr Kubaj.Lk_deskew: 90*3a608692SPiotr Kubaj.byte 0x00,0xe3,0xa4,0x47,0x40,0xa3,0xe4,0x07,0x1a,0xf9,0xbe,0x5d,0x5a,0xb9,0xfe,0x1d 91*3a608692SPiotr Kubaj.byte 0x00,0x69,0xea,0x83,0xdc,0xb5,0x36,0x5f,0x77,0x1e,0x9d,0xf4,0xab,0xc2,0x41,0x28 92*3a608692SPiotr Kubaj.align 5 93*3a608692SPiotr Kubaj.Lconsts: 94*3a608692SPiotr Kubaj mflr 0 95*3a608692SPiotr Kubaj bcl 20,31,$+4 96*3a608692SPiotr Kubaj mflr 12 97*3a608692SPiotr Kubaj addi 12,12,-0x308 98*3a608692SPiotr Kubaj mtlr 0 99*3a608692SPiotr Kubaj blr 100*3a608692SPiotr Kubaj.long 0 101*3a608692SPiotr Kubaj.byte 0,12,0x14,0,0,0,0,0 102*3a608692SPiotr Kubaj.byte 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105,111,110,32,65,69,83,32,102,111,114,32,65,108,116,105,86,101,99,44,77,105,107,101,32,72,97,109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105,118,101,114,115,105,116,121,41,0 103*3a608692SPiotr Kubaj.align 2 104*3a608692SPiotr Kubaj.align 6 105*3a608692SPiotr Kubaj 106*3a608692SPiotr Kubaj 107*3a608692SPiotr Kubaj 108*3a608692SPiotr Kubaj 109*3a608692SPiotr Kubaj 110*3a608692SPiotr Kubaj 111*3a608692SPiotr Kubaj.align 4 112*3a608692SPiotr Kubaj_vpaes_encrypt_preheat: 113*3a608692SPiotr Kubaj mflr 8 114*3a608692SPiotr Kubaj bl .Lconsts 115*3a608692SPiotr Kubaj mtlr 8 116*3a608692SPiotr Kubaj li 11, 0xc0 117*3a608692SPiotr Kubaj li 10, 0xd0 118*3a608692SPiotr Kubaj li 9, 0xe0 119*3a608692SPiotr Kubaj li 8, 0xf0 120*3a608692SPiotr Kubaj vxor 7, 7, 7 121*3a608692SPiotr Kubaj vspltisb 8,4 122*3a608692SPiotr Kubaj vspltisb 9,0x0f 123*3a608692SPiotr Kubaj lvx 10, 12, 11 124*3a608692SPiotr Kubaj li 11, 0x100 125*3a608692SPiotr Kubaj lvx 11, 12, 10 126*3a608692SPiotr Kubaj li 10, 0x110 127*3a608692SPiotr Kubaj lvx 12, 12, 9 128*3a608692SPiotr Kubaj li 9, 0x120 129*3a608692SPiotr Kubaj lvx 13, 12, 8 130*3a608692SPiotr Kubaj li 8, 0x130 131*3a608692SPiotr Kubaj lvx 14, 12, 11 132*3a608692SPiotr Kubaj li 11, 0x140 133*3a608692SPiotr Kubaj lvx 15, 12, 10 134*3a608692SPiotr Kubaj li 10, 0x150 135*3a608692SPiotr Kubaj lvx 16, 12, 9 136*3a608692SPiotr Kubaj lvx 17, 12, 8 137*3a608692SPiotr Kubaj lvx 18, 12, 11 138*3a608692SPiotr Kubaj lvx 19, 12, 10 139*3a608692SPiotr Kubaj blr 140*3a608692SPiotr Kubaj.long 0 141*3a608692SPiotr Kubaj.byte 0,12,0x14,0,0,0,0,0 142*3a608692SPiotr Kubaj 143*3a608692SPiotr Kubaj 144*3a608692SPiotr Kubaj 145*3a608692SPiotr Kubaj 146*3a608692SPiotr Kubaj 147*3a608692SPiotr Kubaj 148*3a608692SPiotr Kubaj 149*3a608692SPiotr Kubaj 150*3a608692SPiotr Kubaj 151*3a608692SPiotr Kubaj 152*3a608692SPiotr Kubaj 153*3a608692SPiotr Kubaj 154*3a608692SPiotr Kubaj 155*3a608692SPiotr Kubaj 156*3a608692SPiotr Kubaj 157*3a608692SPiotr Kubaj.align 5 158*3a608692SPiotr Kubaj_vpaes_encrypt_core: 159*3a608692SPiotr Kubaj lwz 8, 240(5) 160*3a608692SPiotr Kubaj li 9, 16 161*3a608692SPiotr Kubaj lvx 5, 0, 5 162*3a608692SPiotr Kubaj li 11, 0x10 163*3a608692SPiotr Kubaj lvx 6, 9, 5 164*3a608692SPiotr Kubaj addi 9, 9, 16 165*3a608692SPiotr Kubaj vperm 5, 5, 6, 31 166*3a608692SPiotr Kubaj addi 10, 11, 0x40 167*3a608692SPiotr Kubaj vsrb 1, 0, 8 168*3a608692SPiotr Kubaj vperm 0, 12, 12, 0 169*3a608692SPiotr Kubaj vperm 1, 13, 13, 1 170*3a608692SPiotr Kubaj vxor 0, 0, 5 171*3a608692SPiotr Kubaj vxor 0, 0, 1 172*3a608692SPiotr Kubaj mtctr 8 173*3a608692SPiotr Kubaj b .Lenc_entry 174*3a608692SPiotr Kubaj 175*3a608692SPiotr Kubaj.align 4 176*3a608692SPiotr Kubaj.Lenc_loop: 177*3a608692SPiotr Kubaj 178*3a608692SPiotr Kubaj vperm 4, 17, 7, 2 179*3a608692SPiotr Kubaj lvx 1, 12, 11 180*3a608692SPiotr Kubaj addi 11, 11, 16 181*3a608692SPiotr Kubaj vperm 0, 16, 7, 3 182*3a608692SPiotr Kubaj vxor 4, 4, 5 183*3a608692SPiotr Kubaj andi. 11, 11, 0x30 184*3a608692SPiotr Kubaj vperm 5, 19, 7, 2 185*3a608692SPiotr Kubaj vxor 0, 0, 4 186*3a608692SPiotr Kubaj vperm 2, 18, 7, 3 187*3a608692SPiotr Kubaj lvx 4, 12, 10 188*3a608692SPiotr Kubaj addi 10, 11, 0x40 189*3a608692SPiotr Kubaj vperm 3, 0, 7, 1 190*3a608692SPiotr Kubaj vxor 2, 2, 5 191*3a608692SPiotr Kubaj vperm 0, 0, 7, 4 192*3a608692SPiotr Kubaj vxor 3, 3, 2 193*3a608692SPiotr Kubaj vperm 4, 3, 7, 1 194*3a608692SPiotr Kubaj vxor 0, 0, 3 195*3a608692SPiotr Kubaj vxor 0, 0, 4 196*3a608692SPiotr Kubaj 197*3a608692SPiotr Kubaj.Lenc_entry: 198*3a608692SPiotr Kubaj 199*3a608692SPiotr Kubaj vsrb 1, 0, 8 200*3a608692SPiotr Kubaj vperm 5, 11, 11, 0 201*3a608692SPiotr Kubaj vxor 0, 0, 1 202*3a608692SPiotr Kubaj vperm 3, 10, 10, 1 203*3a608692SPiotr Kubaj vperm 4, 10, 10, 0 204*3a608692SPiotr Kubaj vand 0, 0, 9 205*3a608692SPiotr Kubaj vxor 3, 3, 5 206*3a608692SPiotr Kubaj vxor 4, 4, 5 207*3a608692SPiotr Kubaj vperm 2, 10, 7, 3 208*3a608692SPiotr Kubaj vor 5,6,6 209*3a608692SPiotr Kubaj lvx 6, 9, 5 210*3a608692SPiotr Kubaj vperm 3, 10, 7, 4 211*3a608692SPiotr Kubaj addi 9, 9, 16 212*3a608692SPiotr Kubaj vxor 2, 2, 0 213*3a608692SPiotr Kubaj vperm 5, 5, 6, 31 214*3a608692SPiotr Kubaj vxor 3, 3, 1 215*3a608692SPiotr Kubaj bdnz .Lenc_loop 216*3a608692SPiotr Kubaj 217*3a608692SPiotr Kubaj 218*3a608692SPiotr Kubaj addi 10, 11, 0x80 219*3a608692SPiotr Kubaj 220*3a608692SPiotr Kubaj 221*3a608692SPiotr Kubaj vperm 4, 14, 7, 2 222*3a608692SPiotr Kubaj lvx 1, 12, 10 223*3a608692SPiotr Kubaj vperm 0, 15, 7, 3 224*3a608692SPiotr Kubaj vxor 4, 4, 5 225*3a608692SPiotr Kubaj vxor 0, 0, 4 226*3a608692SPiotr Kubaj vperm 0, 0, 7, 1 227*3a608692SPiotr Kubaj blr 228*3a608692SPiotr Kubaj.long 0 229*3a608692SPiotr Kubaj.byte 0,12,0x14,0,0,0,0,0 230*3a608692SPiotr Kubaj 231*3a608692SPiotr Kubaj.globl vpaes_encrypt 232*3a608692SPiotr Kubaj.type vpaes_encrypt,@function 233*3a608692SPiotr Kubaj.align 5 234*3a608692SPiotr Kubajvpaes_encrypt: 235*3a608692SPiotr Kubaj stwu 1,-232(1) 236*3a608692SPiotr Kubaj li 10,39 237*3a608692SPiotr Kubaj li 11,55 238*3a608692SPiotr Kubaj mflr 6 239*3a608692SPiotr Kubaj mfspr 7,256 240*3a608692SPiotr Kubaj stvx 20,10,1 241*3a608692SPiotr Kubaj addi 10,10,32 242*3a608692SPiotr Kubaj stvx 21,11,1 243*3a608692SPiotr Kubaj addi 11,11,32 244*3a608692SPiotr Kubaj stvx 22,10,1 245*3a608692SPiotr Kubaj addi 10,10,32 246*3a608692SPiotr Kubaj stvx 23,11,1 247*3a608692SPiotr Kubaj addi 11,11,32 248*3a608692SPiotr Kubaj stvx 24,10,1 249*3a608692SPiotr Kubaj addi 10,10,32 250*3a608692SPiotr Kubaj stvx 25,11,1 251*3a608692SPiotr Kubaj addi 11,11,32 252*3a608692SPiotr Kubaj stvx 26,10,1 253*3a608692SPiotr Kubaj addi 10,10,32 254*3a608692SPiotr Kubaj stvx 27,11,1 255*3a608692SPiotr Kubaj addi 11,11,32 256*3a608692SPiotr Kubaj stvx 28,10,1 257*3a608692SPiotr Kubaj addi 10,10,32 258*3a608692SPiotr Kubaj stvx 29,11,1 259*3a608692SPiotr Kubaj addi 11,11,32 260*3a608692SPiotr Kubaj stvx 30,10,1 261*3a608692SPiotr Kubaj stvx 31,11,1 262*3a608692SPiotr Kubaj stw 7,228(1) 263*3a608692SPiotr Kubaj li 0, -1 264*3a608692SPiotr Kubaj stw 6,236(1) 265*3a608692SPiotr Kubaj mtspr 256,0 266*3a608692SPiotr Kubaj 267*3a608692SPiotr Kubaj bl _vpaes_encrypt_preheat 268*3a608692SPiotr Kubaj 269*3a608692SPiotr Kubaj lvsl 27, 0, 3 270*3a608692SPiotr Kubaj lvx 0, 0, 3 271*3a608692SPiotr Kubaj addi 3, 3, 15 272*3a608692SPiotr Kubaj lvsr 29, 0, 4 273*3a608692SPiotr Kubaj lvsl 31, 0, 5 274*3a608692SPiotr Kubaj lvx 26, 0, 3 275*3a608692SPiotr Kubaj vperm 0, 0, 26, 27 276*3a608692SPiotr Kubaj 277*3a608692SPiotr Kubaj bl _vpaes_encrypt_core 278*3a608692SPiotr Kubaj 279*3a608692SPiotr Kubaj andi. 8, 4, 15 280*3a608692SPiotr Kubaj li 9, 16 281*3a608692SPiotr Kubaj beq .Lenc_out_aligned 282*3a608692SPiotr Kubaj 283*3a608692SPiotr Kubaj vperm 0, 0, 0, 29 284*3a608692SPiotr Kubaj mtctr 9 285*3a608692SPiotr Kubaj.Lenc_out_unaligned: 286*3a608692SPiotr Kubaj stvebx 0, 0, 4 287*3a608692SPiotr Kubaj addi 4, 4, 1 288*3a608692SPiotr Kubaj bdnz .Lenc_out_unaligned 289*3a608692SPiotr Kubaj b .Lenc_done 290*3a608692SPiotr Kubaj 291*3a608692SPiotr Kubaj.align 4 292*3a608692SPiotr Kubaj.Lenc_out_aligned: 293*3a608692SPiotr Kubaj stvx 0, 0, 4 294*3a608692SPiotr Kubaj.Lenc_done: 295*3a608692SPiotr Kubaj 296*3a608692SPiotr Kubaj li 10,39 297*3a608692SPiotr Kubaj li 11,55 298*3a608692SPiotr Kubaj mtlr 6 299*3a608692SPiotr Kubaj mtspr 256,7 300*3a608692SPiotr Kubaj lvx 20,10,1 301*3a608692SPiotr Kubaj addi 10,10,32 302*3a608692SPiotr Kubaj lvx 21,11,1 303*3a608692SPiotr Kubaj addi 11,11,32 304*3a608692SPiotr Kubaj lvx 22,10,1 305*3a608692SPiotr Kubaj addi 10,10,32 306*3a608692SPiotr Kubaj lvx 23,11,1 307*3a608692SPiotr Kubaj addi 11,11,32 308*3a608692SPiotr Kubaj lvx 24,10,1 309*3a608692SPiotr Kubaj addi 10,10,32 310*3a608692SPiotr Kubaj lvx 25,11,1 311*3a608692SPiotr Kubaj addi 11,11,32 312*3a608692SPiotr Kubaj lvx 26,10,1 313*3a608692SPiotr Kubaj addi 10,10,32 314*3a608692SPiotr Kubaj lvx 27,11,1 315*3a608692SPiotr Kubaj addi 11,11,32 316*3a608692SPiotr Kubaj lvx 28,10,1 317*3a608692SPiotr Kubaj addi 10,10,32 318*3a608692SPiotr Kubaj lvx 29,11,1 319*3a608692SPiotr Kubaj addi 11,11,32 320*3a608692SPiotr Kubaj lvx 30,10,1 321*3a608692SPiotr Kubaj lvx 31,11,1 322*3a608692SPiotr Kubaj addi 1,1,232 323*3a608692SPiotr Kubaj blr 324*3a608692SPiotr Kubaj.long 0 325*3a608692SPiotr Kubaj.byte 0,12,0x04,1,0x80,0,3,0 326*3a608692SPiotr Kubaj.long 0 327*3a608692SPiotr Kubaj.size vpaes_encrypt,.-vpaes_encrypt 328*3a608692SPiotr Kubaj 329*3a608692SPiotr Kubaj.align 4 330*3a608692SPiotr Kubaj_vpaes_decrypt_preheat: 331*3a608692SPiotr Kubaj mflr 8 332*3a608692SPiotr Kubaj bl .Lconsts 333*3a608692SPiotr Kubaj mtlr 8 334*3a608692SPiotr Kubaj li 11, 0xc0 335*3a608692SPiotr Kubaj li 10, 0xd0 336*3a608692SPiotr Kubaj li 9, 0x160 337*3a608692SPiotr Kubaj li 8, 0x170 338*3a608692SPiotr Kubaj vxor 7, 7, 7 339*3a608692SPiotr Kubaj vspltisb 8,4 340*3a608692SPiotr Kubaj vspltisb 9,0x0f 341*3a608692SPiotr Kubaj lvx 10, 12, 11 342*3a608692SPiotr Kubaj li 11, 0x180 343*3a608692SPiotr Kubaj lvx 11, 12, 10 344*3a608692SPiotr Kubaj li 10, 0x190 345*3a608692SPiotr Kubaj lvx 12, 12, 9 346*3a608692SPiotr Kubaj li 9, 0x1a0 347*3a608692SPiotr Kubaj lvx 13, 12, 8 348*3a608692SPiotr Kubaj li 8, 0x1b0 349*3a608692SPiotr Kubaj lvx 14, 12, 11 350*3a608692SPiotr Kubaj li 11, 0x1c0 351*3a608692SPiotr Kubaj lvx 15, 12, 10 352*3a608692SPiotr Kubaj li 10, 0x1d0 353*3a608692SPiotr Kubaj lvx 16, 12, 9 354*3a608692SPiotr Kubaj li 9, 0x1e0 355*3a608692SPiotr Kubaj lvx 17, 12, 8 356*3a608692SPiotr Kubaj li 8, 0x1f0 357*3a608692SPiotr Kubaj lvx 18, 12, 11 358*3a608692SPiotr Kubaj li 11, 0x200 359*3a608692SPiotr Kubaj lvx 19, 12, 10 360*3a608692SPiotr Kubaj li 10, 0x210 361*3a608692SPiotr Kubaj lvx 20, 12, 9 362*3a608692SPiotr Kubaj lvx 21, 12, 8 363*3a608692SPiotr Kubaj lvx 22, 12, 11 364*3a608692SPiotr Kubaj lvx 23, 12, 10 365*3a608692SPiotr Kubaj blr 366*3a608692SPiotr Kubaj.long 0 367*3a608692SPiotr Kubaj.byte 0,12,0x14,0,0,0,0,0 368*3a608692SPiotr Kubaj 369*3a608692SPiotr Kubaj 370*3a608692SPiotr Kubaj 371*3a608692SPiotr Kubaj 372*3a608692SPiotr Kubaj 373*3a608692SPiotr Kubaj 374*3a608692SPiotr Kubaj.align 4 375*3a608692SPiotr Kubaj_vpaes_decrypt_core: 376*3a608692SPiotr Kubaj lwz 8, 240(5) 377*3a608692SPiotr Kubaj li 9, 16 378*3a608692SPiotr Kubaj lvx 5, 0, 5 379*3a608692SPiotr Kubaj li 11, 0x30 380*3a608692SPiotr Kubaj lvx 6, 9, 5 381*3a608692SPiotr Kubaj addi 9, 9, 16 382*3a608692SPiotr Kubaj vperm 5, 5, 6, 31 383*3a608692SPiotr Kubaj vsrb 1, 0, 8 384*3a608692SPiotr Kubaj vperm 0, 12, 12, 0 385*3a608692SPiotr Kubaj vperm 1, 13, 13, 1 386*3a608692SPiotr Kubaj vxor 0, 0, 5 387*3a608692SPiotr Kubaj vxor 0, 0, 1 388*3a608692SPiotr Kubaj mtctr 8 389*3a608692SPiotr Kubaj b .Ldec_entry 390*3a608692SPiotr Kubaj 391*3a608692SPiotr Kubaj.align 4 392*3a608692SPiotr Kubaj.Ldec_loop: 393*3a608692SPiotr Kubaj 394*3a608692SPiotr Kubaj 395*3a608692SPiotr Kubaj 396*3a608692SPiotr Kubaj lvx 0, 12, 11 397*3a608692SPiotr Kubaj 398*3a608692SPiotr Kubaj 399*3a608692SPiotr Kubaj vperm 4, 16, 7, 2 400*3a608692SPiotr Kubaj subi 11, 11, 16 401*3a608692SPiotr Kubaj vperm 1, 17, 7, 3 402*3a608692SPiotr Kubaj andi. 11, 11, 0x30 403*3a608692SPiotr Kubaj vxor 5, 5, 4 404*3a608692SPiotr Kubaj 405*3a608692SPiotr Kubaj vxor 5, 5, 1 406*3a608692SPiotr Kubaj 407*3a608692SPiotr Kubaj 408*3a608692SPiotr Kubaj vperm 4, 18, 7, 2 409*3a608692SPiotr Kubaj vperm 5, 5, 7, 0 410*3a608692SPiotr Kubaj vperm 1, 19, 7, 3 411*3a608692SPiotr Kubaj vxor 5, 5, 4 412*3a608692SPiotr Kubaj 413*3a608692SPiotr Kubaj vxor 5, 5, 1 414*3a608692SPiotr Kubaj 415*3a608692SPiotr Kubaj 416*3a608692SPiotr Kubaj vperm 4, 20, 7, 2 417*3a608692SPiotr Kubaj vperm 5, 5, 7, 0 418*3a608692SPiotr Kubaj vperm 1, 21, 7, 3 419*3a608692SPiotr Kubaj vxor 5, 5, 4 420*3a608692SPiotr Kubaj 421*3a608692SPiotr Kubaj vxor 5, 5, 1 422*3a608692SPiotr Kubaj 423*3a608692SPiotr Kubaj 424*3a608692SPiotr Kubaj vperm 4, 22, 7, 2 425*3a608692SPiotr Kubaj vperm 5, 5, 7, 0 426*3a608692SPiotr Kubaj vperm 1, 23, 7, 3 427*3a608692SPiotr Kubaj vxor 0, 5, 4 428*3a608692SPiotr Kubaj vxor 0, 0, 1 429*3a608692SPiotr Kubaj 430*3a608692SPiotr Kubaj.Ldec_entry: 431*3a608692SPiotr Kubaj 432*3a608692SPiotr Kubaj vsrb 1, 0, 8 433*3a608692SPiotr Kubaj vperm 2, 11, 11, 0 434*3a608692SPiotr Kubaj vxor 0, 0, 1 435*3a608692SPiotr Kubaj vperm 3, 10, 10, 1 436*3a608692SPiotr Kubaj vperm 4, 10, 10, 0 437*3a608692SPiotr Kubaj vand 0, 0, 9 438*3a608692SPiotr Kubaj vxor 3, 3, 2 439*3a608692SPiotr Kubaj vxor 4, 4, 2 440*3a608692SPiotr Kubaj vperm 2, 10, 7, 3 441*3a608692SPiotr Kubaj vor 5,6,6 442*3a608692SPiotr Kubaj lvx 6, 9, 5 443*3a608692SPiotr Kubaj vperm 3, 10, 7, 4 444*3a608692SPiotr Kubaj addi 9, 9, 16 445*3a608692SPiotr Kubaj vxor 2, 2, 0 446*3a608692SPiotr Kubaj vperm 5, 5, 6, 31 447*3a608692SPiotr Kubaj vxor 3, 3, 1 448*3a608692SPiotr Kubaj bdnz .Ldec_loop 449*3a608692SPiotr Kubaj 450*3a608692SPiotr Kubaj 451*3a608692SPiotr Kubaj addi 10, 11, 0x80 452*3a608692SPiotr Kubaj 453*3a608692SPiotr Kubaj vperm 4, 14, 7, 2 454*3a608692SPiotr Kubaj 455*3a608692SPiotr Kubaj lvx 2, 12, 10 456*3a608692SPiotr Kubaj vperm 1, 15, 7, 3 457*3a608692SPiotr Kubaj vxor 4, 4, 5 458*3a608692SPiotr Kubaj vxor 0, 1, 4 459*3a608692SPiotr Kubaj vperm 0, 0, 7, 2 460*3a608692SPiotr Kubaj blr 461*3a608692SPiotr Kubaj.long 0 462*3a608692SPiotr Kubaj.byte 0,12,0x14,0,0,0,0,0 463*3a608692SPiotr Kubaj 464*3a608692SPiotr Kubaj.globl vpaes_decrypt 465*3a608692SPiotr Kubaj.type vpaes_decrypt,@function 466*3a608692SPiotr Kubaj.align 5 467*3a608692SPiotr Kubajvpaes_decrypt: 468*3a608692SPiotr Kubaj stwu 1,-232(1) 469*3a608692SPiotr Kubaj li 10,39 470*3a608692SPiotr Kubaj li 11,55 471*3a608692SPiotr Kubaj mflr 6 472*3a608692SPiotr Kubaj mfspr 7,256 473*3a608692SPiotr Kubaj stvx 20,10,1 474*3a608692SPiotr Kubaj addi 10,10,32 475*3a608692SPiotr Kubaj stvx 21,11,1 476*3a608692SPiotr Kubaj addi 11,11,32 477*3a608692SPiotr Kubaj stvx 22,10,1 478*3a608692SPiotr Kubaj addi 10,10,32 479*3a608692SPiotr Kubaj stvx 23,11,1 480*3a608692SPiotr Kubaj addi 11,11,32 481*3a608692SPiotr Kubaj stvx 24,10,1 482*3a608692SPiotr Kubaj addi 10,10,32 483*3a608692SPiotr Kubaj stvx 25,11,1 484*3a608692SPiotr Kubaj addi 11,11,32 485*3a608692SPiotr Kubaj stvx 26,10,1 486*3a608692SPiotr Kubaj addi 10,10,32 487*3a608692SPiotr Kubaj stvx 27,11,1 488*3a608692SPiotr Kubaj addi 11,11,32 489*3a608692SPiotr Kubaj stvx 28,10,1 490*3a608692SPiotr Kubaj addi 10,10,32 491*3a608692SPiotr Kubaj stvx 29,11,1 492*3a608692SPiotr Kubaj addi 11,11,32 493*3a608692SPiotr Kubaj stvx 30,10,1 494*3a608692SPiotr Kubaj stvx 31,11,1 495*3a608692SPiotr Kubaj stw 7,228(1) 496*3a608692SPiotr Kubaj li 0, -1 497*3a608692SPiotr Kubaj stw 6,236(1) 498*3a608692SPiotr Kubaj mtspr 256,0 499*3a608692SPiotr Kubaj 500*3a608692SPiotr Kubaj bl _vpaes_decrypt_preheat 501*3a608692SPiotr Kubaj 502*3a608692SPiotr Kubaj lvsl 27, 0, 3 503*3a608692SPiotr Kubaj lvx 0, 0, 3 504*3a608692SPiotr Kubaj addi 3, 3, 15 505*3a608692SPiotr Kubaj lvsr 29, 0, 4 506*3a608692SPiotr Kubaj lvsl 31, 0, 5 507*3a608692SPiotr Kubaj lvx 26, 0, 3 508*3a608692SPiotr Kubaj vperm 0, 0, 26, 27 509*3a608692SPiotr Kubaj 510*3a608692SPiotr Kubaj bl _vpaes_decrypt_core 511*3a608692SPiotr Kubaj 512*3a608692SPiotr Kubaj andi. 8, 4, 15 513*3a608692SPiotr Kubaj li 9, 16 514*3a608692SPiotr Kubaj beq .Ldec_out_aligned 515*3a608692SPiotr Kubaj 516*3a608692SPiotr Kubaj vperm 0, 0, 0, 29 517*3a608692SPiotr Kubaj mtctr 9 518*3a608692SPiotr Kubaj.Ldec_out_unaligned: 519*3a608692SPiotr Kubaj stvebx 0, 0, 4 520*3a608692SPiotr Kubaj addi 4, 4, 1 521*3a608692SPiotr Kubaj bdnz .Ldec_out_unaligned 522*3a608692SPiotr Kubaj b .Ldec_done 523*3a608692SPiotr Kubaj 524*3a608692SPiotr Kubaj.align 4 525*3a608692SPiotr Kubaj.Ldec_out_aligned: 526*3a608692SPiotr Kubaj stvx 0, 0, 4 527*3a608692SPiotr Kubaj.Ldec_done: 528*3a608692SPiotr Kubaj 529*3a608692SPiotr Kubaj li 10,39 530*3a608692SPiotr Kubaj li 11,55 531*3a608692SPiotr Kubaj mtlr 6 532*3a608692SPiotr Kubaj mtspr 256,7 533*3a608692SPiotr Kubaj lvx 20,10,1 534*3a608692SPiotr Kubaj addi 10,10,32 535*3a608692SPiotr Kubaj lvx 21,11,1 536*3a608692SPiotr Kubaj addi 11,11,32 537*3a608692SPiotr Kubaj lvx 22,10,1 538*3a608692SPiotr Kubaj addi 10,10,32 539*3a608692SPiotr Kubaj lvx 23,11,1 540*3a608692SPiotr Kubaj addi 11,11,32 541*3a608692SPiotr Kubaj lvx 24,10,1 542*3a608692SPiotr Kubaj addi 10,10,32 543*3a608692SPiotr Kubaj lvx 25,11,1 544*3a608692SPiotr Kubaj addi 11,11,32 545*3a608692SPiotr Kubaj lvx 26,10,1 546*3a608692SPiotr Kubaj addi 10,10,32 547*3a608692SPiotr Kubaj lvx 27,11,1 548*3a608692SPiotr Kubaj addi 11,11,32 549*3a608692SPiotr Kubaj lvx 28,10,1 550*3a608692SPiotr Kubaj addi 10,10,32 551*3a608692SPiotr Kubaj lvx 29,11,1 552*3a608692SPiotr Kubaj addi 11,11,32 553*3a608692SPiotr Kubaj lvx 30,10,1 554*3a608692SPiotr Kubaj lvx 31,11,1 555*3a608692SPiotr Kubaj addi 1,1,232 556*3a608692SPiotr Kubaj blr 557*3a608692SPiotr Kubaj.long 0 558*3a608692SPiotr Kubaj.byte 0,12,0x04,1,0x80,0,3,0 559*3a608692SPiotr Kubaj.long 0 560*3a608692SPiotr Kubaj.size vpaes_decrypt,.-vpaes_decrypt 561*3a608692SPiotr Kubaj 562*3a608692SPiotr Kubaj.globl vpaes_cbc_encrypt 563*3a608692SPiotr Kubaj.type vpaes_cbc_encrypt,@function 564*3a608692SPiotr Kubaj.align 5 565*3a608692SPiotr Kubajvpaes_cbc_encrypt: 566*3a608692SPiotr Kubaj cmplwi 5,16 567*3a608692SPiotr Kubaj .long 0x4dc00020 568*3a608692SPiotr Kubaj 569*3a608692SPiotr Kubaj stwu 1,-240(1) 570*3a608692SPiotr Kubaj mflr 0 571*3a608692SPiotr Kubaj li 10,39 572*3a608692SPiotr Kubaj li 11,55 573*3a608692SPiotr Kubaj mfspr 12,256 574*3a608692SPiotr Kubaj stvx 20,10,1 575*3a608692SPiotr Kubaj addi 10,10,32 576*3a608692SPiotr Kubaj stvx 21,11,1 577*3a608692SPiotr Kubaj addi 11,11,32 578*3a608692SPiotr Kubaj stvx 22,10,1 579*3a608692SPiotr Kubaj addi 10,10,32 580*3a608692SPiotr Kubaj stvx 23,11,1 581*3a608692SPiotr Kubaj addi 11,11,32 582*3a608692SPiotr Kubaj stvx 24,10,1 583*3a608692SPiotr Kubaj addi 10,10,32 584*3a608692SPiotr Kubaj stvx 25,11,1 585*3a608692SPiotr Kubaj addi 11,11,32 586*3a608692SPiotr Kubaj stvx 26,10,1 587*3a608692SPiotr Kubaj addi 10,10,32 588*3a608692SPiotr Kubaj stvx 27,11,1 589*3a608692SPiotr Kubaj addi 11,11,32 590*3a608692SPiotr Kubaj stvx 28,10,1 591*3a608692SPiotr Kubaj addi 10,10,32 592*3a608692SPiotr Kubaj stvx 29,11,1 593*3a608692SPiotr Kubaj addi 11,11,32 594*3a608692SPiotr Kubaj stvx 30,10,1 595*3a608692SPiotr Kubaj stvx 31,11,1 596*3a608692SPiotr Kubaj stw 12,228(1) 597*3a608692SPiotr Kubaj stw 30,232(1) 598*3a608692SPiotr Kubaj stw 31,236(1) 599*3a608692SPiotr Kubaj li 9, -16 600*3a608692SPiotr Kubaj stw 0, 244(1) 601*3a608692SPiotr Kubaj 602*3a608692SPiotr Kubaj and 30, 5, 9 603*3a608692SPiotr Kubaj andi. 9, 4, 15 604*3a608692SPiotr Kubaj mr 5, 6 605*3a608692SPiotr Kubaj mr 31, 7 606*3a608692SPiotr Kubaj li 6, -1 607*3a608692SPiotr Kubaj mcrf 1, 0 608*3a608692SPiotr Kubaj mr 7, 12 609*3a608692SPiotr Kubaj mtspr 256,6 610*3a608692SPiotr Kubaj 611*3a608692SPiotr Kubaj lvx 24, 0, 31 612*3a608692SPiotr Kubaj li 9, 15 613*3a608692SPiotr Kubaj lvsl 27, 0, 31 614*3a608692SPiotr Kubaj lvx 25, 9, 31 615*3a608692SPiotr Kubaj vperm 24, 24, 25, 27 616*3a608692SPiotr Kubaj 617*3a608692SPiotr Kubaj cmpwi 8, 0 618*3a608692SPiotr Kubaj neg 8, 3 619*3a608692SPiotr Kubaj vxor 7, 7, 7 620*3a608692SPiotr Kubaj lvsl 31, 0, 5 621*3a608692SPiotr Kubaj lvsr 29, 0, 4 622*3a608692SPiotr Kubaj lvsr 27, 0, 8 623*3a608692SPiotr Kubaj vnor 30, 7, 7 624*3a608692SPiotr Kubaj lvx 26, 0, 3 625*3a608692SPiotr Kubaj vperm 30, 7, 30, 29 626*3a608692SPiotr Kubaj addi 3, 3, 15 627*3a608692SPiotr Kubaj 628*3a608692SPiotr Kubaj beq .Lcbc_decrypt 629*3a608692SPiotr Kubaj 630*3a608692SPiotr Kubaj bl _vpaes_encrypt_preheat 631*3a608692SPiotr Kubaj li 0, 16 632*3a608692SPiotr Kubaj 633*3a608692SPiotr Kubaj beq 1, .Lcbc_enc_loop 634*3a608692SPiotr Kubaj 635*3a608692SPiotr Kubaj vor 0,26,26 636*3a608692SPiotr Kubaj lvx 26, 0, 3 637*3a608692SPiotr Kubaj addi 3, 3, 16 638*3a608692SPiotr Kubaj vperm 0, 0, 26, 27 639*3a608692SPiotr Kubaj vxor 0, 0, 24 640*3a608692SPiotr Kubaj 641*3a608692SPiotr Kubaj bl _vpaes_encrypt_core 642*3a608692SPiotr Kubaj 643*3a608692SPiotr Kubaj andi. 8, 4, 15 644*3a608692SPiotr Kubaj vor 24,0,0 645*3a608692SPiotr Kubaj sub 9, 4, 8 646*3a608692SPiotr Kubaj vperm 28, 0, 0, 29 647*3a608692SPiotr Kubaj 648*3a608692SPiotr Kubaj.Lcbc_enc_head: 649*3a608692SPiotr Kubaj stvebx 28, 8, 9 650*3a608692SPiotr Kubaj cmpwi 8, 15 651*3a608692SPiotr Kubaj addi 8, 8, 1 652*3a608692SPiotr Kubaj bne .Lcbc_enc_head 653*3a608692SPiotr Kubaj 654*3a608692SPiotr Kubaj sub. 30, 30, 0 655*3a608692SPiotr Kubaj addi 4, 4, 16 656*3a608692SPiotr Kubaj beq .Lcbc_unaligned_done 657*3a608692SPiotr Kubaj 658*3a608692SPiotr Kubaj.Lcbc_enc_loop: 659*3a608692SPiotr Kubaj vor 0,26,26 660*3a608692SPiotr Kubaj lvx 26, 0, 3 661*3a608692SPiotr Kubaj addi 3, 3, 16 662*3a608692SPiotr Kubaj vperm 0, 0, 26, 27 663*3a608692SPiotr Kubaj vxor 0, 0, 24 664*3a608692SPiotr Kubaj 665*3a608692SPiotr Kubaj bl _vpaes_encrypt_core 666*3a608692SPiotr Kubaj 667*3a608692SPiotr Kubaj vor 24,0,0 668*3a608692SPiotr Kubaj sub. 30, 30, 0 669*3a608692SPiotr Kubaj vperm 0, 0, 0, 29 670*3a608692SPiotr Kubaj vsel 1,28,0,30 671*3a608692SPiotr Kubaj vor 28,0,0 672*3a608692SPiotr Kubaj stvx 1, 0, 4 673*3a608692SPiotr Kubaj addi 4, 4, 16 674*3a608692SPiotr Kubaj bne .Lcbc_enc_loop 675*3a608692SPiotr Kubaj 676*3a608692SPiotr Kubaj b .Lcbc_done 677*3a608692SPiotr Kubaj 678*3a608692SPiotr Kubaj.align 5 679*3a608692SPiotr Kubaj.Lcbc_decrypt: 680*3a608692SPiotr Kubaj bl _vpaes_decrypt_preheat 681*3a608692SPiotr Kubaj li 0, 16 682*3a608692SPiotr Kubaj 683*3a608692SPiotr Kubaj beq 1, .Lcbc_dec_loop 684*3a608692SPiotr Kubaj 685*3a608692SPiotr Kubaj vor 0,26,26 686*3a608692SPiotr Kubaj lvx 26, 0, 3 687*3a608692SPiotr Kubaj addi 3, 3, 16 688*3a608692SPiotr Kubaj vperm 0, 0, 26, 27 689*3a608692SPiotr Kubaj vor 25,0,0 690*3a608692SPiotr Kubaj 691*3a608692SPiotr Kubaj bl _vpaes_decrypt_core 692*3a608692SPiotr Kubaj 693*3a608692SPiotr Kubaj andi. 8, 4, 15 694*3a608692SPiotr Kubaj vxor 0, 0, 24 695*3a608692SPiotr Kubaj vor 24,25,25 696*3a608692SPiotr Kubaj sub 9, 4, 8 697*3a608692SPiotr Kubaj vperm 28, 0, 0, 29 698*3a608692SPiotr Kubaj 699*3a608692SPiotr Kubaj.Lcbc_dec_head: 700*3a608692SPiotr Kubaj stvebx 28, 8, 9 701*3a608692SPiotr Kubaj cmpwi 8, 15 702*3a608692SPiotr Kubaj addi 8, 8, 1 703*3a608692SPiotr Kubaj bne .Lcbc_dec_head 704*3a608692SPiotr Kubaj 705*3a608692SPiotr Kubaj sub. 30, 30, 0 706*3a608692SPiotr Kubaj addi 4, 4, 16 707*3a608692SPiotr Kubaj beq .Lcbc_unaligned_done 708*3a608692SPiotr Kubaj 709*3a608692SPiotr Kubaj.Lcbc_dec_loop: 710*3a608692SPiotr Kubaj vor 0,26,26 711*3a608692SPiotr Kubaj lvx 26, 0, 3 712*3a608692SPiotr Kubaj addi 3, 3, 16 713*3a608692SPiotr Kubaj vperm 0, 0, 26, 27 714*3a608692SPiotr Kubaj vor 25,0,0 715*3a608692SPiotr Kubaj 716*3a608692SPiotr Kubaj bl _vpaes_decrypt_core 717*3a608692SPiotr Kubaj 718*3a608692SPiotr Kubaj vxor 0, 0, 24 719*3a608692SPiotr Kubaj vor 24,25,25 720*3a608692SPiotr Kubaj sub. 30, 30, 0 721*3a608692SPiotr Kubaj vperm 0, 0, 0, 29 722*3a608692SPiotr Kubaj vsel 1,28,0,30 723*3a608692SPiotr Kubaj vor 28,0,0 724*3a608692SPiotr Kubaj stvx 1, 0, 4 725*3a608692SPiotr Kubaj addi 4, 4, 16 726*3a608692SPiotr Kubaj bne .Lcbc_dec_loop 727*3a608692SPiotr Kubaj 728*3a608692SPiotr Kubaj.Lcbc_done: 729*3a608692SPiotr Kubaj beq 1, .Lcbc_write_iv 730*3a608692SPiotr Kubaj 731*3a608692SPiotr Kubaj.Lcbc_unaligned_done: 732*3a608692SPiotr Kubaj andi. 8, 4, 15 733*3a608692SPiotr Kubaj sub 4, 4, 8 734*3a608692SPiotr Kubaj li 9, 0 735*3a608692SPiotr Kubaj.Lcbc_tail: 736*3a608692SPiotr Kubaj stvebx 28, 9, 4 737*3a608692SPiotr Kubaj addi 9, 9, 1 738*3a608692SPiotr Kubaj cmpw 9, 8 739*3a608692SPiotr Kubaj bne .Lcbc_tail 740*3a608692SPiotr Kubaj 741*3a608692SPiotr Kubaj.Lcbc_write_iv: 742*3a608692SPiotr Kubaj neg 8, 31 743*3a608692SPiotr Kubaj li 10, 4 744*3a608692SPiotr Kubaj lvsl 29, 0, 8 745*3a608692SPiotr Kubaj li 11, 8 746*3a608692SPiotr Kubaj li 12, 12 747*3a608692SPiotr Kubaj vperm 24, 24, 24, 29 748*3a608692SPiotr Kubaj stvewx 24, 0, 31 749*3a608692SPiotr Kubaj stvewx 24, 10, 31 750*3a608692SPiotr Kubaj stvewx 24, 11, 31 751*3a608692SPiotr Kubaj stvewx 24, 12, 31 752*3a608692SPiotr Kubaj 753*3a608692SPiotr Kubaj mtspr 256,7 754*3a608692SPiotr Kubaj li 10,39 755*3a608692SPiotr Kubaj li 11,55 756*3a608692SPiotr Kubaj lvx 20,10,1 757*3a608692SPiotr Kubaj addi 10,10,32 758*3a608692SPiotr Kubaj lvx 21,11,1 759*3a608692SPiotr Kubaj addi 11,11,32 760*3a608692SPiotr Kubaj lvx 22,10,1 761*3a608692SPiotr Kubaj addi 10,10,32 762*3a608692SPiotr Kubaj lvx 23,11,1 763*3a608692SPiotr Kubaj addi 11,11,32 764*3a608692SPiotr Kubaj lvx 24,10,1 765*3a608692SPiotr Kubaj addi 10,10,32 766*3a608692SPiotr Kubaj lvx 25,11,1 767*3a608692SPiotr Kubaj addi 11,11,32 768*3a608692SPiotr Kubaj lvx 26,10,1 769*3a608692SPiotr Kubaj addi 10,10,32 770*3a608692SPiotr Kubaj lvx 27,11,1 771*3a608692SPiotr Kubaj addi 11,11,32 772*3a608692SPiotr Kubaj lvx 28,10,1 773*3a608692SPiotr Kubaj addi 10,10,32 774*3a608692SPiotr Kubaj lvx 29,11,1 775*3a608692SPiotr Kubaj addi 11,11,32 776*3a608692SPiotr Kubaj lvx 30,10,1 777*3a608692SPiotr Kubaj lvx 31,11,1 778*3a608692SPiotr Kubaj.Lcbc_abort: 779*3a608692SPiotr Kubaj lwz 0, 244(1) 780*3a608692SPiotr Kubaj lwz 30,232(1) 781*3a608692SPiotr Kubaj lwz 31,236(1) 782*3a608692SPiotr Kubaj mtlr 0 783*3a608692SPiotr Kubaj addi 1,1,240 784*3a608692SPiotr Kubaj blr 785*3a608692SPiotr Kubaj.long 0 786*3a608692SPiotr Kubaj.byte 0,12,0x04,1,0x80,2,6,0 787*3a608692SPiotr Kubaj.long 0 788*3a608692SPiotr Kubaj.size vpaes_cbc_encrypt,.-vpaes_cbc_encrypt 789*3a608692SPiotr Kubaj 790*3a608692SPiotr Kubaj 791*3a608692SPiotr Kubaj 792*3a608692SPiotr Kubaj 793*3a608692SPiotr Kubaj 794*3a608692SPiotr Kubaj.align 4 795*3a608692SPiotr Kubaj_vpaes_key_preheat: 796*3a608692SPiotr Kubaj mflr 8 797*3a608692SPiotr Kubaj bl .Lconsts 798*3a608692SPiotr Kubaj mtlr 8 799*3a608692SPiotr Kubaj li 11, 0xc0 800*3a608692SPiotr Kubaj li 10, 0xd0 801*3a608692SPiotr Kubaj li 9, 0xe0 802*3a608692SPiotr Kubaj li 8, 0xf0 803*3a608692SPiotr Kubaj 804*3a608692SPiotr Kubaj vspltisb 8,4 805*3a608692SPiotr Kubaj vxor 9,9,9 806*3a608692SPiotr Kubaj lvx 10, 12, 11 807*3a608692SPiotr Kubaj li 11, 0x120 808*3a608692SPiotr Kubaj lvx 11, 12, 10 809*3a608692SPiotr Kubaj li 10, 0x130 810*3a608692SPiotr Kubaj lvx 12, 12, 9 811*3a608692SPiotr Kubaj li 9, 0x220 812*3a608692SPiotr Kubaj lvx 13, 12, 8 813*3a608692SPiotr Kubaj li 8, 0x230 814*3a608692SPiotr Kubaj 815*3a608692SPiotr Kubaj lvx 14, 12, 11 816*3a608692SPiotr Kubaj li 11, 0x240 817*3a608692SPiotr Kubaj lvx 15, 12, 10 818*3a608692SPiotr Kubaj li 10, 0x250 819*3a608692SPiotr Kubaj 820*3a608692SPiotr Kubaj lvx 16, 12, 9 821*3a608692SPiotr Kubaj li 9, 0x260 822*3a608692SPiotr Kubaj lvx 17, 12, 8 823*3a608692SPiotr Kubaj li 8, 0x270 824*3a608692SPiotr Kubaj lvx 18, 12, 11 825*3a608692SPiotr Kubaj li 11, 0x280 826*3a608692SPiotr Kubaj lvx 19, 12, 10 827*3a608692SPiotr Kubaj li 10, 0x290 828*3a608692SPiotr Kubaj lvx 20, 12, 9 829*3a608692SPiotr Kubaj li 9, 0x2a0 830*3a608692SPiotr Kubaj lvx 21, 12, 8 831*3a608692SPiotr Kubaj li 8, 0x2b0 832*3a608692SPiotr Kubaj lvx 22, 12, 11 833*3a608692SPiotr Kubaj lvx 23, 12, 10 834*3a608692SPiotr Kubaj 835*3a608692SPiotr Kubaj lvx 24, 12, 9 836*3a608692SPiotr Kubaj lvx 25, 0, 12 837*3a608692SPiotr Kubaj lvx 26, 12, 8 838*3a608692SPiotr Kubaj blr 839*3a608692SPiotr Kubaj.long 0 840*3a608692SPiotr Kubaj.byte 0,12,0x14,0,0,0,0,0 841*3a608692SPiotr Kubaj 842*3a608692SPiotr Kubaj.align 4 843*3a608692SPiotr Kubaj_vpaes_schedule_core: 844*3a608692SPiotr Kubaj mflr 7 845*3a608692SPiotr Kubaj 846*3a608692SPiotr Kubaj bl _vpaes_key_preheat 847*3a608692SPiotr Kubaj 848*3a608692SPiotr Kubaj 849*3a608692SPiotr Kubaj neg 8, 3 850*3a608692SPiotr Kubaj lvx 0, 0, 3 851*3a608692SPiotr Kubaj addi 3, 3, 15 852*3a608692SPiotr Kubaj lvsr 27, 0, 8 853*3a608692SPiotr Kubaj lvx 6, 0, 3 854*3a608692SPiotr Kubaj addi 3, 3, 8 855*3a608692SPiotr Kubaj vperm 0, 0, 6, 27 856*3a608692SPiotr Kubaj 857*3a608692SPiotr Kubaj 858*3a608692SPiotr Kubaj vor 3,0,0 859*3a608692SPiotr Kubaj bl _vpaes_schedule_transform 860*3a608692SPiotr Kubaj vor 7,0,0 861*3a608692SPiotr Kubaj 862*3a608692SPiotr Kubaj bne 1, .Lschedule_am_decrypting 863*3a608692SPiotr Kubaj 864*3a608692SPiotr Kubaj 865*3a608692SPiotr Kubaj li 8, 0x30 866*3a608692SPiotr Kubaj li 9, 4 867*3a608692SPiotr Kubaj li 10, 8 868*3a608692SPiotr Kubaj li 11, 12 869*3a608692SPiotr Kubaj 870*3a608692SPiotr Kubaj lvsr 29, 0, 5 871*3a608692SPiotr Kubaj vnor 30, 9, 9 872*3a608692SPiotr Kubaj vperm 30, 9, 30, 29 873*3a608692SPiotr Kubaj 874*3a608692SPiotr Kubaj 875*3a608692SPiotr Kubaj vperm 28, 0, 0, 29 876*3a608692SPiotr Kubaj stvewx 28, 0, 5 877*3a608692SPiotr Kubaj stvewx 28, 9, 5 878*3a608692SPiotr Kubaj stvewx 28, 10, 5 879*3a608692SPiotr Kubaj addi 10, 12, 0x80 880*3a608692SPiotr Kubaj stvewx 28, 11, 5 881*3a608692SPiotr Kubaj b .Lschedule_go 882*3a608692SPiotr Kubaj 883*3a608692SPiotr Kubaj.Lschedule_am_decrypting: 884*3a608692SPiotr Kubaj srwi 8, 4, 1 885*3a608692SPiotr Kubaj andi. 8, 8, 32 886*3a608692SPiotr Kubaj xori 8, 8, 32 887*3a608692SPiotr Kubaj addi 10, 12, 0x80 888*3a608692SPiotr Kubaj 889*3a608692SPiotr Kubaj lvx 1, 8, 10 890*3a608692SPiotr Kubaj li 9, 4 891*3a608692SPiotr Kubaj li 10, 8 892*3a608692SPiotr Kubaj li 11, 12 893*3a608692SPiotr Kubaj vperm 4, 3, 3, 1 894*3a608692SPiotr Kubaj 895*3a608692SPiotr Kubaj neg 0, 5 896*3a608692SPiotr Kubaj lvsl 29, 0, 0 897*3a608692SPiotr Kubaj vnor 30, 9, 9 898*3a608692SPiotr Kubaj vperm 30, 30, 9, 29 899*3a608692SPiotr Kubaj 900*3a608692SPiotr Kubaj 901*3a608692SPiotr Kubaj vperm 28, 4, 4, 29 902*3a608692SPiotr Kubaj stvewx 28, 0, 5 903*3a608692SPiotr Kubaj stvewx 28, 9, 5 904*3a608692SPiotr Kubaj stvewx 28, 10, 5 905*3a608692SPiotr Kubaj addi 10, 12, 0x80 906*3a608692SPiotr Kubaj stvewx 28, 11, 5 907*3a608692SPiotr Kubaj addi 5, 5, 15 908*3a608692SPiotr Kubaj xori 8, 8, 0x30 909*3a608692SPiotr Kubaj 910*3a608692SPiotr Kubaj.Lschedule_go: 911*3a608692SPiotr Kubaj cmplwi 4, 192 912*3a608692SPiotr Kubaj bgt .Lschedule_256 913*3a608692SPiotr Kubaj beq .Lschedule_192 914*3a608692SPiotr Kubaj 915*3a608692SPiotr Kubaj 916*3a608692SPiotr Kubaj 917*3a608692SPiotr Kubaj 918*3a608692SPiotr Kubaj 919*3a608692SPiotr Kubaj 920*3a608692SPiotr Kubaj 921*3a608692SPiotr Kubaj 922*3a608692SPiotr Kubaj 923*3a608692SPiotr Kubaj 924*3a608692SPiotr Kubaj.Lschedule_128: 925*3a608692SPiotr Kubaj li 0, 10 926*3a608692SPiotr Kubaj mtctr 0 927*3a608692SPiotr Kubaj 928*3a608692SPiotr Kubaj.Loop_schedule_128: 929*3a608692SPiotr Kubaj bl _vpaes_schedule_round 930*3a608692SPiotr Kubaj bdz .Lschedule_mangle_last 931*3a608692SPiotr Kubaj bl _vpaes_schedule_mangle 932*3a608692SPiotr Kubaj b .Loop_schedule_128 933*3a608692SPiotr Kubaj 934*3a608692SPiotr Kubaj 935*3a608692SPiotr Kubaj 936*3a608692SPiotr Kubaj 937*3a608692SPiotr Kubaj 938*3a608692SPiotr Kubaj 939*3a608692SPiotr Kubaj 940*3a608692SPiotr Kubaj 941*3a608692SPiotr Kubaj 942*3a608692SPiotr Kubaj 943*3a608692SPiotr Kubaj 944*3a608692SPiotr Kubaj 945*3a608692SPiotr Kubaj 946*3a608692SPiotr Kubaj 947*3a608692SPiotr Kubaj 948*3a608692SPiotr Kubaj 949*3a608692SPiotr Kubaj.align 4 950*3a608692SPiotr Kubaj.Lschedule_192: 951*3a608692SPiotr Kubaj li 0, 4 952*3a608692SPiotr Kubaj lvx 0, 0, 3 953*3a608692SPiotr Kubaj vperm 0, 6, 0, 27 954*3a608692SPiotr Kubaj vsldoi 0, 3, 0, 8 955*3a608692SPiotr Kubaj bl _vpaes_schedule_transform 956*3a608692SPiotr Kubaj vsldoi 6, 0, 9, 8 957*3a608692SPiotr Kubaj vsldoi 6, 9, 6, 8 958*3a608692SPiotr Kubaj mtctr 0 959*3a608692SPiotr Kubaj 960*3a608692SPiotr Kubaj.Loop_schedule_192: 961*3a608692SPiotr Kubaj bl _vpaes_schedule_round 962*3a608692SPiotr Kubaj vsldoi 0, 6, 0, 8 963*3a608692SPiotr Kubaj bl _vpaes_schedule_mangle 964*3a608692SPiotr Kubaj bl _vpaes_schedule_192_smear 965*3a608692SPiotr Kubaj bl _vpaes_schedule_mangle 966*3a608692SPiotr Kubaj bl _vpaes_schedule_round 967*3a608692SPiotr Kubaj bdz .Lschedule_mangle_last 968*3a608692SPiotr Kubaj bl _vpaes_schedule_mangle 969*3a608692SPiotr Kubaj bl _vpaes_schedule_192_smear 970*3a608692SPiotr Kubaj b .Loop_schedule_192 971*3a608692SPiotr Kubaj 972*3a608692SPiotr Kubaj 973*3a608692SPiotr Kubaj 974*3a608692SPiotr Kubaj 975*3a608692SPiotr Kubaj 976*3a608692SPiotr Kubaj 977*3a608692SPiotr Kubaj 978*3a608692SPiotr Kubaj 979*3a608692SPiotr Kubaj 980*3a608692SPiotr Kubaj 981*3a608692SPiotr Kubaj 982*3a608692SPiotr Kubaj.align 4 983*3a608692SPiotr Kubaj.Lschedule_256: 984*3a608692SPiotr Kubaj li 0, 7 985*3a608692SPiotr Kubaj addi 3, 3, 8 986*3a608692SPiotr Kubaj lvx 0, 0, 3 987*3a608692SPiotr Kubaj vperm 0, 6, 0, 27 988*3a608692SPiotr Kubaj bl _vpaes_schedule_transform 989*3a608692SPiotr Kubaj mtctr 0 990*3a608692SPiotr Kubaj 991*3a608692SPiotr Kubaj.Loop_schedule_256: 992*3a608692SPiotr Kubaj bl _vpaes_schedule_mangle 993*3a608692SPiotr Kubaj vor 6,0,0 994*3a608692SPiotr Kubaj 995*3a608692SPiotr Kubaj 996*3a608692SPiotr Kubaj bl _vpaes_schedule_round 997*3a608692SPiotr Kubaj bdz .Lschedule_mangle_last 998*3a608692SPiotr Kubaj bl _vpaes_schedule_mangle 999*3a608692SPiotr Kubaj 1000*3a608692SPiotr Kubaj 1001*3a608692SPiotr Kubaj vspltw 0, 0, 3 1002*3a608692SPiotr Kubaj vor 5,7,7 1003*3a608692SPiotr Kubaj vor 7,6,6 1004*3a608692SPiotr Kubaj bl _vpaes_schedule_low_round 1005*3a608692SPiotr Kubaj vor 7,5,5 1006*3a608692SPiotr Kubaj 1007*3a608692SPiotr Kubaj b .Loop_schedule_256 1008*3a608692SPiotr Kubaj 1009*3a608692SPiotr Kubaj 1010*3a608692SPiotr Kubaj 1011*3a608692SPiotr Kubaj 1012*3a608692SPiotr Kubaj 1013*3a608692SPiotr Kubaj 1014*3a608692SPiotr Kubaj 1015*3a608692SPiotr Kubaj 1016*3a608692SPiotr Kubaj 1017*3a608692SPiotr Kubaj 1018*3a608692SPiotr Kubaj.align 4 1019*3a608692SPiotr Kubaj.Lschedule_mangle_last: 1020*3a608692SPiotr Kubaj 1021*3a608692SPiotr Kubaj li 11, 0x2e0 1022*3a608692SPiotr Kubaj li 9, 0x2f0 1023*3a608692SPiotr Kubaj bne 1, .Lschedule_mangle_last_dec 1024*3a608692SPiotr Kubaj 1025*3a608692SPiotr Kubaj 1026*3a608692SPiotr Kubaj lvx 1, 8, 10 1027*3a608692SPiotr Kubaj li 11, 0x2c0 1028*3a608692SPiotr Kubaj li 9, 0x2d0 1029*3a608692SPiotr Kubaj vperm 0, 0, 0, 1 1030*3a608692SPiotr Kubaj 1031*3a608692SPiotr Kubaj lvx 12, 11, 12 1032*3a608692SPiotr Kubaj lvx 13, 9, 12 1033*3a608692SPiotr Kubaj addi 5, 5, 16 1034*3a608692SPiotr Kubaj vxor 0, 0, 26 1035*3a608692SPiotr Kubaj bl _vpaes_schedule_transform 1036*3a608692SPiotr Kubaj 1037*3a608692SPiotr Kubaj 1038*3a608692SPiotr Kubaj vperm 0, 0, 0, 29 1039*3a608692SPiotr Kubaj li 10, 4 1040*3a608692SPiotr Kubaj vsel 2,28,0,30 1041*3a608692SPiotr Kubaj li 11, 8 1042*3a608692SPiotr Kubaj stvx 2, 0, 5 1043*3a608692SPiotr Kubaj li 12, 12 1044*3a608692SPiotr Kubaj stvewx 0, 0, 5 1045*3a608692SPiotr Kubaj stvewx 0, 10, 5 1046*3a608692SPiotr Kubaj stvewx 0, 11, 5 1047*3a608692SPiotr Kubaj stvewx 0, 12, 5 1048*3a608692SPiotr Kubaj b .Lschedule_mangle_done 1049*3a608692SPiotr Kubaj 1050*3a608692SPiotr Kubaj.align 4 1051*3a608692SPiotr Kubaj.Lschedule_mangle_last_dec: 1052*3a608692SPiotr Kubaj lvx 12, 11, 12 1053*3a608692SPiotr Kubaj lvx 13, 9, 12 1054*3a608692SPiotr Kubaj addi 5, 5, -16 1055*3a608692SPiotr Kubaj vxor 0, 0, 26 1056*3a608692SPiotr Kubaj bl _vpaes_schedule_transform 1057*3a608692SPiotr Kubaj 1058*3a608692SPiotr Kubaj 1059*3a608692SPiotr Kubaj addi 9, 5, -15 1060*3a608692SPiotr Kubaj vperm 0, 0, 0, 29 1061*3a608692SPiotr Kubaj li 10, 4 1062*3a608692SPiotr Kubaj vsel 2,28,0,30 1063*3a608692SPiotr Kubaj li 11, 8 1064*3a608692SPiotr Kubaj stvx 2, 0, 5 1065*3a608692SPiotr Kubaj li 12, 12 1066*3a608692SPiotr Kubaj stvewx 0, 0, 9 1067*3a608692SPiotr Kubaj stvewx 0, 10, 9 1068*3a608692SPiotr Kubaj stvewx 0, 11, 9 1069*3a608692SPiotr Kubaj stvewx 0, 12, 9 1070*3a608692SPiotr Kubaj 1071*3a608692SPiotr Kubaj 1072*3a608692SPiotr Kubaj.Lschedule_mangle_done: 1073*3a608692SPiotr Kubaj mtlr 7 1074*3a608692SPiotr Kubaj 1075*3a608692SPiotr Kubaj vxor 0, 0, 0 1076*3a608692SPiotr Kubaj vxor 1, 1, 1 1077*3a608692SPiotr Kubaj vxor 2, 2, 2 1078*3a608692SPiotr Kubaj vxor 3, 3, 3 1079*3a608692SPiotr Kubaj vxor 4, 4, 4 1080*3a608692SPiotr Kubaj vxor 5, 5, 5 1081*3a608692SPiotr Kubaj vxor 6, 6, 6 1082*3a608692SPiotr Kubaj vxor 7, 7, 7 1083*3a608692SPiotr Kubaj 1084*3a608692SPiotr Kubaj blr 1085*3a608692SPiotr Kubaj.long 0 1086*3a608692SPiotr Kubaj.byte 0,12,0x14,0,0,0,0,0 1087*3a608692SPiotr Kubaj 1088*3a608692SPiotr Kubaj 1089*3a608692SPiotr Kubaj 1090*3a608692SPiotr Kubaj 1091*3a608692SPiotr Kubaj 1092*3a608692SPiotr Kubaj 1093*3a608692SPiotr Kubaj 1094*3a608692SPiotr Kubaj 1095*3a608692SPiotr Kubaj 1096*3a608692SPiotr Kubaj 1097*3a608692SPiotr Kubaj 1098*3a608692SPiotr Kubaj 1099*3a608692SPiotr Kubaj 1100*3a608692SPiotr Kubaj 1101*3a608692SPiotr Kubaj 1102*3a608692SPiotr Kubaj.align 4 1103*3a608692SPiotr Kubaj_vpaes_schedule_192_smear: 1104*3a608692SPiotr Kubaj vspltw 0, 7, 3 1105*3a608692SPiotr Kubaj vsldoi 1, 9, 6, 12 1106*3a608692SPiotr Kubaj vsldoi 0, 7, 0, 8 1107*3a608692SPiotr Kubaj vxor 6, 6, 1 1108*3a608692SPiotr Kubaj vxor 6, 6, 0 1109*3a608692SPiotr Kubaj vor 0,6,6 1110*3a608692SPiotr Kubaj vsldoi 6, 6, 9, 8 1111*3a608692SPiotr Kubaj vsldoi 6, 9, 6, 8 1112*3a608692SPiotr Kubaj blr 1113*3a608692SPiotr Kubaj.long 0 1114*3a608692SPiotr Kubaj.byte 0,12,0x14,0,0,0,0,0 1115*3a608692SPiotr Kubaj 1116*3a608692SPiotr Kubaj 1117*3a608692SPiotr Kubaj 1118*3a608692SPiotr Kubaj 1119*3a608692SPiotr Kubaj 1120*3a608692SPiotr Kubaj 1121*3a608692SPiotr Kubaj 1122*3a608692SPiotr Kubaj 1123*3a608692SPiotr Kubaj 1124*3a608692SPiotr Kubaj 1125*3a608692SPiotr Kubaj 1126*3a608692SPiotr Kubaj 1127*3a608692SPiotr Kubaj 1128*3a608692SPiotr Kubaj 1129*3a608692SPiotr Kubaj 1130*3a608692SPiotr Kubaj 1131*3a608692SPiotr Kubaj 1132*3a608692SPiotr Kubaj 1133*3a608692SPiotr Kubaj 1134*3a608692SPiotr Kubaj.align 4 1135*3a608692SPiotr Kubaj_vpaes_schedule_round: 1136*3a608692SPiotr Kubaj 1137*3a608692SPiotr Kubaj 1138*3a608692SPiotr Kubaj vsldoi 1, 24, 9, 15 1139*3a608692SPiotr Kubaj vsldoi 24, 24, 24, 15 1140*3a608692SPiotr Kubaj vxor 7, 7, 1 1141*3a608692SPiotr Kubaj 1142*3a608692SPiotr Kubaj 1143*3a608692SPiotr Kubaj vspltw 0, 0, 3 1144*3a608692SPiotr Kubaj vsldoi 0, 0, 0, 1 1145*3a608692SPiotr Kubaj 1146*3a608692SPiotr Kubaj 1147*3a608692SPiotr Kubaj 1148*3a608692SPiotr Kubaj 1149*3a608692SPiotr Kubaj_vpaes_schedule_low_round: 1150*3a608692SPiotr Kubaj 1151*3a608692SPiotr Kubaj vsldoi 1, 9, 7, 12 1152*3a608692SPiotr Kubaj vxor 7, 7, 1 1153*3a608692SPiotr Kubaj vspltisb 1,0x0f 1154*3a608692SPiotr Kubaj vsldoi 4, 9, 7, 8 1155*3a608692SPiotr Kubaj 1156*3a608692SPiotr Kubaj 1157*3a608692SPiotr Kubaj vand 1, 1, 0 1158*3a608692SPiotr Kubaj vsrb 0, 0, 8 1159*3a608692SPiotr Kubaj vxor 7, 7, 4 1160*3a608692SPiotr Kubaj vperm 2, 11, 9, 1 1161*3a608692SPiotr Kubaj vxor 1, 1, 0 1162*3a608692SPiotr Kubaj vperm 3, 10, 9, 0 1163*3a608692SPiotr Kubaj vxor 3, 3, 2 1164*3a608692SPiotr Kubaj vperm 4, 10, 9, 1 1165*3a608692SPiotr Kubaj vxor 7, 7, 26 1166*3a608692SPiotr Kubaj vperm 3, 10, 9, 3 1167*3a608692SPiotr Kubaj vxor 4, 4, 2 1168*3a608692SPiotr Kubaj vperm 2, 10, 9, 4 1169*3a608692SPiotr Kubaj vxor 3, 3, 1 1170*3a608692SPiotr Kubaj vxor 2, 2, 0 1171*3a608692SPiotr Kubaj vperm 4, 15, 9, 3 1172*3a608692SPiotr Kubaj vperm 1, 14, 9, 2 1173*3a608692SPiotr Kubaj vxor 1, 1, 4 1174*3a608692SPiotr Kubaj 1175*3a608692SPiotr Kubaj 1176*3a608692SPiotr Kubaj vxor 0, 1, 7 1177*3a608692SPiotr Kubaj vxor 7, 1, 7 1178*3a608692SPiotr Kubaj blr 1179*3a608692SPiotr Kubaj.long 0 1180*3a608692SPiotr Kubaj.byte 0,12,0x14,0,0,0,0,0 1181*3a608692SPiotr Kubaj 1182*3a608692SPiotr Kubaj 1183*3a608692SPiotr Kubaj 1184*3a608692SPiotr Kubaj 1185*3a608692SPiotr Kubaj 1186*3a608692SPiotr Kubaj 1187*3a608692SPiotr Kubaj 1188*3a608692SPiotr Kubaj 1189*3a608692SPiotr Kubaj 1190*3a608692SPiotr Kubaj 1191*3a608692SPiotr Kubaj.align 4 1192*3a608692SPiotr Kubaj_vpaes_schedule_transform: 1193*3a608692SPiotr Kubaj 1194*3a608692SPiotr Kubaj vsrb 2, 0, 8 1195*3a608692SPiotr Kubaj 1196*3a608692SPiotr Kubaj vperm 0, 12, 12, 0 1197*3a608692SPiotr Kubaj 1198*3a608692SPiotr Kubaj vperm 2, 13, 13, 2 1199*3a608692SPiotr Kubaj vxor 0, 0, 2 1200*3a608692SPiotr Kubaj blr 1201*3a608692SPiotr Kubaj.long 0 1202*3a608692SPiotr Kubaj.byte 0,12,0x14,0,0,0,0,0 1203*3a608692SPiotr Kubaj 1204*3a608692SPiotr Kubaj 1205*3a608692SPiotr Kubaj 1206*3a608692SPiotr Kubaj 1207*3a608692SPiotr Kubaj 1208*3a608692SPiotr Kubaj 1209*3a608692SPiotr Kubaj 1210*3a608692SPiotr Kubaj 1211*3a608692SPiotr Kubaj 1212*3a608692SPiotr Kubaj 1213*3a608692SPiotr Kubaj 1214*3a608692SPiotr Kubaj 1215*3a608692SPiotr Kubaj 1216*3a608692SPiotr Kubaj 1217*3a608692SPiotr Kubaj 1218*3a608692SPiotr Kubaj 1219*3a608692SPiotr Kubaj 1220*3a608692SPiotr Kubaj 1221*3a608692SPiotr Kubaj 1222*3a608692SPiotr Kubaj 1223*3a608692SPiotr Kubaj 1224*3a608692SPiotr Kubaj 1225*3a608692SPiotr Kubaj 1226*3a608692SPiotr Kubaj 1227*3a608692SPiotr Kubaj.align 4 1228*3a608692SPiotr Kubaj_vpaes_schedule_mangle: 1229*3a608692SPiotr Kubaj 1230*3a608692SPiotr Kubaj 1231*3a608692SPiotr Kubaj bne 1, .Lschedule_mangle_dec 1232*3a608692SPiotr Kubaj 1233*3a608692SPiotr Kubaj 1234*3a608692SPiotr Kubaj vxor 4, 0, 26 1235*3a608692SPiotr Kubaj addi 5, 5, 16 1236*3a608692SPiotr Kubaj vperm 4, 4, 4, 25 1237*3a608692SPiotr Kubaj vperm 1, 4, 4, 25 1238*3a608692SPiotr Kubaj vperm 3, 1, 1, 25 1239*3a608692SPiotr Kubaj vxor 4, 4, 1 1240*3a608692SPiotr Kubaj lvx 1, 8, 10 1241*3a608692SPiotr Kubaj vxor 3, 3, 4 1242*3a608692SPiotr Kubaj 1243*3a608692SPiotr Kubaj vperm 3, 3, 3, 1 1244*3a608692SPiotr Kubaj addi 8, 8, -16 1245*3a608692SPiotr Kubaj andi. 8, 8, 0x30 1246*3a608692SPiotr Kubaj 1247*3a608692SPiotr Kubaj 1248*3a608692SPiotr Kubaj vperm 1, 3, 3, 29 1249*3a608692SPiotr Kubaj vsel 2,28,1,30 1250*3a608692SPiotr Kubaj vor 28,1,1 1251*3a608692SPiotr Kubaj stvx 2, 0, 5 1252*3a608692SPiotr Kubaj blr 1253*3a608692SPiotr Kubaj 1254*3a608692SPiotr Kubaj.align 4 1255*3a608692SPiotr Kubaj.Lschedule_mangle_dec: 1256*3a608692SPiotr Kubaj 1257*3a608692SPiotr Kubaj 1258*3a608692SPiotr Kubaj vsrb 1, 0, 8 1259*3a608692SPiotr Kubaj 1260*3a608692SPiotr Kubaj 1261*3a608692SPiotr Kubaj 1262*3a608692SPiotr Kubaj vperm 2, 16, 16, 0 1263*3a608692SPiotr Kubaj 1264*3a608692SPiotr Kubaj vperm 3, 17, 17, 1 1265*3a608692SPiotr Kubaj vxor 3, 3, 2 1266*3a608692SPiotr Kubaj vperm 3, 3, 9, 25 1267*3a608692SPiotr Kubaj 1268*3a608692SPiotr Kubaj 1269*3a608692SPiotr Kubaj vperm 2, 18, 18, 0 1270*3a608692SPiotr Kubaj vxor 2, 2, 3 1271*3a608692SPiotr Kubaj 1272*3a608692SPiotr Kubaj vperm 3, 19, 19, 1 1273*3a608692SPiotr Kubaj vxor 3, 3, 2 1274*3a608692SPiotr Kubaj vperm 3, 3, 9, 25 1275*3a608692SPiotr Kubaj 1276*3a608692SPiotr Kubaj 1277*3a608692SPiotr Kubaj vperm 2, 20, 20, 0 1278*3a608692SPiotr Kubaj vxor 2, 2, 3 1279*3a608692SPiotr Kubaj 1280*3a608692SPiotr Kubaj vperm 3, 21, 21, 1 1281*3a608692SPiotr Kubaj vxor 3, 3, 2 1282*3a608692SPiotr Kubaj 1283*3a608692SPiotr Kubaj 1284*3a608692SPiotr Kubaj vperm 2, 22, 22, 0 1285*3a608692SPiotr Kubaj vperm 3, 3, 9, 25 1286*3a608692SPiotr Kubaj 1287*3a608692SPiotr Kubaj vperm 4, 23, 23, 1 1288*3a608692SPiotr Kubaj lvx 1, 8, 10 1289*3a608692SPiotr Kubaj vxor 2, 2, 3 1290*3a608692SPiotr Kubaj vxor 3, 4, 2 1291*3a608692SPiotr Kubaj 1292*3a608692SPiotr Kubaj addi 5, 5, -16 1293*3a608692SPiotr Kubaj 1294*3a608692SPiotr Kubaj vperm 3, 3, 3, 1 1295*3a608692SPiotr Kubaj addi 8, 8, -16 1296*3a608692SPiotr Kubaj andi. 8, 8, 0x30 1297*3a608692SPiotr Kubaj 1298*3a608692SPiotr Kubaj 1299*3a608692SPiotr Kubaj vperm 1, 3, 3, 29 1300*3a608692SPiotr Kubaj vsel 2,28,1,30 1301*3a608692SPiotr Kubaj vor 28,1,1 1302*3a608692SPiotr Kubaj stvx 2, 0, 5 1303*3a608692SPiotr Kubaj blr 1304*3a608692SPiotr Kubaj.long 0 1305*3a608692SPiotr Kubaj.byte 0,12,0x14,0,0,0,0,0 1306*3a608692SPiotr Kubaj 1307*3a608692SPiotr Kubaj.globl vpaes_set_encrypt_key 1308*3a608692SPiotr Kubaj.type vpaes_set_encrypt_key,@function 1309*3a608692SPiotr Kubaj.align 5 1310*3a608692SPiotr Kubajvpaes_set_encrypt_key: 1311*3a608692SPiotr Kubaj stwu 1,-232(1) 1312*3a608692SPiotr Kubaj li 10,39 1313*3a608692SPiotr Kubaj li 11,55 1314*3a608692SPiotr Kubaj mflr 0 1315*3a608692SPiotr Kubaj mfspr 6,256 1316*3a608692SPiotr Kubaj stvx 20,10,1 1317*3a608692SPiotr Kubaj addi 10,10,32 1318*3a608692SPiotr Kubaj stvx 21,11,1 1319*3a608692SPiotr Kubaj addi 11,11,32 1320*3a608692SPiotr Kubaj stvx 22,10,1 1321*3a608692SPiotr Kubaj addi 10,10,32 1322*3a608692SPiotr Kubaj stvx 23,11,1 1323*3a608692SPiotr Kubaj addi 11,11,32 1324*3a608692SPiotr Kubaj stvx 24,10,1 1325*3a608692SPiotr Kubaj addi 10,10,32 1326*3a608692SPiotr Kubaj stvx 25,11,1 1327*3a608692SPiotr Kubaj addi 11,11,32 1328*3a608692SPiotr Kubaj stvx 26,10,1 1329*3a608692SPiotr Kubaj addi 10,10,32 1330*3a608692SPiotr Kubaj stvx 27,11,1 1331*3a608692SPiotr Kubaj addi 11,11,32 1332*3a608692SPiotr Kubaj stvx 28,10,1 1333*3a608692SPiotr Kubaj addi 10,10,32 1334*3a608692SPiotr Kubaj stvx 29,11,1 1335*3a608692SPiotr Kubaj addi 11,11,32 1336*3a608692SPiotr Kubaj stvx 30,10,1 1337*3a608692SPiotr Kubaj stvx 31,11,1 1338*3a608692SPiotr Kubaj stw 6,228(1) 1339*3a608692SPiotr Kubaj li 7, -1 1340*3a608692SPiotr Kubaj stw 0, 236(1) 1341*3a608692SPiotr Kubaj mtspr 256,7 1342*3a608692SPiotr Kubaj 1343*3a608692SPiotr Kubaj srwi 9, 4, 5 1344*3a608692SPiotr Kubaj addi 9, 9, 6 1345*3a608692SPiotr Kubaj stw 9, 240(5) 1346*3a608692SPiotr Kubaj 1347*3a608692SPiotr Kubaj .long 0x7c842040 1348*3a608692SPiotr Kubaj li 8, 0x30 1349*3a608692SPiotr Kubaj bl _vpaes_schedule_core 1350*3a608692SPiotr Kubaj 1351*3a608692SPiotr Kubaj lwz 0, 236(1) 1352*3a608692SPiotr Kubaj li 10,39 1353*3a608692SPiotr Kubaj li 11,55 1354*3a608692SPiotr Kubaj mtspr 256,6 1355*3a608692SPiotr Kubaj mtlr 0 1356*3a608692SPiotr Kubaj xor 3, 3, 3 1357*3a608692SPiotr Kubaj lvx 20,10,1 1358*3a608692SPiotr Kubaj addi 10,10,32 1359*3a608692SPiotr Kubaj lvx 21,11,1 1360*3a608692SPiotr Kubaj addi 11,11,32 1361*3a608692SPiotr Kubaj lvx 22,10,1 1362*3a608692SPiotr Kubaj addi 10,10,32 1363*3a608692SPiotr Kubaj lvx 23,11,1 1364*3a608692SPiotr Kubaj addi 11,11,32 1365*3a608692SPiotr Kubaj lvx 24,10,1 1366*3a608692SPiotr Kubaj addi 10,10,32 1367*3a608692SPiotr Kubaj lvx 25,11,1 1368*3a608692SPiotr Kubaj addi 11,11,32 1369*3a608692SPiotr Kubaj lvx 26,10,1 1370*3a608692SPiotr Kubaj addi 10,10,32 1371*3a608692SPiotr Kubaj lvx 27,11,1 1372*3a608692SPiotr Kubaj addi 11,11,32 1373*3a608692SPiotr Kubaj lvx 28,10,1 1374*3a608692SPiotr Kubaj addi 10,10,32 1375*3a608692SPiotr Kubaj lvx 29,11,1 1376*3a608692SPiotr Kubaj addi 11,11,32 1377*3a608692SPiotr Kubaj lvx 30,10,1 1378*3a608692SPiotr Kubaj lvx 31,11,1 1379*3a608692SPiotr Kubaj addi 1,1,232 1380*3a608692SPiotr Kubaj blr 1381*3a608692SPiotr Kubaj.long 0 1382*3a608692SPiotr Kubaj.byte 0,12,0x04,1,0x80,0,3,0 1383*3a608692SPiotr Kubaj.long 0 1384*3a608692SPiotr Kubaj.size vpaes_set_encrypt_key,.-vpaes_set_encrypt_key 1385*3a608692SPiotr Kubaj 1386*3a608692SPiotr Kubaj.globl vpaes_set_decrypt_key 1387*3a608692SPiotr Kubaj.type vpaes_set_decrypt_key,@function 1388*3a608692SPiotr Kubaj.align 4 1389*3a608692SPiotr Kubajvpaes_set_decrypt_key: 1390*3a608692SPiotr Kubaj stwu 1,-232(1) 1391*3a608692SPiotr Kubaj li 10,39 1392*3a608692SPiotr Kubaj li 11,55 1393*3a608692SPiotr Kubaj mflr 0 1394*3a608692SPiotr Kubaj mfspr 6,256 1395*3a608692SPiotr Kubaj stvx 20,10,1 1396*3a608692SPiotr Kubaj addi 10,10,32 1397*3a608692SPiotr Kubaj stvx 21,11,1 1398*3a608692SPiotr Kubaj addi 11,11,32 1399*3a608692SPiotr Kubaj stvx 22,10,1 1400*3a608692SPiotr Kubaj addi 10,10,32 1401*3a608692SPiotr Kubaj stvx 23,11,1 1402*3a608692SPiotr Kubaj addi 11,11,32 1403*3a608692SPiotr Kubaj stvx 24,10,1 1404*3a608692SPiotr Kubaj addi 10,10,32 1405*3a608692SPiotr Kubaj stvx 25,11,1 1406*3a608692SPiotr Kubaj addi 11,11,32 1407*3a608692SPiotr Kubaj stvx 26,10,1 1408*3a608692SPiotr Kubaj addi 10,10,32 1409*3a608692SPiotr Kubaj stvx 27,11,1 1410*3a608692SPiotr Kubaj addi 11,11,32 1411*3a608692SPiotr Kubaj stvx 28,10,1 1412*3a608692SPiotr Kubaj addi 10,10,32 1413*3a608692SPiotr Kubaj stvx 29,11,1 1414*3a608692SPiotr Kubaj addi 11,11,32 1415*3a608692SPiotr Kubaj stvx 30,10,1 1416*3a608692SPiotr Kubaj stvx 31,11,1 1417*3a608692SPiotr Kubaj stw 6,228(1) 1418*3a608692SPiotr Kubaj li 7, -1 1419*3a608692SPiotr Kubaj stw 0, 236(1) 1420*3a608692SPiotr Kubaj mtspr 256,7 1421*3a608692SPiotr Kubaj 1422*3a608692SPiotr Kubaj srwi 9, 4, 5 1423*3a608692SPiotr Kubaj addi 9, 9, 6 1424*3a608692SPiotr Kubaj stw 9, 240(5) 1425*3a608692SPiotr Kubaj 1426*3a608692SPiotr Kubaj slwi 9, 9, 4 1427*3a608692SPiotr Kubaj add 5, 5, 9 1428*3a608692SPiotr Kubaj 1429*3a608692SPiotr Kubaj cmplwi 1, 4, 0 1430*3a608692SPiotr Kubaj srwi 8, 4, 1 1431*3a608692SPiotr Kubaj andi. 8, 8, 32 1432*3a608692SPiotr Kubaj xori 8, 8, 32 1433*3a608692SPiotr Kubaj bl _vpaes_schedule_core 1434*3a608692SPiotr Kubaj 1435*3a608692SPiotr Kubaj lwz 0, 236(1) 1436*3a608692SPiotr Kubaj li 10,39 1437*3a608692SPiotr Kubaj li 11,55 1438*3a608692SPiotr Kubaj mtspr 256,6 1439*3a608692SPiotr Kubaj mtlr 0 1440*3a608692SPiotr Kubaj xor 3, 3, 3 1441*3a608692SPiotr Kubaj lvx 20,10,1 1442*3a608692SPiotr Kubaj addi 10,10,32 1443*3a608692SPiotr Kubaj lvx 21,11,1 1444*3a608692SPiotr Kubaj addi 11,11,32 1445*3a608692SPiotr Kubaj lvx 22,10,1 1446*3a608692SPiotr Kubaj addi 10,10,32 1447*3a608692SPiotr Kubaj lvx 23,11,1 1448*3a608692SPiotr Kubaj addi 11,11,32 1449*3a608692SPiotr Kubaj lvx 24,10,1 1450*3a608692SPiotr Kubaj addi 10,10,32 1451*3a608692SPiotr Kubaj lvx 25,11,1 1452*3a608692SPiotr Kubaj addi 11,11,32 1453*3a608692SPiotr Kubaj lvx 26,10,1 1454*3a608692SPiotr Kubaj addi 10,10,32 1455*3a608692SPiotr Kubaj lvx 27,11,1 1456*3a608692SPiotr Kubaj addi 11,11,32 1457*3a608692SPiotr Kubaj lvx 28,10,1 1458*3a608692SPiotr Kubaj addi 10,10,32 1459*3a608692SPiotr Kubaj lvx 29,11,1 1460*3a608692SPiotr Kubaj addi 11,11,32 1461*3a608692SPiotr Kubaj lvx 30,10,1 1462*3a608692SPiotr Kubaj lvx 31,11,1 1463*3a608692SPiotr Kubaj addi 1,1,232 1464*3a608692SPiotr Kubaj blr 1465*3a608692SPiotr Kubaj.long 0 1466*3a608692SPiotr Kubaj.byte 0,12,0x04,1,0x80,0,3,0 1467*3a608692SPiotr Kubaj.long 0 1468*3a608692SPiotr Kubaj.size vpaes_set_decrypt_key,.-vpaes_set_decrypt_key 1469