2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: des.h /main/3 1995/10/27 16:19:08 rswiston $ */
25 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
26 * (c) Copyright 1993, 1994 International Business Machines Corp. *
27 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
28 * (c) Copyright 1993, 1994 Novell, Inc. *
31 { DES, USX/LIB/DESLIB, PJL, 04/05/82 }
35 12/21/88 gilbert Modifications for C++.
36 03/25/88 brian Created ANSI C version
37 01/13/86 nazgul Created C version
38 08/25/83 spf Added us_des_ins_pas declaration
42 #ifndef apollo_sys_des_h
43 #define apollo_sys_des_h
46 /* Enable function prototypes for ANSI C and C++ */
47 #if defined(__STDC__) || defined(c_plusplus) || defined(__cplusplus)
51 /* Required for C++ V2.0 */
57 #define std_$call extern
60 typedef char des_$key[8];
63 packed record { NOTE THIS WELL!!! }
64 bits: 0..127; { 56 bits: LEFT ADJUSTED in 8 bytes }
65 parity: 0..1 { reserved for parity, but ignored }
69 typedef char des_$text[8]; /* Actually a 64 bit set */
71 typedef char des_$key_sched[16][8];
73 std_$call void des_$encrypt(
75 des_$text & plain, /* input 64 bits to encrypt */
76 des_$text * cipher, /* ...get back result */
77 des_$key_sched & key_sched /* made with des_$compute_key_sched */
81 std_$call void des_$decrypt(
83 des_$text & cipher, /* input 64 bits to decrypt */
84 des_$text * plain, /* ...get back result */
85 des_$key_sched & key_sched /* made with des_$compute_key_sched */
89 std_$call void des_$compute_key_sched(
91 des_$key & key, /* eight byte key */
92 des_$key_sched * key_sched /* output key schedule */