Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/tirpc/rpc/des_crypt.h
$ cat -n /usr/include/tirpc/rpc/des_crypt.h 1 /* 2 * @(#)des_crypt.h 2.1 88/08/11 4.0 RPCSRC; from 1.4 88/02/08 (C) 1986 SMI 3 * $FreeBSD: src/include/rpc/des_crypt.h,v 1.4 2002/03/23 17:24:55 imp Exp $ 4 * 5 * des_crypt.h, des library routine interface 6 * Copyright (C) 1986, Sun Microsystems, Inc. 7 */ 8 /* 9 * Copyright (c) 2009, Sun Microsystems, Inc. 10 * All rights reserved. 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions are met: 14 * - Redistributions of source code must retain the above copyright notice, 15 * this list of conditions and the following disclaimer. 16 * - Redistributions in binary form must reproduce the above copyright notice, 17 * this list of conditions and the following disclaimer in the documentation 18 * and/or other materials provided with the distribution. 19 * - Neither the name of Sun Microsystems, Inc. nor the names of its 20 * contributors may be used to endorse or promote products derived 21 * from this software without specific prior written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 * POSSIBILITY OF SUCH DAMAGE. 34 */ 35 /* 36 * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc. 37 */ 38 39 /* 40 * des_crypt.h, des library routine interface 41 */ 42 43 #ifndef _DES_DES_CRYPT_H 44 #define _DES_DES_CRYPT_H 45 46 #include
47 48 #define DES_MAXDATA 8192 /* max bytes encrypted in one call */ 49 #define DES_DIRMASK (1 << 0) 50 #define DES_ENCRYPT (0*DES_DIRMASK) /* Encrypt */ 51 #define DES_DECRYPT (1*DES_DIRMASK) /* Decrypt */ 52 53 54 #define DES_DEVMASK (1 << 1) 55 #define DES_HW (0*DES_DEVMASK) /* Use hardware device */ 56 #define DES_SW (1*DES_DEVMASK) /* Use software device */ 57 58 59 #define DESERR_NONE 0 /* succeeded */ 60 #define DESERR_NOHWDEVICE 1 /* succeeded, but hw device not available */ 61 #define DESERR_HWERROR 2 /* failed, hardware/driver error */ 62 #define DESERR_BADPARAM 3 /* failed, bad parameter to call */ 63 64 #define DES_FAILED(err) \ 65 ((err) > DESERR_NOHWDEVICE) 66 67 /* 68 * cbc_crypt() 69 * ecb_crypt() 70 * 71 * Encrypt (or decrypt) len bytes of a buffer buf. 72 * The length must be a multiple of eight. 73 * The key should have odd parity in the low bit of each byte. 74 * ivec is the input vector, and is updated to the new one (cbc only). 75 * The mode is created by oring together the appropriate parameters. 76 * DESERR_NOHWDEVICE is returned if DES_HW was specified but 77 * there was no hardware to do it on (the data will still be 78 * encrypted though, in software). 79 */ 80 81 82 /* 83 * Cipher Block Chaining mode 84 */ 85 #ifdef __cplusplus 86 extern "C" { 87 #endif 88 int cbc_crypt( char *, char *, unsigned int, unsigned int, char *); 89 #ifdef __cplusplus 90 } 91 #endif 92 93 /* 94 * Electronic Code Book mode 95 */ 96 #ifdef __cplusplus 97 extern "C" { 98 #endif 99 int ecb_crypt( char *, char *, unsigned int, unsigned int ); 100 #ifdef __cplusplus 101 } 102 #endif 103 104 /* 105 * Set des parity for a key. 106 * DES parity is odd and in the low bit of each byte 107 */ 108 #ifdef __cplusplus 109 extern "C" { 110 #endif 111 void des_setparity( char *); 112 #ifdef __cplusplus 113 } 114 #endif 115 116 #endif /* _DES_DES_CRYPT_H */
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™