2 * pppcrypt.c - PPP/DES linkage for MS-CHAP and EAP SRP-SHA1
4 * Extracted from chap_ms.c by James Carlson.
5 * Updated to better reflect RFC2759 by Eivind Naess
7 * Copyright (c) 2022 Eivind Naess. All rights reserved.
8 * Copyright (c) 1995 Eric Rosenquist. All rights reserved.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in
19 * the documentation and/or other materials provided with the
22 * 3. The name(s) of the authors of this software must not be used to
23 * endorse or promote products derived from this software without
24 * prior written permission.
26 * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
27 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
28 * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
29 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
30 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
31 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
32 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
34 #ifndef PPP_PPPCRYPT_H
35 #define PPP_PPPCRYPT_H
40 * This is the DES encrypt functions as described by RFC2759.
43 * unsigned char *clear:
44 * A 8 byte input array to be encrypted
47 * A raw 7-byte array to be expanded to 8 with odd-parity
49 * unsigned char *cipher:
50 * A 8 byte outut array providing space for the output data
52 * DesEncrypt returns 1 on success
54 int DesEncrypt(unsigned char *clear, unsigned char *key,
55 unsigned char *cipher);
58 * This is the DES decrypt functions as described by RFC2759.
61 * unsigned char *cipher:
62 * A 8 byte input array to be decrypted
65 * A raw 7-byte array to be expanded to a 8-byte key with odd-parity
67 * unsigned char *clear:
68 * A 8 byte output array providing space for the output data
70 * DesDecrypt returns 1 on success
72 int DesDecrypt(unsigned char *cipher, unsigned char *key,
73 unsigned char *clear);
75 #endif /* PPP_PPPCRYPT_H */