1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #include <linux/linkage.h> 2 #include <linux/linkage.h> 3 #include <asm/visasm.h> 3 #include <asm/visasm.h> 4 4 5 #include "opcodes.h" 5 #include "opcodes.h" 6 6 7 .align 32 7 .align 32 8 ENTRY(des_sparc64_key_expand) 8 ENTRY(des_sparc64_key_expand) 9 /* %o0=input_key, %o1=output_key */ 9 /* %o0=input_key, %o1=output_key */ 10 VISEntryHalf 10 VISEntryHalf 11 ld [%o0 + 0x00], %f0 11 ld [%o0 + 0x00], %f0 12 ld [%o0 + 0x04], %f1 12 ld [%o0 + 0x04], %f1 13 DES_KEXPAND(0, 0, 0) 13 DES_KEXPAND(0, 0, 0) 14 DES_KEXPAND(0, 1, 2) 14 DES_KEXPAND(0, 1, 2) 15 DES_KEXPAND(2, 3, 6) 15 DES_KEXPAND(2, 3, 6) 16 DES_KEXPAND(2, 2, 4) 16 DES_KEXPAND(2, 2, 4) 17 DES_KEXPAND(6, 3, 10) 17 DES_KEXPAND(6, 3, 10) 18 DES_KEXPAND(6, 2, 8) 18 DES_KEXPAND(6, 2, 8) 19 DES_KEXPAND(10, 3, 14) 19 DES_KEXPAND(10, 3, 14) 20 DES_KEXPAND(10, 2, 12) 20 DES_KEXPAND(10, 2, 12) 21 DES_KEXPAND(14, 1, 16) 21 DES_KEXPAND(14, 1, 16) 22 DES_KEXPAND(16, 3, 20) 22 DES_KEXPAND(16, 3, 20) 23 DES_KEXPAND(16, 2, 18) 23 DES_KEXPAND(16, 2, 18) 24 DES_KEXPAND(20, 3, 24) 24 DES_KEXPAND(20, 3, 24) 25 DES_KEXPAND(20, 2, 22) 25 DES_KEXPAND(20, 2, 22) 26 DES_KEXPAND(24, 3, 28) 26 DES_KEXPAND(24, 3, 28) 27 DES_KEXPAND(24, 2, 26) 27 DES_KEXPAND(24, 2, 26) 28 DES_KEXPAND(28, 1, 30) 28 DES_KEXPAND(28, 1, 30) 29 std %f0, [%o1 + 0x00] 29 std %f0, [%o1 + 0x00] 30 std %f2, [%o1 + 0x08] 30 std %f2, [%o1 + 0x08] 31 std %f4, [%o1 + 0x10] 31 std %f4, [%o1 + 0x10] 32 std %f6, [%o1 + 0x18] 32 std %f6, [%o1 + 0x18] 33 std %f8, [%o1 + 0x20] 33 std %f8, [%o1 + 0x20] 34 std %f10, [%o1 + 0x28] 34 std %f10, [%o1 + 0x28] 35 std %f12, [%o1 + 0x30] 35 std %f12, [%o1 + 0x30] 36 std %f14, [%o1 + 0x38] 36 std %f14, [%o1 + 0x38] 37 std %f16, [%o1 + 0x40] 37 std %f16, [%o1 + 0x40] 38 std %f18, [%o1 + 0x48] 38 std %f18, [%o1 + 0x48] 39 std %f20, [%o1 + 0x50] 39 std %f20, [%o1 + 0x50] 40 std %f22, [%o1 + 0x58] 40 std %f22, [%o1 + 0x58] 41 std %f24, [%o1 + 0x60] 41 std %f24, [%o1 + 0x60] 42 std %f26, [%o1 + 0x68] 42 std %f26, [%o1 + 0x68] 43 std %f28, [%o1 + 0x70] 43 std %f28, [%o1 + 0x70] 44 std %f30, [%o1 + 0x78] 44 std %f30, [%o1 + 0x78] 45 retl 45 retl 46 VISExitHalf 46 VISExitHalf 47 ENDPROC(des_sparc64_key_expand) 47 ENDPROC(des_sparc64_key_expand) 48 48 49 .align 32 49 .align 32 50 ENTRY(des_sparc64_crypt) 50 ENTRY(des_sparc64_crypt) 51 /* %o0=key, %o1=input, %o2=output */ 51 /* %o0=key, %o1=input, %o2=output */ 52 VISEntry 52 VISEntry 53 ldd [%o1 + 0x00], %f32 53 ldd [%o1 + 0x00], %f32 54 ldd [%o0 + 0x00], %f0 54 ldd [%o0 + 0x00], %f0 55 ldd [%o0 + 0x08], %f2 55 ldd [%o0 + 0x08], %f2 56 ldd [%o0 + 0x10], %f4 56 ldd [%o0 + 0x10], %f4 57 ldd [%o0 + 0x18], %f6 57 ldd [%o0 + 0x18], %f6 58 ldd [%o0 + 0x20], %f8 58 ldd [%o0 + 0x20], %f8 59 ldd [%o0 + 0x28], %f10 59 ldd [%o0 + 0x28], %f10 60 ldd [%o0 + 0x30], %f12 60 ldd [%o0 + 0x30], %f12 61 ldd [%o0 + 0x38], %f14 61 ldd [%o0 + 0x38], %f14 62 ldd [%o0 + 0x40], %f16 62 ldd [%o0 + 0x40], %f16 63 ldd [%o0 + 0x48], %f18 63 ldd [%o0 + 0x48], %f18 64 ldd [%o0 + 0x50], %f20 64 ldd [%o0 + 0x50], %f20 65 ldd [%o0 + 0x58], %f22 65 ldd [%o0 + 0x58], %f22 66 ldd [%o0 + 0x60], %f24 66 ldd [%o0 + 0x60], %f24 67 ldd [%o0 + 0x68], %f26 67 ldd [%o0 + 0x68], %f26 68 ldd [%o0 + 0x70], %f28 68 ldd [%o0 + 0x70], %f28 69 ldd [%o0 + 0x78], %f30 69 ldd [%o0 + 0x78], %f30 70 DES_IP(32, 32) 70 DES_IP(32, 32) 71 DES_ROUND(0, 2, 32, 32) 71 DES_ROUND(0, 2, 32, 32) 72 DES_ROUND(4, 6, 32, 32) 72 DES_ROUND(4, 6, 32, 32) 73 DES_ROUND(8, 10, 32, 32) 73 DES_ROUND(8, 10, 32, 32) 74 DES_ROUND(12, 14, 32, 32) 74 DES_ROUND(12, 14, 32, 32) 75 DES_ROUND(16, 18, 32, 32) 75 DES_ROUND(16, 18, 32, 32) 76 DES_ROUND(20, 22, 32, 32) 76 DES_ROUND(20, 22, 32, 32) 77 DES_ROUND(24, 26, 32, 32) 77 DES_ROUND(24, 26, 32, 32) 78 DES_ROUND(28, 30, 32, 32) 78 DES_ROUND(28, 30, 32, 32) 79 DES_IIP(32, 32) 79 DES_IIP(32, 32) 80 std %f32, [%o2 + 0x00] 80 std %f32, [%o2 + 0x00] 81 retl 81 retl 82 VISExit 82 VISExit 83 ENDPROC(des_sparc64_crypt) 83 ENDPROC(des_sparc64_crypt) 84 84 85 .align 32 85 .align 32 86 ENTRY(des_sparc64_load_keys) 86 ENTRY(des_sparc64_load_keys) 87 /* %o0=key */ 87 /* %o0=key */ 88 VISEntry 88 VISEntry 89 ldd [%o0 + 0x00], %f0 89 ldd [%o0 + 0x00], %f0 90 ldd [%o0 + 0x08], %f2 90 ldd [%o0 + 0x08], %f2 91 ldd [%o0 + 0x10], %f4 91 ldd [%o0 + 0x10], %f4 92 ldd [%o0 + 0x18], %f6 92 ldd [%o0 + 0x18], %f6 93 ldd [%o0 + 0x20], %f8 93 ldd [%o0 + 0x20], %f8 94 ldd [%o0 + 0x28], %f10 94 ldd [%o0 + 0x28], %f10 95 ldd [%o0 + 0x30], %f12 95 ldd [%o0 + 0x30], %f12 96 ldd [%o0 + 0x38], %f14 96 ldd [%o0 + 0x38], %f14 97 ldd [%o0 + 0x40], %f16 97 ldd [%o0 + 0x40], %f16 98 ldd [%o0 + 0x48], %f18 98 ldd [%o0 + 0x48], %f18 99 ldd [%o0 + 0x50], %f20 99 ldd [%o0 + 0x50], %f20 100 ldd [%o0 + 0x58], %f22 100 ldd [%o0 + 0x58], %f22 101 ldd [%o0 + 0x60], %f24 101 ldd [%o0 + 0x60], %f24 102 ldd [%o0 + 0x68], %f26 102 ldd [%o0 + 0x68], %f26 103 ldd [%o0 + 0x70], %f28 103 ldd [%o0 + 0x70], %f28 104 retl 104 retl 105 ldd [%o0 + 0x78], %f30 105 ldd [%o0 + 0x78], %f30 106 ENDPROC(des_sparc64_load_keys) 106 ENDPROC(des_sparc64_load_keys) 107 107 108 .align 32 108 .align 32 109 ENTRY(des_sparc64_ecb_crypt) 109 ENTRY(des_sparc64_ecb_crypt) 110 /* %o0=input, %o1=output, %o2=len */ 110 /* %o0=input, %o1=output, %o2=len */ 111 1: ldd [%o0 + 0x00], %f32 111 1: ldd [%o0 + 0x00], %f32 112 add %o0, 0x08, %o0 112 add %o0, 0x08, %o0 113 DES_IP(32, 32) 113 DES_IP(32, 32) 114 DES_ROUND(0, 2, 32, 32) 114 DES_ROUND(0, 2, 32, 32) 115 DES_ROUND(4, 6, 32, 32) 115 DES_ROUND(4, 6, 32, 32) 116 DES_ROUND(8, 10, 32, 32) 116 DES_ROUND(8, 10, 32, 32) 117 DES_ROUND(12, 14, 32, 32) 117 DES_ROUND(12, 14, 32, 32) 118 DES_ROUND(16, 18, 32, 32) 118 DES_ROUND(16, 18, 32, 32) 119 DES_ROUND(20, 22, 32, 32) 119 DES_ROUND(20, 22, 32, 32) 120 DES_ROUND(24, 26, 32, 32) 120 DES_ROUND(24, 26, 32, 32) 121 DES_ROUND(28, 30, 32, 32) 121 DES_ROUND(28, 30, 32, 32) 122 DES_IIP(32, 32) 122 DES_IIP(32, 32) 123 std %f32, [%o1 + 0x00] 123 std %f32, [%o1 + 0x00] 124 subcc %o2, 0x08, %o2 124 subcc %o2, 0x08, %o2 125 bne,pt %icc, 1b 125 bne,pt %icc, 1b 126 add %o1, 0x08, %o1 126 add %o1, 0x08, %o1 127 retl 127 retl 128 nop 128 nop 129 ENDPROC(des_sparc64_ecb_crypt) 129 ENDPROC(des_sparc64_ecb_crypt) 130 130 131 .align 32 131 .align 32 132 ENTRY(des_sparc64_cbc_encrypt) 132 ENTRY(des_sparc64_cbc_encrypt) 133 /* %o0=input, %o1=output, %o2=len, %o3 133 /* %o0=input, %o1=output, %o2=len, %o3=IV */ 134 ldd [%o3 + 0x00], %f32 134 ldd [%o3 + 0x00], %f32 135 1: ldd [%o0 + 0x00], %f34 135 1: ldd [%o0 + 0x00], %f34 136 fxor %f32, %f34, %f32 136 fxor %f32, %f34, %f32 137 DES_IP(32, 32) 137 DES_IP(32, 32) 138 DES_ROUND(0, 2, 32, 32) 138 DES_ROUND(0, 2, 32, 32) 139 DES_ROUND(4, 6, 32, 32) 139 DES_ROUND(4, 6, 32, 32) 140 DES_ROUND(8, 10, 32, 32) 140 DES_ROUND(8, 10, 32, 32) 141 DES_ROUND(12, 14, 32, 32) 141 DES_ROUND(12, 14, 32, 32) 142 DES_ROUND(16, 18, 32, 32) 142 DES_ROUND(16, 18, 32, 32) 143 DES_ROUND(20, 22, 32, 32) 143 DES_ROUND(20, 22, 32, 32) 144 DES_ROUND(24, 26, 32, 32) 144 DES_ROUND(24, 26, 32, 32) 145 DES_ROUND(28, 30, 32, 32) 145 DES_ROUND(28, 30, 32, 32) 146 DES_IIP(32, 32) 146 DES_IIP(32, 32) 147 std %f32, [%o1 + 0x00] 147 std %f32, [%o1 + 0x00] 148 add %o0, 0x08, %o0 148 add %o0, 0x08, %o0 149 subcc %o2, 0x08, %o2 149 subcc %o2, 0x08, %o2 150 bne,pt %icc, 1b 150 bne,pt %icc, 1b 151 add %o1, 0x08, %o1 151 add %o1, 0x08, %o1 152 retl 152 retl 153 std %f32, [%o3 + 0x00] 153 std %f32, [%o3 + 0x00] 154 ENDPROC(des_sparc64_cbc_encrypt) 154 ENDPROC(des_sparc64_cbc_encrypt) 155 155 156 .align 32 156 .align 32 157 ENTRY(des_sparc64_cbc_decrypt) 157 ENTRY(des_sparc64_cbc_decrypt) 158 /* %o0=input, %o1=output, %o2=len, %o3 158 /* %o0=input, %o1=output, %o2=len, %o3=IV */ 159 ldd [%o3 + 0x00], %f34 159 ldd [%o3 + 0x00], %f34 160 1: ldd [%o0 + 0x00], %f36 160 1: ldd [%o0 + 0x00], %f36 161 DES_IP(36, 32) 161 DES_IP(36, 32) 162 DES_ROUND(0, 2, 32, 32) 162 DES_ROUND(0, 2, 32, 32) 163 DES_ROUND(4, 6, 32, 32) 163 DES_ROUND(4, 6, 32, 32) 164 DES_ROUND(8, 10, 32, 32) 164 DES_ROUND(8, 10, 32, 32) 165 DES_ROUND(12, 14, 32, 32) 165 DES_ROUND(12, 14, 32, 32) 166 DES_ROUND(16, 18, 32, 32) 166 DES_ROUND(16, 18, 32, 32) 167 DES_ROUND(20, 22, 32, 32) 167 DES_ROUND(20, 22, 32, 32) 168 DES_ROUND(24, 26, 32, 32) 168 DES_ROUND(24, 26, 32, 32) 169 DES_ROUND(28, 30, 32, 32) 169 DES_ROUND(28, 30, 32, 32) 170 DES_IIP(32, 32) 170 DES_IIP(32, 32) 171 fxor %f32, %f34, %f32 171 fxor %f32, %f34, %f32 172 fsrc2 %f36, %f34 172 fsrc2 %f36, %f34 173 std %f32, [%o1 + 0x00] 173 std %f32, [%o1 + 0x00] 174 add %o0, 0x08, %o0 174 add %o0, 0x08, %o0 175 subcc %o2, 0x08, %o2 175 subcc %o2, 0x08, %o2 176 bne,pt %icc, 1b 176 bne,pt %icc, 1b 177 add %o1, 0x08, %o1 177 add %o1, 0x08, %o1 178 retl 178 retl 179 std %f36, [%o3 + 0x00] 179 std %f36, [%o3 + 0x00] 180 ENDPROC(des_sparc64_cbc_decrypt) 180 ENDPROC(des_sparc64_cbc_decrypt) 181 181 182 .align 32 182 .align 32 183 ENTRY(des3_ede_sparc64_crypt) 183 ENTRY(des3_ede_sparc64_crypt) 184 /* %o0=key, %o1=input, %o2=output */ 184 /* %o0=key, %o1=input, %o2=output */ 185 VISEntry 185 VISEntry 186 ldd [%o1 + 0x00], %f32 186 ldd [%o1 + 0x00], %f32 187 ldd [%o0 + 0x00], %f0 187 ldd [%o0 + 0x00], %f0 188 ldd [%o0 + 0x08], %f2 188 ldd [%o0 + 0x08], %f2 189 ldd [%o0 + 0x10], %f4 189 ldd [%o0 + 0x10], %f4 190 ldd [%o0 + 0x18], %f6 190 ldd [%o0 + 0x18], %f6 191 ldd [%o0 + 0x20], %f8 191 ldd [%o0 + 0x20], %f8 192 ldd [%o0 + 0x28], %f10 192 ldd [%o0 + 0x28], %f10 193 ldd [%o0 + 0x30], %f12 193 ldd [%o0 + 0x30], %f12 194 ldd [%o0 + 0x38], %f14 194 ldd [%o0 + 0x38], %f14 195 ldd [%o0 + 0x40], %f16 195 ldd [%o0 + 0x40], %f16 196 ldd [%o0 + 0x48], %f18 196 ldd [%o0 + 0x48], %f18 197 ldd [%o0 + 0x50], %f20 197 ldd [%o0 + 0x50], %f20 198 ldd [%o0 + 0x58], %f22 198 ldd [%o0 + 0x58], %f22 199 ldd [%o0 + 0x60], %f24 199 ldd [%o0 + 0x60], %f24 200 ldd [%o0 + 0x68], %f26 200 ldd [%o0 + 0x68], %f26 201 ldd [%o0 + 0x70], %f28 201 ldd [%o0 + 0x70], %f28 202 ldd [%o0 + 0x78], %f30 202 ldd [%o0 + 0x78], %f30 203 DES_IP(32, 32) 203 DES_IP(32, 32) 204 DES_ROUND(0, 2, 32, 32) 204 DES_ROUND(0, 2, 32, 32) 205 ldd [%o0 + 0x80], %f0 205 ldd [%o0 + 0x80], %f0 206 ldd [%o0 + 0x88], %f2 206 ldd [%o0 + 0x88], %f2 207 DES_ROUND(4, 6, 32, 32) 207 DES_ROUND(4, 6, 32, 32) 208 ldd [%o0 + 0x90], %f4 208 ldd [%o0 + 0x90], %f4 209 ldd [%o0 + 0x98], %f6 209 ldd [%o0 + 0x98], %f6 210 DES_ROUND(8, 10, 32, 32) 210 DES_ROUND(8, 10, 32, 32) 211 ldd [%o0 + 0xa0], %f8 211 ldd [%o0 + 0xa0], %f8 212 ldd [%o0 + 0xa8], %f10 212 ldd [%o0 + 0xa8], %f10 213 DES_ROUND(12, 14, 32, 32) 213 DES_ROUND(12, 14, 32, 32) 214 ldd [%o0 + 0xb0], %f12 214 ldd [%o0 + 0xb0], %f12 215 ldd [%o0 + 0xb8], %f14 215 ldd [%o0 + 0xb8], %f14 216 DES_ROUND(16, 18, 32, 32) 216 DES_ROUND(16, 18, 32, 32) 217 ldd [%o0 + 0xc0], %f16 217 ldd [%o0 + 0xc0], %f16 218 ldd [%o0 + 0xc8], %f18 218 ldd [%o0 + 0xc8], %f18 219 DES_ROUND(20, 22, 32, 32) 219 DES_ROUND(20, 22, 32, 32) 220 ldd [%o0 + 0xd0], %f20 220 ldd [%o0 + 0xd0], %f20 221 ldd [%o0 + 0xd8], %f22 221 ldd [%o0 + 0xd8], %f22 222 DES_ROUND(24, 26, 32, 32) 222 DES_ROUND(24, 26, 32, 32) 223 ldd [%o0 + 0xe0], %f24 223 ldd [%o0 + 0xe0], %f24 224 ldd [%o0 + 0xe8], %f26 224 ldd [%o0 + 0xe8], %f26 225 DES_ROUND(28, 30, 32, 32) 225 DES_ROUND(28, 30, 32, 32) 226 ldd [%o0 + 0xf0], %f28 226 ldd [%o0 + 0xf0], %f28 227 ldd [%o0 + 0xf8], %f30 227 ldd [%o0 + 0xf8], %f30 228 DES_IIP(32, 32) 228 DES_IIP(32, 32) 229 DES_IP(32, 32) 229 DES_IP(32, 32) 230 DES_ROUND(0, 2, 32, 32) 230 DES_ROUND(0, 2, 32, 32) 231 ldd [%o0 + 0x100], %f0 231 ldd [%o0 + 0x100], %f0 232 ldd [%o0 + 0x108], %f2 232 ldd [%o0 + 0x108], %f2 233 DES_ROUND(4, 6, 32, 32) 233 DES_ROUND(4, 6, 32, 32) 234 ldd [%o0 + 0x110], %f4 234 ldd [%o0 + 0x110], %f4 235 ldd [%o0 + 0x118], %f6 235 ldd [%o0 + 0x118], %f6 236 DES_ROUND(8, 10, 32, 32) 236 DES_ROUND(8, 10, 32, 32) 237 ldd [%o0 + 0x120], %f8 237 ldd [%o0 + 0x120], %f8 238 ldd [%o0 + 0x128], %f10 238 ldd [%o0 + 0x128], %f10 239 DES_ROUND(12, 14, 32, 32) 239 DES_ROUND(12, 14, 32, 32) 240 ldd [%o0 + 0x130], %f12 240 ldd [%o0 + 0x130], %f12 241 ldd [%o0 + 0x138], %f14 241 ldd [%o0 + 0x138], %f14 242 DES_ROUND(16, 18, 32, 32) 242 DES_ROUND(16, 18, 32, 32) 243 ldd [%o0 + 0x140], %f16 243 ldd [%o0 + 0x140], %f16 244 ldd [%o0 + 0x148], %f18 244 ldd [%o0 + 0x148], %f18 245 DES_ROUND(20, 22, 32, 32) 245 DES_ROUND(20, 22, 32, 32) 246 ldd [%o0 + 0x150], %f20 246 ldd [%o0 + 0x150], %f20 247 ldd [%o0 + 0x158], %f22 247 ldd [%o0 + 0x158], %f22 248 DES_ROUND(24, 26, 32, 32) 248 DES_ROUND(24, 26, 32, 32) 249 ldd [%o0 + 0x160], %f24 249 ldd [%o0 + 0x160], %f24 250 ldd [%o0 + 0x168], %f26 250 ldd [%o0 + 0x168], %f26 251 DES_ROUND(28, 30, 32, 32) 251 DES_ROUND(28, 30, 32, 32) 252 ldd [%o0 + 0x170], %f28 252 ldd [%o0 + 0x170], %f28 253 ldd [%o0 + 0x178], %f30 253 ldd [%o0 + 0x178], %f30 254 DES_IIP(32, 32) 254 DES_IIP(32, 32) 255 DES_IP(32, 32) 255 DES_IP(32, 32) 256 DES_ROUND(0, 2, 32, 32) 256 DES_ROUND(0, 2, 32, 32) 257 DES_ROUND(4, 6, 32, 32) 257 DES_ROUND(4, 6, 32, 32) 258 DES_ROUND(8, 10, 32, 32) 258 DES_ROUND(8, 10, 32, 32) 259 DES_ROUND(12, 14, 32, 32) 259 DES_ROUND(12, 14, 32, 32) 260 DES_ROUND(16, 18, 32, 32) 260 DES_ROUND(16, 18, 32, 32) 261 DES_ROUND(20, 22, 32, 32) 261 DES_ROUND(20, 22, 32, 32) 262 DES_ROUND(24, 26, 32, 32) 262 DES_ROUND(24, 26, 32, 32) 263 DES_ROUND(28, 30, 32, 32) 263 DES_ROUND(28, 30, 32, 32) 264 DES_IIP(32, 32) 264 DES_IIP(32, 32) 265 265 266 std %f32, [%o2 + 0x00] 266 std %f32, [%o2 + 0x00] 267 retl 267 retl 268 VISExit 268 VISExit 269 ENDPROC(des3_ede_sparc64_crypt) 269 ENDPROC(des3_ede_sparc64_crypt) 270 270 271 .align 32 271 .align 32 272 ENTRY(des3_ede_sparc64_load_keys) 272 ENTRY(des3_ede_sparc64_load_keys) 273 /* %o0=key */ 273 /* %o0=key */ 274 VISEntry 274 VISEntry 275 ldd [%o0 + 0x00], %f0 275 ldd [%o0 + 0x00], %f0 276 ldd [%o0 + 0x08], %f2 276 ldd [%o0 + 0x08], %f2 277 ldd [%o0 + 0x10], %f4 277 ldd [%o0 + 0x10], %f4 278 ldd [%o0 + 0x18], %f6 278 ldd [%o0 + 0x18], %f6 279 ldd [%o0 + 0x20], %f8 279 ldd [%o0 + 0x20], %f8 280 ldd [%o0 + 0x28], %f10 280 ldd [%o0 + 0x28], %f10 281 ldd [%o0 + 0x30], %f12 281 ldd [%o0 + 0x30], %f12 282 ldd [%o0 + 0x38], %f14 282 ldd [%o0 + 0x38], %f14 283 ldd [%o0 + 0x40], %f16 283 ldd [%o0 + 0x40], %f16 284 ldd [%o0 + 0x48], %f18 284 ldd [%o0 + 0x48], %f18 285 ldd [%o0 + 0x50], %f20 285 ldd [%o0 + 0x50], %f20 286 ldd [%o0 + 0x58], %f22 286 ldd [%o0 + 0x58], %f22 287 ldd [%o0 + 0x60], %f24 287 ldd [%o0 + 0x60], %f24 288 ldd [%o0 + 0x68], %f26 288 ldd [%o0 + 0x68], %f26 289 ldd [%o0 + 0x70], %f28 289 ldd [%o0 + 0x70], %f28 290 ldd [%o0 + 0x78], %f30 290 ldd [%o0 + 0x78], %f30 291 ldd [%o0 + 0x80], %f32 291 ldd [%o0 + 0x80], %f32 292 ldd [%o0 + 0x88], %f34 292 ldd [%o0 + 0x88], %f34 293 ldd [%o0 + 0x90], %f36 293 ldd [%o0 + 0x90], %f36 294 ldd [%o0 + 0x98], %f38 294 ldd [%o0 + 0x98], %f38 295 ldd [%o0 + 0xa0], %f40 295 ldd [%o0 + 0xa0], %f40 296 ldd [%o0 + 0xa8], %f42 296 ldd [%o0 + 0xa8], %f42 297 ldd [%o0 + 0xb0], %f44 297 ldd [%o0 + 0xb0], %f44 298 ldd [%o0 + 0xb8], %f46 298 ldd [%o0 + 0xb8], %f46 299 ldd [%o0 + 0xc0], %f48 299 ldd [%o0 + 0xc0], %f48 300 ldd [%o0 + 0xc8], %f50 300 ldd [%o0 + 0xc8], %f50 301 ldd [%o0 + 0xd0], %f52 301 ldd [%o0 + 0xd0], %f52 302 ldd [%o0 + 0xd8], %f54 302 ldd [%o0 + 0xd8], %f54 303 ldd [%o0 + 0xe0], %f56 303 ldd [%o0 + 0xe0], %f56 304 retl 304 retl 305 ldd [%o0 + 0xe8], %f58 305 ldd [%o0 + 0xe8], %f58 306 ENDPROC(des3_ede_sparc64_load_keys) 306 ENDPROC(des3_ede_sparc64_load_keys) 307 307 308 #define DES3_LOOP_BODY(X) \ 308 #define DES3_LOOP_BODY(X) \ 309 DES_IP(X, X) \ 309 DES_IP(X, X) \ 310 DES_ROUND(0, 2, X, X) \ 310 DES_ROUND(0, 2, X, X) \ 311 DES_ROUND(4, 6, X, X) \ 311 DES_ROUND(4, 6, X, X) \ 312 DES_ROUND(8, 10, X, X) \ 312 DES_ROUND(8, 10, X, X) \ 313 DES_ROUND(12, 14, X, X) \ 313 DES_ROUND(12, 14, X, X) \ 314 DES_ROUND(16, 18, X, X) \ 314 DES_ROUND(16, 18, X, X) \ 315 ldd [%o0 + 0xf0], %f16; \ 315 ldd [%o0 + 0xf0], %f16; \ 316 ldd [%o0 + 0xf8], %f18; \ 316 ldd [%o0 + 0xf8], %f18; \ 317 DES_ROUND(20, 22, X, X) \ 317 DES_ROUND(20, 22, X, X) \ 318 ldd [%o0 + 0x100], %f20; \ 318 ldd [%o0 + 0x100], %f20; \ 319 ldd [%o0 + 0x108], %f22; \ 319 ldd [%o0 + 0x108], %f22; \ 320 DES_ROUND(24, 26, X, X) \ 320 DES_ROUND(24, 26, X, X) \ 321 ldd [%o0 + 0x110], %f24; \ 321 ldd [%o0 + 0x110], %f24; \ 322 ldd [%o0 + 0x118], %f26; \ 322 ldd [%o0 + 0x118], %f26; \ 323 DES_ROUND(28, 30, X, X) \ 323 DES_ROUND(28, 30, X, X) \ 324 ldd [%o0 + 0x120], %f28; \ 324 ldd [%o0 + 0x120], %f28; \ 325 ldd [%o0 + 0x128], %f30; \ 325 ldd [%o0 + 0x128], %f30; \ 326 DES_IIP(X, X) \ 326 DES_IIP(X, X) \ 327 DES_IP(X, X) \ 327 DES_IP(X, X) \ 328 DES_ROUND(32, 34, X, X) \ 328 DES_ROUND(32, 34, X, X) \ 329 ldd [%o0 + 0x130], %f0; \ 329 ldd [%o0 + 0x130], %f0; \ 330 ldd [%o0 + 0x138], %f2; \ 330 ldd [%o0 + 0x138], %f2; \ 331 DES_ROUND(36, 38, X, X) \ 331 DES_ROUND(36, 38, X, X) \ 332 ldd [%o0 + 0x140], %f4; \ 332 ldd [%o0 + 0x140], %f4; \ 333 ldd [%o0 + 0x148], %f6; \ 333 ldd [%o0 + 0x148], %f6; \ 334 DES_ROUND(40, 42, X, X) \ 334 DES_ROUND(40, 42, X, X) \ 335 ldd [%o0 + 0x150], %f8; \ 335 ldd [%o0 + 0x150], %f8; \ 336 ldd [%o0 + 0x158], %f10; \ 336 ldd [%o0 + 0x158], %f10; \ 337 DES_ROUND(44, 46, X, X) \ 337 DES_ROUND(44, 46, X, X) \ 338 ldd [%o0 + 0x160], %f12; \ 338 ldd [%o0 + 0x160], %f12; \ 339 ldd [%o0 + 0x168], %f14; \ 339 ldd [%o0 + 0x168], %f14; \ 340 DES_ROUND(48, 50, X, X) \ 340 DES_ROUND(48, 50, X, X) \ 341 DES_ROUND(52, 54, X, X) \ 341 DES_ROUND(52, 54, X, X) \ 342 DES_ROUND(56, 58, X, X) \ 342 DES_ROUND(56, 58, X, X) \ 343 DES_ROUND(16, 18, X, X) \ 343 DES_ROUND(16, 18, X, X) \ 344 ldd [%o0 + 0x170], %f16; \ 344 ldd [%o0 + 0x170], %f16; \ 345 ldd [%o0 + 0x178], %f18; \ 345 ldd [%o0 + 0x178], %f18; \ 346 DES_IIP(X, X) \ 346 DES_IIP(X, X) \ 347 DES_IP(X, X) \ 347 DES_IP(X, X) \ 348 DES_ROUND(20, 22, X, X) \ 348 DES_ROUND(20, 22, X, X) \ 349 ldd [%o0 + 0x50], %f20; \ 349 ldd [%o0 + 0x50], %f20; \ 350 ldd [%o0 + 0x58], %f22; \ 350 ldd [%o0 + 0x58], %f22; \ 351 DES_ROUND(24, 26, X, X) \ 351 DES_ROUND(24, 26, X, X) \ 352 ldd [%o0 + 0x60], %f24; \ 352 ldd [%o0 + 0x60], %f24; \ 353 ldd [%o0 + 0x68], %f26; \ 353 ldd [%o0 + 0x68], %f26; \ 354 DES_ROUND(28, 30, X, X) \ 354 DES_ROUND(28, 30, X, X) \ 355 ldd [%o0 + 0x70], %f28; \ 355 ldd [%o0 + 0x70], %f28; \ 356 ldd [%o0 + 0x78], %f30; \ 356 ldd [%o0 + 0x78], %f30; \ 357 DES_ROUND(0, 2, X, X) \ 357 DES_ROUND(0, 2, X, X) \ 358 ldd [%o0 + 0x00], %f0; \ 358 ldd [%o0 + 0x00], %f0; \ 359 ldd [%o0 + 0x08], %f2; \ 359 ldd [%o0 + 0x08], %f2; \ 360 DES_ROUND(4, 6, X, X) \ 360 DES_ROUND(4, 6, X, X) \ 361 ldd [%o0 + 0x10], %f4; \ 361 ldd [%o0 + 0x10], %f4; \ 362 ldd [%o0 + 0x18], %f6; \ 362 ldd [%o0 + 0x18], %f6; \ 363 DES_ROUND(8, 10, X, X) \ 363 DES_ROUND(8, 10, X, X) \ 364 ldd [%o0 + 0x20], %f8; \ 364 ldd [%o0 + 0x20], %f8; \ 365 ldd [%o0 + 0x28], %f10; \ 365 ldd [%o0 + 0x28], %f10; \ 366 DES_ROUND(12, 14, X, X) \ 366 DES_ROUND(12, 14, X, X) \ 367 ldd [%o0 + 0x30], %f12; \ 367 ldd [%o0 + 0x30], %f12; \ 368 ldd [%o0 + 0x38], %f14; \ 368 ldd [%o0 + 0x38], %f14; \ 369 DES_ROUND(16, 18, X, X) \ 369 DES_ROUND(16, 18, X, X) \ 370 ldd [%o0 + 0x40], %f16; \ 370 ldd [%o0 + 0x40], %f16; \ 371 ldd [%o0 + 0x48], %f18; \ 371 ldd [%o0 + 0x48], %f18; \ 372 DES_IIP(X, X) 372 DES_IIP(X, X) 373 373 374 .align 32 374 .align 32 375 ENTRY(des3_ede_sparc64_ecb_crypt) 375 ENTRY(des3_ede_sparc64_ecb_crypt) 376 /* %o0=key, %o1=input, %o2=output, %o3 376 /* %o0=key, %o1=input, %o2=output, %o3=len */ 377 1: ldd [%o1 + 0x00], %f60 377 1: ldd [%o1 + 0x00], %f60 378 DES3_LOOP_BODY(60) 378 DES3_LOOP_BODY(60) 379 std %f60, [%o2 + 0x00] 379 std %f60, [%o2 + 0x00] 380 add %o1, 0x08, %o1 380 add %o1, 0x08, %o1 381 subcc %o3, 0x08, %o3 381 subcc %o3, 0x08, %o3 382 bne,pt %icc, 1b 382 bne,pt %icc, 1b 383 add %o2, 0x08, %o2 383 add %o2, 0x08, %o2 384 retl 384 retl 385 nop 385 nop 386 ENDPROC(des3_ede_sparc64_ecb_crypt) 386 ENDPROC(des3_ede_sparc64_ecb_crypt) 387 387 388 .align 32 388 .align 32 389 ENTRY(des3_ede_sparc64_cbc_encrypt) 389 ENTRY(des3_ede_sparc64_cbc_encrypt) 390 /* %o0=key, %o1=input, %o2=output, %o3 390 /* %o0=key, %o1=input, %o2=output, %o3=len, %o4=IV */ 391 ldd [%o4 + 0x00], %f60 391 ldd [%o4 + 0x00], %f60 392 1: ldd [%o1 + 0x00], %f62 392 1: ldd [%o1 + 0x00], %f62 393 fxor %f60, %f62, %f60 393 fxor %f60, %f62, %f60 394 DES3_LOOP_BODY(60) 394 DES3_LOOP_BODY(60) 395 std %f60, [%o2 + 0x00] 395 std %f60, [%o2 + 0x00] 396 add %o1, 0x08, %o1 396 add %o1, 0x08, %o1 397 subcc %o3, 0x08, %o3 397 subcc %o3, 0x08, %o3 398 bne,pt %icc, 1b 398 bne,pt %icc, 1b 399 add %o2, 0x08, %o2 399 add %o2, 0x08, %o2 400 retl 400 retl 401 std %f60, [%o4 + 0x00] 401 std %f60, [%o4 + 0x00] 402 ENDPROC(des3_ede_sparc64_cbc_encrypt) 402 ENDPROC(des3_ede_sparc64_cbc_encrypt) 403 403 404 .align 32 404 .align 32 405 ENTRY(des3_ede_sparc64_cbc_decrypt) 405 ENTRY(des3_ede_sparc64_cbc_decrypt) 406 /* %o0=key, %o1=input, %o2=output, %o3 406 /* %o0=key, %o1=input, %o2=output, %o3=len, %o4=IV */ 407 ldd [%o4 + 0x00], %f62 407 ldd [%o4 + 0x00], %f62 408 1: ldx [%o1 + 0x00], %g1 408 1: ldx [%o1 + 0x00], %g1 409 MOVXTOD_G1_F60 409 MOVXTOD_G1_F60 410 DES3_LOOP_BODY(60) 410 DES3_LOOP_BODY(60) 411 fxor %f62, %f60, %f60 411 fxor %f62, %f60, %f60 412 MOVXTOD_G1_F62 412 MOVXTOD_G1_F62 413 std %f60, [%o2 + 0x00] 413 std %f60, [%o2 + 0x00] 414 add %o1, 0x08, %o1 414 add %o1, 0x08, %o1 415 subcc %o3, 0x08, %o3 415 subcc %o3, 0x08, %o3 416 bne,pt %icc, 1b 416 bne,pt %icc, 1b 417 add %o2, 0x08, %o2 417 add %o2, 0x08, %o2 418 retl 418 retl 419 stx %g1, [%o4 + 0x00] 419 stx %g1, [%o4 + 0x00] 420 ENDPROC(des3_ede_sparc64_cbc_decrypt) 420 ENDPROC(des3_ede_sparc64_cbc_decrypt)
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.