| 1 | /* |
| 2 | * FreeSec: libcrypt for NetBSD |
| 3 | * |
| 4 | * Copyright (c) 1994 David Burren |
| 5 | * All rights reserved. |
| 6 | * |
| 7 | * Adapted for FreeBSD-2.0 by Geoffrey M. Rehmet |
| 8 | * this file should now *only* export crypt(), in order to make |
| 9 | * binaries of libcrypt exportable from the USA |
| 10 | * |
| 11 | * Adapted for FreeBSD-4.0 by Mark R V Murray |
| 12 | * this file should now *only* export crypt_des(), in order to make |
| 13 | * a module that can be optionally included in libcrypt. |
| 14 | * |
| 15 | * Adapted for libxcrypt by Zack Weinberg, 2017 |
| 16 | * see notes in des.c |
| 17 | * |
| 18 | * Redistribution and use in source and binary forms, with or without |
| 19 | * modification, are permitted provided that the following conditions |
| 20 | * are met: |
| 21 | * 1. Redistributions of source code must retain the above copyright |
| 22 | * notice, this list of conditions and the following disclaimer. |
| 23 | * 2. Redistributions in binary form must reproduce the above copyright |
| 24 | * notice, this list of conditions and the following disclaimer in the |
| 25 | * documentation and/or other materials provided with the distribution. |
| 26 | * 3. Neither the name of the author nor the names of other contributors |
| 27 | * may be used to endorse or promote products derived from this software |
| 28 | * without specific prior written permission. |
| 29 | * |
| 30 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
| 31 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 32 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 33 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
| 34 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 35 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 36 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 37 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 38 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 39 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 40 | * SUCH DAMAGE. |
| 41 | * |
| 42 | * This is an original implementation of the DES and the crypt(3) interfaces |
| 43 | * by David Burren <[email protected]>. |
| 44 | */ |
| 45 | |
| 46 | #ifndef _CRYPT_ALG_DES_H |
| 47 | #define _CRYPT_ALG_DES_Hcxx . . $ `lib/alg-des.h:47:9`! 1 |
| 48 | |
| 49 | /* des.c */ |
| 50 | |
| 51 | struct des_ctxcxx . . $ des_ctx# |
| 52 | { |
| 53 | uint32_tcxx . . $ uint32_t# keyslcxx . . $ des_ctx#keysl.[16]; |
| 54 | uint32_tcxx . . $ uint32_t# keysrcxx . . $ des_ctx#keysr.[16]; |
| 55 | uint32_tcxx . . $ uint32_t# saltbitscxx . . $ des_ctx#saltbits.; |
| 56 | }; |
| 57 | |
| 58 | extern void des_set_keycxx . . $ `lib/crypt-port.h:329:9`! (struct des_ctxcxx . . $ des_ctx# *restrict ctx, |
| 59 | const unsigned char key[MIN_SIZEcxx . . $ `lib/crypt-port.h:97:9`!(8)]); |
| 60 | extern void des_set_saltcxx . . $ `lib/crypt-port.h:330:9`! (struct des_ctxcxx . . $ des_ctx# *restrict ctx, |
| 61 | uint32_tcxx . . $ uint32_t# salt); |
| 62 | extern void des_crypt_blockcxx . . $ `lib/crypt-port.h:328:9`! (struct des_ctxcxx . . $ des_ctx# *restrict ctx, |
| 63 | unsigned char *out, const unsigned char *in, |
| 64 | unsigned int count, boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! decrypt); |
| 65 | |
| 66 | /* des-tables.c (generated by des-mktables) */ |
| 67 | extern const uint8_tcxx . . $ uint8_t# m_sboxcxx . . $ `lib/crypt-port.h:339:9`![4][4096]; |
| 68 | extern const uint32_tcxx . . $ uint32_t# ip_masklcxx . . $ `lib/crypt-port.h:335:9`![8][256], ip_maskrcxx . . $ `lib/crypt-port.h:336:9`![8][256]; |
| 69 | extern const uint32_tcxx . . $ uint32_t# fp_masklcxx . . $ `lib/crypt-port.h:333:9`![8][256], fp_maskrcxx . . $ `lib/crypt-port.h:334:9`![8][256]; |
| 70 | extern const uint32_tcxx . . $ uint32_t# key_perm_masklcxx . . $ `lib/crypt-port.h:337:9`![8][128], key_perm_maskrcxx . . $ `lib/crypt-port.h:338:9`![8][128]; |
| 71 | extern const uint32_tcxx . . $ uint32_t# comp_masklcxx . . $ `lib/crypt-port.h:331:9`![8][128], comp_maskrcxx . . $ `lib/crypt-port.h:332:9`![8][128]; |
| 72 | extern const uint32_tcxx . . $ uint32_t# psboxcxx . . $ `lib/crypt-port.h:340:9`![4][256]; |
| 73 | |
| 74 | #endif /* alg-des.h */ |