This file contains information on how to plug your own DES support into
Drawbridge.  Due to U.S. export controls, we cannot make the DES part
of Drawbridge freely available to sites outside of the U.S. However you
are free to use any encryption you desire as long as it conforms to the
following API (see crypt.c in fm and filter for details about which
routines are used and examples of how to call a DES package).

The following documentation is taken from:

des - fast & portable DES encryption & decryption.
Copyright (C) 1992  Dana L. How

4/19/93 - Modified by David K. Hess to suit the needs of Drawbridge.

how to use the routines

datatypes:
        pointer to 8 byte area of type DesData
        used to hold keys and input/output blocks to des.

        pointer to 128 byte area of type DesKeys
        used to hold full 768-bit key.
        must be long-aligned.

DesMethod(m, k)
        m points to a 128byte block, k points to an 8 byte des key
        which must have odd parity (or -1 is returned) and which must
        not be a (semi-)weak key (or -2 is returned).
        normally DesMethod() returns 0.
        m is filled in from k so that when one of the routines below
        is called with m, the routine will act like standard des
        en/decryption with the key k. if you use DesMethod,
        you supply a standard 56bit key; however, if you fill in
        m yourself, you will get a 768bit key - but then it won't
        be standard.  it's 768bits not 1024 because the least significant
        two bits of each byte are not used.  note that these two bits
        will be set to magic constants which speed up the encryption/decryption
        on some machines.  and yes, each byte controls
        a specific sbox during a specific iteration.
        you really shouldn't use the 768bit format directly;  i should
        provide a routine that converts 128 6-bit bytes (specified in
        S-box mapping order or something) into the right format for you.
        this would entail some byte concatenation and rotation.

DesSmallCore{Encrypt|Decrypt}(d, m, s)
	performs des on the 8 bytes at s into the 8 bytes at d. (d,s:
	char *).  uses m as a 768bit key as explained above.  the
	Encrypt|Decrypt choice is obvious.
