289061ae6f65bc1cf6dc0439419f427c66d0d906
[krb5.git] / src / lib / des425 / des.c
1 /*
2  * lib/des425/des.c
3  *
4  * Copyright 1985, 1986, 1987, 1988, 1990 by the Massachusetts Institute
5  * of Technology.
6  * All Rights Reserved.
7  *
8  * Export of this software from the United States of America may
9  *   require a specific license from the United States Government.
10  *   It is the responsibility of any person or organization contemplating
11  *   export to obtain such a license before exporting.
12  * 
13  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
14  * distribute this software and its documentation for any purpose and
15  * without fee is hereby granted, provided that the above copyright
16  * notice appear in all copies and that both that copyright notice and
17  * this permission notice appear in supporting documentation, and that
18  * the name of M.I.T. not be used in advertising or publicity pertaining
19  * to distribution of the software without specific, written prior
20  * permission.  M.I.T. makes no representations about the suitability of
21  * this software for any purpose.  It is provided "as is" without express
22  * or implied warranty.
23  * 
24  *
25  * These routines perform encryption and decryption using the DES
26  * private key algorithm, or else a subset of it-- fewer inner loops.
27  * (AUTH_DES_ITER defaults to 16, may be less.)
28  *
29  * Under U.S. law, this software may not be exported outside the US
30  * without license from the U.S. Commerce department.
31  *
32  * The key schedule is passed as an arg, as well as the cleartext or
33  * ciphertext.
34  *
35  * All registers labeled imply Vax using the Ultrix or 4.2bsd
36  * compiler.
37  *
38  *
39  *      NOTE:  bit and byte numbering:
40  *                      DES algorithm is defined in terms of bits of L
41  *                      followed by bits of R.
42  *              bit 0  ==> lsb of L
43  *              bit 63 ==> msb of R
44  *
45  * Always work in register pairs, FROM L1,R1 TO L2,R2 to make
46  * bookkeeping easier.
47  *
48  * originally written by Steve Miller, MIT Project Athena
49  */
50
51
52 #include "des.h"
53
54 int INTERFACE
55 des_ecb_encrypt(clear, cipher, schedule, encrypt)
56     unsigned long *clear;
57     unsigned long *cipher;
58     int encrypt;                /* 0 ==> decrypt, else encrypt */
59     register mit_des_key_schedule schedule; /* r11 */
60 {
61         return (mit_des_ecb_encrypt(clear, cipher, schedule, encrypt));
62 }
63
64