1/*
2 * ppp_mppe_crypto.h - cryptografic funtion prototypes for MPPE
3 *
4 *  This code is Public Domain. Please see comments below.
5 *
6 *  I have just put SHA1 and ARCFOUR declarations into one file
7 *  in order to not pollute kernel namespace.
8 *
9 *  Jan Dubiec <jdx@slackware.pl>, 2003-07-08
10 */
11
12#ifndef _PPP_MPPE_CRYPTO_
13#define _PPP_MPPE_CRYPTO_
14
15/* SHA1 definitions and prototypes */
16typedef struct {
17    unsigned long state[5];
18    unsigned long count[2];
19    unsigned char buffer[64];
20} SHA1_CTX;
21
22#define SHA1_SIGNATURE_SIZE 20
23
24extern void SHA1_Init(SHA1_CTX *);
25extern void SHA1_Update(SHA1_CTX *, const unsigned char *, unsigned int);
26extern void SHA1_Final(unsigned char[SHA1_SIGNATURE_SIZE], SHA1_CTX *);
27
28/* ARCFOUR (aka RC4) definitions and prototypes */
29typedef struct {
30    unsigned i;
31    unsigned j;
32    unsigned char S[256];
33} arcfour_context;
34
35extern void arcfour_setkey(arcfour_context *, const unsigned char *, unsigned);
36extern void arcfour_encrypt(arcfour_context *, const unsigned char *, unsigned,
37			    unsigned char *);
38#define arcfour_decrypt arcfour_encrypt
39
40#endif /* _PPP_MPPE_CRYPTO_ */
41