1 /* $XConsortium: des.h /main/3 1995/10/27 16:19:08 rswiston $ */
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. *
9 { DES, USX/LIB/DESLIB, PJL, 04/05/82 }
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
20 #ifndef apollo_sys_des_h
21 #define apollo_sys_des_h
24 /* Enable function prototypes for ANSI C and C++ */
25 #if defined(__STDC__) || defined(c_plusplus) || defined(__cplusplus)
29 /* Required for C++ V2.0 */
35 #define std_$call extern
38 typedef char des_$key[8];
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 }
47 typedef char des_$text[8]; /* Actually a 64 bit set */
49 typedef char des_$key_sched[16][8];
51 std_$call void des_$encrypt(
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 */
59 std_$call void des_$decrypt(
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 */
67 std_$call void des_$compute_key_sched(
69 des_$key & key, /* eight byte key */
70 des_$key_sched * key_sched /* output key schedule */