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, int *rc);
00043
00056 apr_status_t (*make)(apr_crypto_t **f, const apr_crypto_driver_t *provider,
00057 const char *params, apr_pool_t *pool);
00058
00067 apr_status_t (*get_block_key_types)(apr_hash_t **types,
00068 const apr_crypto_t *f);
00069
00078 apr_status_t (*get_block_key_modes)(apr_hash_t **modes,
00079 const apr_crypto_t *f);
00080
00109 apr_status_t (*passphrase)(apr_crypto_key_t **key, apr_size_t *ivSize,
00110 const char *pass, apr_size_t passLen, const unsigned char * salt,
00111 apr_size_t saltLen, const apr_crypto_block_key_type_e type,
00112 const apr_crypto_block_key_mode_e mode, const int doPad,
00113 const int iterations, const apr_crypto_t *f, apr_pool_t *p);
00114
00131 apr_status_t (*block_encrypt_init)(apr_crypto_block_t **ctx,
00132 const unsigned char **iv, const apr_crypto_key_t *key,
00133 apr_size_t *blockSize, apr_pool_t *p);
00134
00153 apr_status_t (*block_encrypt)(unsigned char **out, apr_size_t *outlen,
00154 const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *ctx);
00155
00174 apr_status_t (*block_encrypt_finish)(unsigned char *out,
00175 apr_size_t *outlen, apr_crypto_block_t *ctx);
00176
00192 apr_status_t (*block_decrypt_init)(apr_crypto_block_t **ctx,
00193 apr_size_t *blockSize, const unsigned char *iv,
00194 const apr_crypto_key_t *key, apr_pool_t *p);
00195
00214 apr_status_t (*block_decrypt)(unsigned char **out, apr_size_t *outlen,
00215 const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *ctx);
00216
00235 apr_status_t (*block_decrypt_finish)(unsigned char *out,
00236 apr_size_t *outlen, apr_crypto_block_t *ctx);
00237
00244 apr_status_t (*block_cleanup)(apr_crypto_block_t *ctx);
00245
00252 apr_status_t (*cleanup)(apr_crypto_t *f);
00253
00259 apr_status_t (*shutdown)(void);
00260
00267 apr_status_t (*error)(const apu_err_t **result, const apr_crypto_t *f);
00268
00269 };
00270
00271 #endif
00272
00273 #ifdef __cplusplus
00274 }
00275 #endif
00276
00277 #endif