2 * lib/des425/key_sched.c
4 * Copyright 1985, 1986, 1987, 1988, 1990 by the Massachusetts Institute
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.
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.
25 * This routine computes the DES key schedule given a key. The
26 * permutations and shifts have been done at compile time, resulting
27 * in a direct one-step mapping from the input key to the key
30 * Also checks parity and weak keys.
32 * Watch out for the subscripts -- most effectively start at 1 instead
33 * of at zero. Maybe some bugs in that area.
35 * DON'T change the data types for arrays and such, or it will either
36 * break or run slower. This was optimized for Uvax2.
38 * In case the user wants to cache the computed key schedule, it is
39 * passed as an arg. Also implies that caller has explicit control
40 * over zeroing both the key schedule and the key.
42 * All registers labeled imply Vax using the Ultrix or 4.2bsd compiler.
44 * Originally written 6/85 by Steve Miller, MIT Project Athena.
52 des_key_sched(k,schedule)
53 register mit_des_cblock k; /* r11 */
54 mit_des_key_schedule schedule;
56 return (mit_des_key_sched(k, schedule));