Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtlogin / apollo / des.h
1 /* $XConsortium: des.h /main/3 1995/10/27 16:19:08 rswiston $ */
2 /*                                                                      *
3  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
4  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
5  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
6  * (c) Copyright 1993, 1994 Novell, Inc.                                *
7  */
8 /*
9 { DES, USX/LIB/DESLIB, PJL, 04/05/82 }
10 {   DES routines }
11
12 {  CHANGES:
13    12/21/88 gilbert   Modifications for C++.
14    03/25/88 brian     Created ANSI C version
15    01/13/86 nazgul    Created C version
16    08/25/83 spf   Added us_des_ins_pas declaration
17 }
18 */
19
20 #ifndef apollo_sys_des_h
21 #define apollo_sys_des_h
22
23
24 /*  Enable function prototypes for ANSI C and C++  */
25 #if defined(__STDC__) || defined(c_plusplus) || defined(__cplusplus)
26 #    define _PROTOTYPES
27 #endif
28
29 /*  Required for C++ V2.0  */
30 #ifdef  __cplusplus
31     extern "C" {
32 #endif
33
34 #ifdef _PROTOTYPES
35 #define std_$call       extern
36 #endif
37
38 typedef  char  des_$key[8];
39
40 /*
41   packed record                       { NOTE THIS WELL!!! }
42         bits:   0..127;                 { 56 bits: LEFT ADJUSTED in 8 bytes }
43         parity: 0..1                    { reserved for parity, but ignored }
44         end;
45 */
46
47 typedef  char  des_$text[8];          /* Actually a 64 bit set */
48
49 typedef  char  des_$key_sched[16][8];
50
51 std_$call void    des_$encrypt(
52 #ifdef _PROTOTYPES
53         des_$text       & plain,          /* input 64 bits to encrypt */
54         des_$text       * cipher,         /* ...get back result */
55         des_$key_sched  & key_sched       /* made with des_$compute_key_sched */
56 #endif
57 );
58
59 std_$call void   des_$decrypt(
60 #ifdef _PROTOTYPES
61         des_$text       & cipher,         /* input 64 bits to decrypt */
62         des_$text       * plain,          /* ...get back result */
63         des_$key_sched  & key_sched       /* made with des_$compute_key_sched */
64 #endif
65 );
66
67 std_$call void   des_$compute_key_sched(
68 #ifdef _PROTOTYPES
69         des_$key        & key,            /* eight byte key */
70         des_$key_sched  * key_sched       /* output key schedule */
71 #endif
72 );
73
74 #ifdef  __cplusplus
75     }
76 #endif
77
78 #endif