diff options
author | cvs2svn <admin@example.com> | 1998-10-05 20:13:17 +0000 |
---|---|---|
committer | cvs2svn <admin@example.com> | 1998-10-05 20:13:17 +0000 |
commit | e82f18fab47b698d93971f576f962a3068132912 (patch) | |
tree | 681519717892864935c3d0533cf171098afa649a /src/lib/libcrypto/des/doIP | |
parent | 536c76cbb863bab152f19842ab88772c01e922c7 (diff) | |
download | openbsd-SSLeay_0_9_0b.tar.gz openbsd-SSLeay_0_9_0b.tar.bz2 openbsd-SSLeay_0_9_0b.zip |
This commit was manufactured by cvs2git to create tag 'SSLeay_0_9_0b'.SSLeay_0_9_0b
Diffstat (limited to 'src/lib/libcrypto/des/doIP')
-rw-r--r-- | src/lib/libcrypto/des/doIP | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/lib/libcrypto/des/doIP b/src/lib/libcrypto/des/doIP new file mode 100644 index 0000000000..18cf231303 --- /dev/null +++ b/src/lib/libcrypto/des/doIP | |||
@@ -0,0 +1,46 @@ | |||
1 | #!/usr/local/bin/perl | ||
2 | |||
3 | @l=( | ||
4 | 0, 1, 2, 3, 4, 5, 6, 7, | ||
5 | 8, 9,10,11,12,13,14,15, | ||
6 | 16,17,18,19,20,21,22,23, | ||
7 | 24,25,26,27,28,29,30,31 | ||
8 | ); | ||
9 | @r=( | ||
10 | 32,33,34,35,36,37,38,39, | ||
11 | 40,41,42,43,44,45,46,47, | ||
12 | 48,49,50,51,52,53,54,55, | ||
13 | 56,57,58,59,60,61,62,63 | ||
14 | ); | ||
15 | |||
16 | require 'shifts.pl'; | ||
17 | |||
18 | sub PERM_OP | ||
19 | { | ||
20 | local(*a,*b,*t,$n,$m)=@_; | ||
21 | |||
22 | @z=&shift(*a,-$n); | ||
23 | @z=&xor(*b,*z); | ||
24 | @z=&and(*z,$m); | ||
25 | @b=&xor(*b,*z); | ||
26 | @z=&shift(*z,$n); | ||
27 | @a=&xor(*a,*z); | ||
28 | } | ||
29 | |||
30 | |||
31 | @L=@l; | ||
32 | @R=@r; | ||
33 | &PERM_OP(*R,*L,*T,4,0x0f0f0f0f); | ||
34 | &PERM_OP(*L,*R,*T,16,0x0000ffff); | ||
35 | &PERM_OP(*R,*L,*T,2,0x33333333); | ||
36 | &PERM_OP(*L,*R,*T,8,0x00ff00ff); | ||
37 | &PERM_OP(*R,*L,*T,1,0x55555555); | ||
38 | &printit(@L); | ||
39 | &printit(@R); | ||
40 | &PERM_OP(*R,*L,*T,1,0x55555555); | ||
41 | &PERM_OP(*L,*R,*T,8,0x00ff00ff); | ||
42 | &PERM_OP(*R,*L,*T,2,0x33333333); | ||
43 | &PERM_OP(*L,*R,*T,16,0x0000ffff); | ||
44 | &PERM_OP(*R,*L,*T,4,0x0f0f0f0f); | ||
45 | &printit(@L); | ||
46 | &printit(@R); | ||