_ ХаКеР - звучит гордо (2:5077/15.22) ______________________________ RU.HACKER _
From : Roman Rusakov 2:5020/322 Fri 01 Nov 96 13:50
Subj : UNIX crypt()
________________________________________________________________________________
Hello All.
Кто тут хотел subj?
=== Cut ===
/*
* This program is copyright Alec Muffett 1991 except for some portions of
* code in "crack-fcrypt.c" which are copyright Robert Baldwin, Icarus Sparry
* and Alec Muffett. The author(s) disclaims all responsibility or liability
* with respect to it's usage or its effect upon hardware or computer
* systems, and maintain copyright as set out in the "LICENCE" document which
* accompanies distributions of Crack v4.0 and upwards.
*/
/*
* Misc defs for the fast password transform optimisations.
*/
#include "crack.h"
#define reg register
#define uns unsigned
#define unsb uns char
#define unsl uns long
/*
* Types for the different ways to represent DES bit patterns. Bits are
* always right justified within fields. Bits which have lower indices in
* the NBS spec are stored in the vax bits with less significance (e.g., Bit
* 1 of NBS spec is stored in the bit with weight 2 ** 0 to the Vax.
*/
#define obpb1 unsb /* One bit per byte. */
#define sbpb6 unsb /* Six bits per byte, 6 held. */
#define sbpb6R unsb /* Six bits per byte Reversed order, 6 held. */
#define sbpb24 unsl /* Six bits per byte, 24 held. */
#define ebpb24 unsl /* Eight bits per bit, 24 held. */
#define fbpb4 unsb /* Four bits per byte, 4 held. */
#define fbpb4R unsb /* Four bits per byte Reversed order, 4 held. */
/*
* The operation (6 * x) is often better optimised as this (for really
* braindead compilers) - AEM
*/
Ll = Lh = Rl = Rh = 0;
/* > Цикл, отнимающий наибольшее время.
> Переписывание на ассемблер его и еще нескольких кусков дает в
> результате что-то типа "John the Ripper"
> Об оптимизации я ничего рассказывать не буду, так как не хочу
> давить свежие идеи. */
for (loop = 25; loop--; /* nothing */ )
{
kp = KS;
for (kloop = 8; kloop--; /* nothing */ )
{
k = (Rl ^ Rh) & saltvalue;
#ifndef FDES_8BYTE
Dl = (k ^ Rl ^ *kp++) << SIZEFIX;
Dh = (k ^ Rh ^ *kp++) << SIZEFIX;
#else
/* hack to make things work better - matthew kaufman */
/* I haven't tried any of this - I don't have a cray... AEM */
tmpi = (k ^ Rl ^ *kp++);
sdata.c[3] = (tmpi >> 24) & 0x00ff;
sdata.c[2] = (tmpi >> 16) & 0x00ff;
sdata.c[1] = (tmpi >> 8) & 0x00ff;
sdata.c[0] = (tmpi) & 0x00ff;
tmpi = (k ^ Rh ^ *kp++);
sdata.c[7] = (tmpi >> 24) & 0x00ff;
sdata.c[6] = (tmpi >> 16) & 0x00ff;
sdata.c[5] = (tmpi >> 8) & 0x00ff;
sdata.c[4] = (tmpi) & 0x00ff;
#endif /* FDES_8BYTE */
/*
* for reasons that I cannot explain, if I insert the contents of the
* UnXForm function right HERE, making the tweaks as necessary to avoid
* using out96[] to pass data, I LOSE 30% of my speed. I don't know why.
* Hence, I continue to use out96[]...
*/
{
reg sbpb24 *qp;
qp = out96;
*qp++ = Ll;
*qp++ = Lh;
*qp++ = Rl;
*qp++ = Rh;
}
}
void
UnXForm ()
{
reg sbpb24 Rl;
reg sbpb24 Rh;
reg sbpb24 Ll;
reg sbpb24 Lh;
reg obpb1 *ptr;
reg long int mask;
register long int *lip;