| 1 |
/* |
| 2 |
* Copyright (C) 2005 Jonathan Day, Nikos Mavroyanopoulos |
| 3 |
* |
| 4 |
* This library is free software; you can redistribute it and/or modify it |
| 5 |
* under the terms of the GNU Library General Public License as published |
| 6 |
* by the Free Software Foundation; either version 2 of the License, or |
| 7 |
* (at your option) any later version. |
| 8 |
* |
| 9 |
* This library is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 |
* Library General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU Library General Public |
| 15 |
* License along with this library; if not, write to the |
| 16 |
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 17 |
* Boston, MA 02111-1307, USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
|
| 21 |
#if !defined(__MTYPES_H) |
| 22 |
#define __MTYPES_H |
| 23 |
|
| 24 |
#include <mutils/mutils.h> |
| 25 |
|
| 26 |
typedef struct __KEYGEN |
| 27 |
{ |
| 28 |
hashid hash_algorithm[2]; |
| 29 |
mutils_word32 count; |
| 30 |
void *salt; |
| 31 |
mutils_word32 salt_size; |
| 32 |
} KEYGEN; |
| 33 |
|
| 34 |
typedef void (*INIT_FUNC)( void*); |
| 35 |
typedef void (*HASH_FUNC)(void*, const void*, int); |
| 36 |
typedef void (*FINAL_FUNC)(void*); |
| 37 |
typedef void (*DEINIT_FUNC)(void*, unsigned char*); |
| 38 |
|
| 39 |
typedef struct __MHASH_INSTANCE |
| 40 |
{ |
| 41 |
mutils_word32 hmac_key_size; |
| 42 |
mutils_word32 hmac_block; |
| 43 |
mutils_word8 *hmac_key; |
| 44 |
|
| 45 |
mutils_word8 *state; |
| 46 |
mutils_word32 state_size; |
| 47 |
hashid algorithm_given; |
| 48 |
|
| 49 |
HASH_FUNC hash_func; |
| 50 |
FINAL_FUNC final_func; |
| 51 |
DEINIT_FUNC deinit_func; |
| 52 |
} MHASH_INSTANCE; |
| 53 |
|
| 54 |
typedef MHASH_INSTANCE *MHASH; |
| 55 |
|
| 56 |
#define MHASH_FAILED ((MHASH) 0x0) |
| 57 |
|
| 58 |
#endif |