Lines Matching refs:T
56 @T=("eax","ebx","ecx","edx");
91 my $t0=@T[($j)%4],$t1=@T[($j+1)%4],$t2=@T[($j+2)%4],$t3=@T[($j+3)%4];
158 &mov (@T[0],&DWP(0,$idx)); # load plaintext
159 &mov (@T[1],&DWP(4,$idx));
160 &mov (@T[2],&DWP(8,$idx));
161 &bswap (@T[0]);
162 &mov (@T[3],&DWP(12,$idx));
163 &bswap (@T[1]);
164 &bswap (@T[2]);
165 &bswap (@T[3]);
170 &bswap (@T[0]);
172 &bswap (@T[1]);
173 &bswap (@T[2]);
174 &bswap (@T[3]);
175 &mov (&DWP(0,$idx),@T[0]); # write ciphertext
176 &mov (&DWP(4,$idx),@T[1]);
177 &mov (&DWP(8,$idx),@T[2]);
178 &mov (&DWP(12,$idx),@T[3]);
223 &mov (@T[0],&DWP(0,$idx)); # load plaintext
224 &mov (@T[1],&DWP(4,$idx));
225 &mov (@T[2],&DWP(8,$idx));
226 &bswap (@T[0]);
227 &mov (@T[3],&DWP(12,$idx));
228 &bswap (@T[1]);
229 &bswap (@T[2]);
230 &bswap (@T[3]);
235 &bswap (@T[0]);
237 &bswap (@T[1]);
238 &bswap (@T[2]);
239 &bswap (@T[3]);
240 &mov (&DWP(0,$idx),@T[0]); # write ciphertext
241 &mov (&DWP(4,$idx),@T[1]);
242 &mov (&DWP(8,$idx),@T[2]);
243 &mov (&DWP(12,$idx),@T[3]);
248 &xor (@T[0],&DWP(0,$key)); # ^=key[0-3]
249 &xor (@T[1],&DWP(4,$key));
250 &xor (@T[2],&DWP(8,$key));
251 &xor (@T[3],&DWP(12,$key));
254 &mov ($__s0,@T[0]); # save s[0-3]
255 &mov ($__s1,@T[1]);
256 &mov ($__s2,@T[2]);
257 &mov ($__s3,@T[3]);
267 &and ($idx,@T[0]);
268 &mov (@T[3],$__s3);
270 &mov (@T[2],@T[3]);
271 &xor (@T[1],$idx);
272 &or (@T[2],&DWP(12,$key));
273 &mov ($__s1,@T[1]); # s1^=LeftRotate(s0&key[0],1);
274 &xor (@T[2],$__s2);
277 &mov ($__s2,@T[2]); # s2^=s3|key[3];
278 &or ($idx,@T[1]);
279 &and (@T[2],&DWP(8,$key));
280 &xor (@T[0],$idx);
281 &rotl (@T[2],1);
282 &mov ($__s0,@T[0]); # s0^=s1|key[1];
283 &xor (@T[3],@T[2]);
285 &mov ($__s3,@T[3]); # s3^=LeftRotate(s2&key[2],1);
289 &mov (@T[2],@T[0]); # SwapHalf
290 &mov (@T[3],@T[1]);
291 &mov (@T[0],$__s2);
292 &mov (@T[1],$__s3);
293 &xor (@T[0],$idx); # $idx is preloaded with key[0]
294 &xor (@T[1],&DWP(4,$key));
295 &xor (@T[2],&DWP(8,$key));
296 &xor (@T[3],&DWP(12,$key));
333 &mov (@T[0],&DWP(0,$idx)); # load ciphertext
334 &mov (@T[1],&DWP(4,$idx));
335 &mov (@T[2],&DWP(8,$idx));
336 &bswap (@T[0]);
337 &mov (@T[3],&DWP(12,$idx));
338 &bswap (@T[1]);
339 &bswap (@T[2]);
340 &bswap (@T[3]);
345 &bswap (@T[0]);
347 &bswap (@T[1]);
348 &bswap (@T[2]);
349 &bswap (@T[3]);
350 &mov (&DWP(0,$idx),@T[0]); # write plaintext
351 &mov (&DWP(4,$idx),@T[1]);
352 &mov (&DWP(8,$idx),@T[2]);
353 &mov (&DWP(12,$idx),@T[3]);
398 &mov (@T[0],&DWP(0,$idx)); # load ciphertext
399 &mov (@T[1],&DWP(4,$idx));
400 &mov (@T[2],&DWP(8,$idx));
401 &bswap (@T[0]);
402 &mov (@T[3],&DWP(12,$idx));
403 &bswap (@T[1]);
404 &bswap (@T[2]);
405 &bswap (@T[3]);
410 &bswap (@T[0]);
412 &bswap (@T[1]);
413 &bswap (@T[2]);
414 &bswap (@T[3]);
415 &mov (&DWP(0,$idx),@T[0]); # write plaintext
416 &mov (&DWP(4,$idx),@T[1]);
417 &mov (&DWP(8,$idx),@T[2]);
418 &mov (&DWP(12,$idx),@T[3]);
423 &xor (@T[0],&DWP(0,$key)); # ^=key[0-3]
424 &xor (@T[1],&DWP(4,$key));
425 &xor (@T[2],&DWP(8,$key));
426 &xor (@T[3],&DWP(12,$key));
429 &mov ($__s0,@T[0]); # save s[0-3]
430 &mov ($__s1,@T[1]);
431 &mov ($__s2,@T[2]);
432 &mov ($__s3,@T[3]);
442 &and ($idx,@T[0]);
443 &mov (@T[3],$__s3);
445 &mov (@T[2],@T[3]);
446 &xor (@T[1],$idx);
447 &or (@T[2],&DWP(4,$key));
448 &mov ($__s1,@T[1]); # s1^=LeftRotate(s0&key[0],1);
449 &xor (@T[2],$__s2);
452 &mov ($__s2,@T[2]); # s2^=s3|key[3];
453 &or ($idx,@T[1]);
454 &and (@T[2],&DWP(0,$key));
455 &xor (@T[0],$idx);
456 &rotl (@T[2],1);
457 &mov ($__s0,@T[0]); # s0^=s1|key[1];
458 &xor (@T[3],@T[2]);
460 &mov ($__s3,@T[3]); # s3^=LeftRotate(s2&key[2],1);
464 &mov (@T[2],@T[0]); # SwapHalf
465 &mov (@T[3],@T[1]);
466 &mov (@T[0],$__s2);
467 &mov (@T[1],$__s3);
468 &xor (@T[2],$idx); # $idx is preloaded with key[2]
469 &xor (@T[3],&DWP(12,$key));
470 &xor (@T[0],&DWP(0,$key));
471 &xor (@T[1],&DWP(4,$key));
480 my ($i0,$i1,$i2,$i3,$rot,$rnd,@T)=@_;
490 &mov (&DWP(-128+4*$rnd++,$key),shift(@T)) if ($i0 eq @T[0]);
491 &mov (&DWP(-128+4*$rnd++,$key),shift(@T)) if ($i1 eq @T[0]);
492 &mov (&DWP(-128+4*$rnd++,$key),shift(@T)) if ($i2 eq @T[0]);
493 &mov (&DWP(-128+4*$rnd++,$key),shift(@T)) if ($i3 eq @T[0]);
500 my ($i0,$i1,$i2,$i3,$rot,$rnd,@T)=@_;
512 &mov (&DWP(-128+4*$rnd++,$key),shift(@T)) if ($i0 eq @T[0]);
518 &mov (&DWP(-128+4*$rnd++,$key),shift(@T)) if ($i1 eq @T[0]);
522 &mov (&DWP(-128+4*$rnd++,$key),shift(@T)) if ($i2 eq @T[0]);
523 &mov (&DWP(-128+4*$rnd++,$key),shift(@T)) if ($i3 eq @T[0]);
525 &mov (&DWP(-128+4*$rnd++,$key),shift(@T)) if ($i0 eq @T[0]);
526 &mov (&DWP(-128+4*$rnd++,$key),shift(@T)) if ($i1 eq @T[0]);
527 &mov (&DWP(-128+4*$rnd++,$key),shift(@T)) if ($i2 eq @T[0]);
528 &mov (&DWP(-128+4*$rnd++,$key),shift(@T)) if ($i3 eq @T[0]);
533 my ($rnd,$key,@T)=@_;
534 my $bias=int(@T[0])?shift(@T):0;
536 &mov (&DWP($bias+$rnd*8+0,$key),@T[0]);
537 &mov (&DWP($bias+$rnd*8+4,$key),@T[1]) if ($#T>=1);
538 &mov (&DWP($bias+$rnd*8+8,$key),@T[2]) if ($#T>=2);
539 &mov (&DWP($bias+$rnd*8+12,$key),@T[3]) if ($#T>=3);
543 my ($rnd,$key,@T)=@_;
544 my $bias=int(@T[0])?shift(@T):0;
546 &mov (@T[0],&DWP($bias+$rnd*8+0,$key));
547 &mov (@T[1],&DWP($bias+$rnd*8+4,$key)) if ($#T>=1);
548 &mov (@T[2],&DWP($bias+$rnd*8+8,$key)) if ($#T>=2);
549 &mov (@T[3],&DWP($bias+$rnd*8+12,$key)) if ($#T>=3);
565 &mov (@T[0],&DWP(0,$idx)); # load 0-127 bits
566 &mov (@T[1],&DWP(4,$idx));
567 &mov (@T[2],&DWP(8,$idx));
568 &mov (@T[3],&DWP(12,$idx));
570 &bswap (@T[0]);
571 &bswap (@T[1]);
572 &bswap (@T[2]);
573 &bswap (@T[3]);
575 &_saveround (0,$key,@T); # KL<<<0
580 &mov (@T[0],&DWP(16,$idx)); # load 128-191 bits
581 &mov (@T[1],&DWP(20,$idx));
584 &mov (@T[2],&DWP(24,$idx)); # load 192-255 bits
585 &mov (@T[3],&DWP(28,$idx));
588 &mov (@T[2],@T[0]);
589 &mov (@T[3],@T[1]);
590 ¬ (@T[2]);
591 ¬ (@T[3]);
593 &bswap (@T[0]);
594 &bswap (@T[1]);
595 &bswap (@T[2]);
596 &bswap (@T[3]);
598 &_saveround (4,$key,@T); # temporary storage for KR!
600 &xor (@T[0],&DWP(0*8+0,$key)); # KR^KL
601 &xor (@T[1],&DWP(0*8+4,$key));
602 &xor (@T[2],&DWP(1*8+0,$key));
603 &xor (@T[3],&DWP(1*8+4,$key));
613 &mov (&swtmp(0),@T[0]); # save s[0-3]
614 &mov (&swtmp(1),@T[1]);
615 &mov (&swtmp(2),@T[2]);
616 &mov (&swtmp(3),@T[3]);
619 &mov (@T[2],&swtmp(2));
620 &mov (@T[3],&swtmp(3));
623 &xor (@T[0],&DWP(0*8+0,$idx)); # ^KL
624 &xor (@T[1],&DWP(0*8+4,$idx));
625 &xor (@T[2],&DWP(1*8+0,$idx));
626 &xor (@T[3],&DWP(1*8+4,$idx));
629 &mov (&swtmp(0),@T[0]); # save s[0-3]
630 &mov (&swtmp(1),@T[1]);
631 &mov (&swtmp(2),@T[2]);
632 &mov (&swtmp(3),@T[3]);
635 &mov (@T[2],&swtmp(2));
636 &mov (@T[3],&swtmp(3));
646 &_saveround (2,$key,-128,@T); # KA<<<0
647 &_rotl128 (@T,15,6,@T); # KA<<<15
648 &_rotl128 (@T,15,8,@T); # KA<<<(15+15=30)
649 &_rotl128 (@T,15,12,@T[0],@T[1]); # KA<<<(30+15=45)
650 &_rotl128 (@T,15,14,@T); # KA<<<(45+15=60)
651 push (@T,shift(@T)); # rotl128(@T,32);
652 &_rotl128 (@T,2,20,@T); # KA<<<(60+32+2=94)
653 &_rotl128 (@T,17,24,@T); # KA<<<(94+17=111)
656 &_loadround (0,$key,-128,@T); # load KL
657 &_rotl128 (@T,15,4,@T); # KL<<<15
658 &_rotl128 (@T,30,10,@T); # KL<<<(15+30=45)
659 &_rotl128 (@T,15,13,@T[2],@T[3]); # KL<<<(45+15=60)
660 &_rotl128 (@T,17,16,@T); # KL<<<(60+17=77)
661 &_rotl128 (@T,17,18,@T); # KL<<<(77+17=94)
662 &_rotl128 (@T,17,22,@T); # KL<<<(94+17=111)
664 while (@T[0] ne "eax") # restore order
665 { unshift (@T,pop(@T)); }
672 &_saveround (6,$idx,@T); # temporary storage for KA!
674 &xor (@T[0],&DWP(4*8+0,$idx)); # KA^KR
675 &xor (@T[1],&DWP(4*8+4,$idx));
676 &xor (@T[2],&DWP(5*8+0,$idx));
677 &xor (@T[3],&DWP(5*8+4,$idx));
680 &mov (&swtmp(0),@T[0]); # save s[0-3]
681 &mov (&swtmp(1),@T[1]);
682 &mov (&swtmp(2),@T[2]);
683 &mov (&swtmp(3),@T[3]);
686 &mov (@T[2],&swtmp(2));
687 &mov (@T[3],&swtmp(3));
693 &_saveround (2,$key,-128,@T); # KB<<<0
694 &_rotl128 (@T,30,10,@T); # KB<<<30
695 &_rotl128 (@T,30,20,@T); # KB<<<(30+30=60)
696 push (@T,shift(@T)); # rotl128(@T,32);
697 &_rotl128 (@T,19,32,@T); # KB<<<(60+32+19=111)
700 &_loadround (4,$key,-128,@T); # load KR
701 &_rotl128 (@T,15,4,@T); # KR<<<15
702 &_rotl128 (@T,15,8,@T); # KR<<<(15+15=30)
703 &_rotl128 (@T,30,18,@T); # KR<<<(30+30=60)
704 push (@T,shift(@T)); # rotl128(@T,32);
705 &_rotl128 (@T,2,26,@T); # KR<<<(60+32+2=94)
708 &_loadround (6,$key,-128,@T); # load KA
709 &_rotl128 (@T,15,6,@T); # KA<<<15
710 &_rotl128 (@T,30,14,@T); # KA<<<(15+30=45)
711 push (@T,shift(@T)); # rotl128(@T,32);
712 &_rotl128 (@T,0,24,@T); # KA<<<(45+32+0=77)
713 &_rotl128 (@T,17,28,@T); # KA<<<(77+17=94)
716 &_loadround (0,$key,-128,@T); # load KL
717 push (@T,shift(@T)); # rotl128(@T,32);
718 &_rotl128 (@T,13,12,@T); # KL<<<(32+13=45)
719 &_rotl128 (@T,15,16,@T); # KL<<<(45+15=60)
720 &_rotl128 (@T,17,22,@T); # KL<<<(60+17=77)
721 push (@T,shift(@T)); # rotl128(@T,32);
722 &_rotl128 (@T,2,30,@T); # KL<<<(77+32+2=111)
724 while (@T[0] ne "eax") # restore order
725 { unshift (@T,pop(@T)); }
828 my ($s0,$s1,$s2,$s3) = @T;