Xsession.src: setup proper cpp_* defines for linux
[oweals/cde.git] / cde / programs / dtlogin / apollo / des.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
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)
10  * any later version.
11  *
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
16  * details.
17  *
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
22  */
23 /* $XConsortium: des.h /main/3 1995/10/27 16:19:08 rswiston $ */
24 /*                                                                      *
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.                                *
29  */
30 /*
31 { DES, USX/LIB/DESLIB, PJL, 04/05/82 }
32 {   DES routines }
33
34 {  CHANGES:
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
39 }
40 */
41
42 #ifndef apollo_sys_des_h
43 #define apollo_sys_des_h
44
45
46 /*  Enable function prototypes for ANSI C and C++  */
47 #if defined(__STDC__) || defined(c_plusplus) || defined(__cplusplus)
48 #    define _PROTOTYPES
49 #endif
50
51 /*  Required for C++ V2.0  */
52 #ifdef  __cplusplus
53     extern "C" {
54 #endif
55
56 #ifdef _PROTOTYPES
57 #define std_$call       extern
58 #endif
59
60 typedef  char  des_$key[8];
61
62 /*
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 }
66         end;
67 */
68
69 typedef  char  des_$text[8];          /* Actually a 64 bit set */
70
71 typedef  char  des_$key_sched[16][8];
72
73 std_$call void    des_$encrypt(
74 #ifdef _PROTOTYPES
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 */
78 #endif
79 );
80
81 std_$call void   des_$decrypt(
82 #ifdef _PROTOTYPES
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 */
86 #endif
87 );
88
89 std_$call void   des_$compute_key_sched(
90 #ifdef _PROTOTYPES
91         des_$key        & key,            /* eight byte key */
92         des_$key_sched  * key_sched       /* output key schedule */
93 #endif
94 );
95
96 #ifdef  __cplusplus
97     }
98 #endif
99
100 #endif