Lines Matching +full:in0 +full:- +full:in1
2 # SPDX-License-Identifier: GPL-2.0
12 # Copyright (c) 2006-2017, CRYPTOGAMS by <appro@openssl.org>
58 # The module is endian-agnostic in sense that it supports both big-
59 # and little-endian cases. Data alignment in parallelizable modes is
64 # is aligned programmatically, which in turn guarantees exception-
72 # Add XTS subroutine, 9x on little- and 12x improvement on big-endian
76 # Current large-block performance in cycles per byte processed with
77 # 128-bit key (less is better).
79 # CBC en-/decrypt CTR XTS
106 ( $xlate="${dir}ppc-xlate.pl" and -f $xlate ) or
107 ( $xlate="${dir}../../perlasm/ppc-xlate.pl" and -f $xlate) or
108 die "can't locate ppc-xlate.pl";
121 my ($zero,$in0,$in1,$key,$rcon,$mask,$tmp)=map("v$_",(0..6));
139 addi $ptr,$ptr,-0x48
151 li $ptr,-1
153 beq- Lenc_key_abort # if ($inp==0) return -1;
155 beq- Lenc_key_abort # if ($out==0) return -1;
156 li $ptr,-2
158 blt- Lenc_key_abort
160 bgt- Lenc_key_abort
162 bne- Lenc_key_abort
172 lvx $in0,0,$inp
177 lvx $in1,0,$inp
183 vperm $in0,$in0,$in1,$key # align [and byte swap in LE]
189 vspltisb $outmask,-1
201 vperm $key,$in0,$in0,$mask # rotate-n-splat
202 vsldoi $tmp,$zero,$in0,12 # >>32
203 vperm $outtail,$in0,$in0,$outperm # rotate
210 vxor $in0,$in0,$tmp
212 vxor $in0,$in0,$tmp
214 vxor $in0,$in0,$tmp
216 vxor $in0,$in0,$key
221 vperm $key,$in0,$in0,$mask # rotate-n-splat
222 vsldoi $tmp,$zero,$in0,12 # >>32
223 vperm $outtail,$in0,$in0,$outperm # rotate
230 vxor $in0,$in0,$tmp
232 vxor $in0,$in0,$tmp
234 vxor $in0,$in0,$tmp
236 vxor $in0,$in0,$key
238 vperm $key,$in0,$in0,$mask # rotate-n-splat
239 vsldoi $tmp,$zero,$in0,12 # >>32
240 vperm $outtail,$in0,$in0,$outperm # rotate
247 vxor $in0,$in0,$tmp
249 vxor $in0,$in0,$tmp
251 vxor $in0,$in0,$tmp
252 vxor $in0,$in0,$key
253 vperm $outtail,$in0,$in0,$outperm # rotate
268 vperm $outtail,$in0,$in0,$outperm # rotate
273 vperm $in1,$in1,$tmp,$key # align [and byte swap in LE]
279 vperm $key,$in1,$in1,$mask # roate-n-splat
280 vsldoi $tmp,$zero,$in0,12 # >>32
283 vxor $in0,$in0,$tmp
285 vxor $in0,$in0,$tmp
287 vxor $in0,$in0,$tmp
289 vsldoi $stage,$zero,$in1,8
290 vspltw $tmp,$in0,3
291 vxor $tmp,$tmp,$in1
292 vsldoi $in1,$zero,$in1,12 # >>32
294 vxor $in1,$in1,$tmp
295 vxor $in0,$in0,$key
296 vxor $in1,$in1,$key
297 vsldoi $stage,$stage,$in0,8
299 vperm $key,$in1,$in1,$mask # rotate-n-splat
300 vsldoi $tmp,$zero,$in0,12 # >>32
308 vsldoi $stage,$in0,$in1,8
309 vxor $in0,$in0,$tmp
314 vxor $in0,$in0,$tmp
316 vxor $in0,$in0,$tmp
320 vspltw $tmp,$in0,3
321 vxor $tmp,$tmp,$in1
322 vsldoi $in1,$zero,$in1,12 # >>32
324 vxor $in1,$in1,$tmp
325 vxor $in0,$in0,$key
326 vxor $in1,$in1,$key
327 vperm $outtail,$in0,$in0,$outperm # rotate
344 vperm $outtail,$in0,$in0,$outperm # rotate
349 vperm $in1,$in1,$tmp,$key # align [and byte swap in LE]
353 vperm $key,$in1,$in1,$mask # rotate-n-splat
354 vsldoi $tmp,$zero,$in0,12 # >>32
355 vperm $outtail,$in1,$in1,$outperm # rotate
362 vxor $in0,$in0,$tmp
364 vxor $in0,$in0,$tmp
366 vxor $in0,$in0,$tmp
368 vxor $in0,$in0,$key
369 vperm $outtail,$in0,$in0,$outperm # rotate
377 vspltw $key,$in0,3 # just splat
378 vsldoi $tmp,$zero,$in1,12 # >>32
381 vxor $in1,$in1,$tmp
383 vxor $in1,$in1,$tmp
385 vxor $in1,$in1,$tmp
387 vxor $in1,$in1,$key
392 lvx $in1,0,$inp # redundant in aligned case
393 vsel $in1,$outhead,$in1,$outmask
394 stvx $in1,0,$inp
405 .size .${prefix}_set_encrypt_key,.-.${prefix}_set_encrypt_key
408 $STU $sp,-$FRAME($sp)
415 bne- Ldec_key_abort
438 stw r9, -16($inp)
439 stw r10,-12($inp)
440 stw r11,-8($inp)
441 stw r12,-4($inp)
451 .size .${prefix}_set_decrypt_key,.-.${prefix}_set_decrypt_key
455 {{{ # Single block en- and decrypt procedures #
508 vspltisb v2,-1
526 .size .${prefix}_${dir}crypt,.-.${prefix}_${dir}crypt
537 # constants table endian-specific conversion
538 if ($consts && m/\.(long|byte)\s+(.+)\s+(\?[a-z]*)$/o) {
542 # convert to endian-agnostic format
552 # little-endian conversion
566 # instructions prefixed with '?' are endian-specific and need
568 if ($flavour =~ /le$/o) { # little-endian
573 s/\?(vperm\s+v[0-9]+,\s*)(v[0-9]+,\s*)(v[0-9]+,\s*)(v[0-9]+)/$1$3$2$4/o or
574 s/\?(vsldoi\s+v[0-9]+,\s*)(v[0-9]+,)\s*(v[0-9]+,\s*)([0-9]+)/$1$3$2 16-$4/o or
575 s/\?(vspltw\s+v[0-9]+,\s*)(v[0-9]+,)\s*([0-9])/$1$2 3-$3/o;
576 } else { # big-endian
579 s/\?([a-z]+)/$1/o;