107 lines
2.9 KiB
C
107 lines
2.9 KiB
C
#ifndef __DES_DES_H__
|
|
#define __DES_DES_H__
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
#ident "$Revision: 1.3 $"
|
|
/*
|
|
*
|
|
* Copyright 1992, Silicon Graphics, Inc.
|
|
* All Rights Reserved.
|
|
*
|
|
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
|
|
* the contents of this file may not be disclosed to third parties, copied or
|
|
* duplicated in any form, in whole or in part, without the prior written
|
|
* permission of Silicon Graphics, Inc.
|
|
*
|
|
* RESTRICTED RIGHTS LEGEND:
|
|
* Use, duplication or disclosure by the Government is subject to restrictions
|
|
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
|
|
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
|
|
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
|
|
* rights reserved under the Copyright Laws of the United States.
|
|
*/
|
|
/* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
|
|
/* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
|
|
/* All Rights Reserved */
|
|
|
|
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
|
|
/* UNIX System Laboratories, Inc. */
|
|
/* The copyright notice above does not evidence any */
|
|
/* actual or intended publication of such source code. */
|
|
|
|
|
|
#ident "@(#)uts-comm:net/des/des.h 1.3"
|
|
|
|
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
* PROPRIETARY NOTICE (Combined)
|
|
*
|
|
* This source code is unpublished proprietary information
|
|
* constituting, or derived under license from AT&T's UNIX(r) System V.
|
|
* In addition, portions of such source code were derived from Berkeley
|
|
* 4.3 BSD under license from the Regents of the University of
|
|
* California.
|
|
*
|
|
*
|
|
*
|
|
* Copyright Notice
|
|
*
|
|
* Notice of copyright on this source code product does not indicate
|
|
* publication.
|
|
*
|
|
* (c) 1986,1987,1988,1989 Sun Microsystems, Inc
|
|
* (c) 1983,1984,1985,1986,1987,1988,1989 AT&T.
|
|
* All rights reserved.
|
|
*/
|
|
|
|
/*
|
|
* Generic DES driver interface
|
|
* Keep this file hardware independent!
|
|
*/
|
|
|
|
#ifdef _KERNEL
|
|
|
|
#ifndef _UTIL_TYPES_H
|
|
#include <util/types.h> /* REQUIRED */
|
|
#endif
|
|
|
|
#endif /* _KERNEL */
|
|
|
|
#define DES_MAXLEN 65536 /* maximum # of bytes to encrypt */
|
|
#define DES_QUICKLEN 16 /* maximum # of bytes to encrypt quickly */
|
|
|
|
enum desdir { ENCRYPT, DECRYPT };
|
|
enum desmode { CBC, ECB };
|
|
|
|
/*
|
|
* parameters to ioctl call
|
|
*/
|
|
struct desparams {
|
|
u_char des_key[8]; /* key (with low bit parity) */
|
|
enum desdir des_dir; /* direction */
|
|
enum desmode des_mode; /* mode */
|
|
u_char des_ivec[8]; /* input vector */
|
|
unsigned des_len; /* number of bytes to crypt */
|
|
union {
|
|
u_char UDES_data[DES_QUICKLEN];
|
|
u_char *UDES_buf;
|
|
} UDES;
|
|
# define des_data UDES.UDES_data /* direct data here if quick */
|
|
# define des_buf UDES.UDES_buf /* otherwise, pointer to data */
|
|
};
|
|
|
|
/*
|
|
* Encrypt an arbitrary sized buffer
|
|
*/
|
|
#define DESIOCBLOCK _IOWR('d', 6, struct desparams)
|
|
|
|
/*
|
|
* Encrypt of small amount of data, quickly
|
|
*/
|
|
#define DESIOCQUICK _IOWR('d', 7, struct desparams)
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* !__DES_DES_H__ */
|