OSDN Git Service

updated with TeX Live 2014.
[putex/putex.git] / src / dvipdfmx-pu / src / dpxcrypt.h
1 /*  
2  
3     This is DVIPDFMx, an eXtended version of DVIPDFM by Mark A. Wicks.
4
5     Copyright (C) 2003-2012 by Jin-Hwan Cho and Shunsaku Hirata,
6     the dvipdfmx project team.
7     
8     This program is free software; you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by
10     the Free Software Foundation; either version 2 of the License, or
11     (at your option) any later version.
12     
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17     
18     You should have received a copy of the GNU General Public License
19     along with this program; if not, write to the Free Software
20     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 */
22
23 #ifndef _DPXCRYPT_H_
24 #define _DPXCRYPT_H_
25
26 #include <stdio.h>
27
28 /* libgcrypt md5 */
29 typedef struct {
30   unsigned long A,B,C,D; /* chaining variables */
31   unsigned long nblocks;
32   unsigned char buf[64];
33   int count;
34 } MD5_CONTEXT;
35
36 void MD5_init (MD5_CONTEXT *ctx);
37 void MD5_write (MD5_CONTEXT *ctx, const unsigned char *inbuf, unsigned long inlen);
38 void MD5_final (unsigned char *outbuf, MD5_CONTEXT *ctx);
39
40 /* libgcrypt arcfour */
41 typedef struct {
42   int idx_i, idx_j;
43   unsigned char sbox[256];
44 } ARC4_KEY;
45
46 void ARC4 (ARC4_KEY *ctx, unsigned long len, const unsigned char *inbuf, unsigned char *outbuf);
47 void ARC4_set_key (ARC4_KEY *ctx, unsigned int keylen, const unsigned char *key);
48
49 #endif /* _DPXCRYPT_H_ */