00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef APR_CRYPTO_INTERNAL_H
00018 #define APR_CRYPTO_INTERNAL_H
00019
00020 #include <stdarg.h>
00021
00022 #include "apr_crypto.h"
00023
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027
00028 #if APU_HAVE_CRYPTO
00029
00030 struct apr_crypto_driver_t {
00031
00033 const char *name;
00034
00042 apr_status_t (*init)(apr_pool_t *pool, const char *params,
00043 const apu_err_t **result);
00044
00057 apr_status_t (*make)(apr_crypto_t **f, const apr_crypto_driver_t *provider,
00058 const char *params, apr_pool_t *pool);
00059
00068 apr_status_t (*get_block_key_types)(apr_hash_t **types,
00069 const apr_crypto_t *f);
00070
00079 apr_status_t (*get_block_key_modes)(apr_hash_t **modes,
00080 const apr_crypto_t *f);
00081
00110 apr_status_t (*passphrase)(apr_crypto_key_t **key, apr_size_t *ivSize,
00111 const char *pass, apr_size_t passLen, const unsigned char * salt,
00112 apr_size_t saltLen, const apr_crypto_block_key_type_e type,
00113 const apr_crypto_block_key_mode_e mode, const int doPad,
00114 const int iterations, const apr_crypto_t *f, apr_pool_t *p);
00115
00132 apr_status_t (*block_encrypt_init)(apr_crypto_block_t **ctx,
00133 const unsigned char **iv, const apr_crypto_key_t *key,
00134 apr_size_t *blockSize, apr_pool_t *p);
00135
00154 apr_status_t (*block_encrypt)(unsigned char **out, apr_size_t *outlen,
00155 const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *ctx);
00156
00175 apr_status_t (*block_encrypt_finish)(unsigned char *out,
00176 apr_size_t *outlen, apr_crypto_block_t *ctx);
00177
00193 apr_status_t (*block_decrypt_init)(apr_crypto_block_t **ctx,
00194 apr_size_t *blockSize, const unsigned char *iv,
00195 const apr_crypto_key_t *key, apr_pool_t *p);
00196
00215 apr_status_t (*block_decrypt)(unsigned char **out, apr_size_t *outlen,
00216 const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *ctx);
00217
00236 apr_status_t (*block_decrypt_finish)(unsigned char *out,
00237 apr_size_t *outlen, apr_crypto_block_t *ctx);
00238
00245 apr_status_t (*block_cleanup)(apr_crypto_block_t *ctx);
00246
00253 apr_status_t (*cleanup)(apr_crypto_t *f);
00254
00260 apr_status_t (*shutdown)(void);
00261
00268 apr_status_t (*error)(const apu_err_t **result, const apr_crypto_t *f);
00269
00270 };
00271
00272 #endif
00273
00274 #ifdef __cplusplus
00275 }
00276 #endif
00277
00278 #endif