summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/des/doIP
diff options
context:
space:
mode:
authorryker <>1998-10-05 20:13:16 +0000
committerryker <>1998-10-05 20:13:16 +0000
commit9e43e2ac1373d5be5c6500c1bc3b1dd6ee9584b4 (patch)
tree51ff319f3510104698e541954d10ad98f9125f36 /src/lib/libcrypto/des/doIP
parent9e77c62555877f9a64805c49d0dcd7dbfbb40f4e (diff)
downloadopenbsd-9e43e2ac1373d5be5c6500c1bc3b1dd6ee9584b4.tar.gz
openbsd-9e43e2ac1373d5be5c6500c1bc3b1dd6ee9584b4.tar.bz2
openbsd-9e43e2ac1373d5be5c6500c1bc3b1dd6ee9584b4.zip
Import of SSLeay-0.9.0b with RSA and IDEA stubbed + OpenBSD build
functionality for shared libs. Note that routines such as sslv2_init and friends that use RSA will not work due to lack of RSA in this library. Needs documentation and help from ports for easy upgrade to full functionality where legally possible.
Diffstat (limited to 'src/lib/libcrypto/des/doIP')
-rw-r--r--src/lib/libcrypto/des/doIP46
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
16require 'shifts.pl';
17
18sub 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);