00001
00029 #ifndef POLARSSL_PKCS5_H
00030 #define POLARSSL_PKCS5_H
00031
00032 #include <string.h>
00033
00034 #include "asn1.h"
00035 #include "md.h"
00036
00037 #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
00038 #include <basetsd.h>
00039 typedef UINT32 uint32_t;
00040 #else
00041 #include <inttypes.h>
00042 #endif
00043
00044 #define POLARSSL_ERR_PKCS5_BAD_INPUT_DATA -0x3f80
00045 #define POLARSSL_ERR_PKCS5_INVALID_FORMAT -0x3f00
00046 #define POLARSSL_ERR_PKCS5_FEATURE_UNAVAILABLE -0x3e80
00047 #define POLARSSL_ERR_PKCS5_PASSWORD_MISMATCH -0x3e00
00049 #define PKCS5_DECRYPT 0
00050 #define PKCS5_ENCRYPT 1
00051
00052 #ifdef __cplusplus
00053 extern "C" {
00054 #endif
00055
00069 int pkcs5_pbes2( asn1_buf *pbe_params, int mode,
00070 const unsigned char *pwd, size_t pwdlen,
00071 const unsigned char *data, size_t datalen,
00072 unsigned char *output );
00073
00088 int pkcs5_pbkdf2_hmac( md_context_t *ctx, const unsigned char *password,
00089 size_t plen, const unsigned char *salt, size_t slen,
00090 unsigned int iteration_count,
00091 uint32_t key_length, unsigned char *output );
00092
00098 int pkcs5_self_test( int verbose );
00099
00100 #ifdef __cplusplus
00101 }
00102 #endif
00103
00104 #endif