~ubuntu-branches/ubuntu/gutsy/cyrus-sasl2/gutsy-201105300151

« back to all changes in this revision

Viewing changes to mac/libdes/src/doPC1

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2006-11-27 12:59:40 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20061127125940-na3q3g3tkydvyvgl
Tags: 2.1.22.dfsg1-4ubuntu1
* Merge from debian unstable, remaining changes:
  - remove stop links from rc0 and rc6
  - build against db4.3 instead of 4.2
  - build against heimdal-dev instead of libkrb5-dev
  - depend on, don't recommend, modules

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/local/bin/perl
 
 
b'@l=('
 
 
b'\t 0, 1, 2, 3, 4, 5, 6, 7,'
 
 
b'\t 8, 9,10,11,12,13,14,15,'
 
 
b'\t16,17,18,19,20,21,22,23,'
 
 
b'\t24,25,26,27,28,29,30,31'
 
 
b'\t);'
 
 
b'@r=('
 
 
b'\t32,33,34,35,36,37,38,39,'
 
 
b'\t40,41,42,43,44,45,46,47,'
 
 
b'\t48,49,50,51,52,53,54,55,'
 
 
b'\t56,57,58,59,60,61,62,63'
 
 
b'\t);'
 
 
b"require 'shifts.pl';"
 
 
b'sub PERM_OP'
 
 
b'\t{'
 
 
b'\tlocal(*a,*b,*t,$n,$m)=@_;'
 
 
b'\t@z=&shift(*a,-$n);'
 
 
b'\t@z=&xor(*b,*z);'
 
 
b'\t@z=&and(*z,$m);'
 
 
b'\t@b=&xor(*b,*z);'
 
 
b'\t@z=&shift(*z,$n);'
 
 
b'\t@a=&xor(*a,*z);'
 
 
b'\t}'
 
 
b'sub HPERM_OP2'
 
 
b'\t{'
 
 
b'\tlocal(*a,*t,$n,$m)=@_;'
 
 
b'\tlocal(@x,@y,$i);'
 
 
b'\t@z=&shift(*a,16-$n);'
 
 
b'\t@z=&xor(*a,*z);'
 
 
b'\t@z=&and(*z,$m);'
 
 
b'\t@a=&xor(*a,*z);'
 
 
b'\t@z=&shift(*z,$n-16);'
 
 
b'\t@a=&xor(*a,*z);'
 
 
b'\t}'
 
 
b'sub HPERM_OP'
0
2
       {
1
3
       local(*a,*t,$n,$m)=@_;
2
4
       local(@x,@y,$i);
3
5
       for ($i=0; $i<16; $i++)
4
6
               {
5
7
               $x[$i]=$a[$i];
6
8
               $y[$i]=$a[16+$i];
7
9
               }
8
10
       @z=&shift(*x,-$n);
9
11
       @z=&xor(*y,*z);
10
12
       @z=&and(*z,$m);
11
13
       @y=&xor(*y,*z);
12
14
       @z=&shift(*z,$n);
13
15
       @x=&xor(*x,*z);
14
16
       for ($i=0; $i<16; $i++)
15
17
               {
16
18
               $a[$i]=$x[$i];
17
19
               $a[16+$i]=$y[$i];
18
20
               }
19
21
       }
 
 
b'@L=@l;'
 
 
b'@R=@r;'
 
 
b'\tprint "---\\n"; &printit(@R);'
 
 
b'&PERM_OP(*R,*L,*T,4,0x0f0f0f0f);'
 
 
b'\tprint "---\\n"; &printit(@R);'
 
 
b'&HPERM_OP2(*L,*T,-2,0xcccc0000);'
 
 
b'&HPERM_OP2(*R,*T,-2,0xcccc0000);'
 
 
b'\tprint "---\\n"; &printit(@R);'
 
 
b'&PERM_OP(*R,*L,*T,1,0x55555555);'
 
 
b'\tprint "---\\n"; &printit(@R);'
 
 
b'&PERM_OP(*L,*R,*T,8,0x00ff00ff);'
 
 
b'\tprint "---\\n"; &printit(@R);'
 
 
b'&PERM_OP(*R,*L,*T,1,0x55555555);'
 
 
b'\tprint "---\\n"; &printit(@R);'
 
 
b'#\t&printit(@L);'
 
 
b'\t&printit(@R);'
 
 
b'print <<"EOF";'
 
 
b'=============================='
 
 
b'63  55  47  39  31  23  15   7  '
 
 
b'62  54  46  38  30  22  14   6  '
 
 
b'61  53  45  37  29  21  13   5  '
 
 
b'60  52  44  36  --  --  --  --  '
 
 
b'57  49  41  33  25  17   9   1  '
 
 
b'58  50  42  34  26  18  10   2  '
 
 
b'59  51  43  35  27  19  11   3  '
 
 
b'28  20  12   4  --  --  --  --  '
 
 
b'EOF'
 
 
b'exit(1);'
 
 
b'@A=&and(*R,0x000000ff);'
 
 
b'@A=&shift(*A,16);'
 
 
b'@B=&and(*R,0x0000ff00);'
 
 
b'@C=&and(*R,0x00ff0000);'
 
 
b'@C=&shift(*C,-16);'
 
 
b'@D=&and(*L,0xf0000000);'
 
 
b'@D=&shift(*D,-4);'
 
 
b'@A=&or(*A,*B);'
 
 
b'@B=&or(*D,*C);'
 
 
b'@R=&or(*A,*B);'
 
 
b'@L=&and(*L,0x0fffffff);'
 
 
b'\t&printit(@L);'
 
 
b'\t&printit(@R);'
 
 
b'\\ No newline at end of file'