1 /* libGringotts - generic data encoding (crypto+compression) library 2 * (c) 2002, Germano Rizzo <mano@pluto.linux.it> 3 * 4 * libgrg_structs.h - header file for libgrg_structs.c 5 * Author: Germano Rizzo 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU Library General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 */ 21 22 #ifndef LIBGRG_STRUCTS_H 23 #define LIBGRG_STRUCTS_H 24 25 #include "libgringotts.h" 26 #include <stdio.h> 27 #include <mcrypt.h> 28 29 #define HEADER_LEN 3 30 31 struct _grg_context 32 { 33 int rnd; 34 unsigned char header[3]; 35 grg_crypt_algo crypt_algo; 36 grg_hash_algo hash_algo; 37 grg_comp_algo comp_algo; 38 grg_comp_ratio comp_lvl; 39 grg_security_lvl sec_lvl; 40 }; 41 42 struct _grg_key 43 { 44 char key_192_ripe[24]; 45 char key_256_ripe[32]; 46 char key_192_sha[24]; 47 char key_256_sha[32]; 48 }; 49 50 struct _grg_tmpfile 51 { 52 int tmpfd; 53 54 int dKey; 55 unsigned char *key; 56 int dIV; 57 unsigned char *IV; 58 59 MCRYPT crypt; 60 61 unsigned int rwmode; 62 }; 63 64 #endif 65