]> git.ipfire.org Git - thirdparty/openssl.git/blame - crypto/des/rpc_des.h
Copyright consolidation 07/10
[thirdparty/openssl.git] / crypto / des / rpc_des.h
CommitLineData
d2e9e320
RS
1/*
2 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
d02b48c6 3 *
d2e9e320
RS
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
d02b48c6
RE
8 */
9
0f113f3e 10/* @(#)des.h 2.2 88/08/10 4.0 RPCSRC; from 2.7 88/02/08 SMI */
1d97c843 11/*-
d02b48c6
RE
12 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
13 * unrestricted use provided that this legend is included on all tape
14 * media and as a part of the software program in whole or part. Users
15 * may copy or modify Sun RPC without charge, but are not authorized
16 * to license or distribute it to anyone else except as part of a product or
17 * program developed by the user.
0f113f3e 18 *
d02b48c6
RE
19 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
20 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
21 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
0f113f3e 22 *
d02b48c6
RE
23 * Sun RPC is provided with no support and without any obligation on the
24 * part of Sun Microsystems, Inc. to assist in its use, correction,
25 * modification or enhancement.
0f113f3e 26 *
d02b48c6
RE
27 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
28 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
29 * OR ANY PART THEREOF.
0f113f3e 30 *
d02b48c6
RE
31 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
32 * or profits or other special, indirect and consequential damages, even if
33 * Sun has been advised of the possibility of such damages.
0f113f3e 34 *
d02b48c6
RE
35 * Sun Microsystems, Inc.
36 * 2550 Garcia Avenue
37 * Mountain View, California 94043
38 */
39/*
40 * Generic DES driver interface
41 * Keep this file hardware independent!
42 * Copyright (c) 1986 by Sun Microsystems, Inc.
43 */
44
0f113f3e
MC
45#define DES_MAXLEN 65536 /* maximum # of bytes to encrypt */
46#define DES_QUICKLEN 16 /* maximum # of bytes to encrypt quickly */
d02b48c6 47
d02b48c6
RE
48enum desdir { ENCRYPT, DECRYPT };
49enum desmode { CBC, ECB };
50
51/*
52 * parameters to ioctl call
53 */
54struct desparams {
0f113f3e
MC
55 unsigned char des_key[8]; /* key (with low bit parity) */
56 enum desdir des_dir; /* direction */
57 enum desmode des_mode; /* mode */
58 unsigned char des_ivec[8]; /* input vector */
59 unsigned des_len; /* number of bytes to crypt */
60 union {
61 unsigned char UDES_data[DES_QUICKLEN];
62 unsigned char *UDES_buf;
63 } UDES;
64#define des_data UDES.UDES_data /* direct data here if quick */
65#define des_buf UDES.UDES_buf /* otherwise, pointer to data */
d02b48c6
RE
66};
67
68/*
69 * Encrypt an arbitrary sized buffer
70 */
0f113f3e 71#define DESIOCBLOCK _IOWR('d', 6, struct desparams)
d02b48c6 72
0f113f3e 73/*
d02b48c6
RE
74 * Encrypt of small amount of data, quickly
75 */
0f113f3e 76#define DESIOCQUICK _IOWR('d', 7, struct desparams)