00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef APR_SHA1_H
00024 #define APR_SHA1_H
00025
00026 #include "apu.h"
00027 #include "apr_general.h"
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00039 #define APR_SHA1_DIGESTSIZE 20
00040
00045 #define APR_SHA1PW_ID "{SHA}"
00046
00048 #define APR_SHA1PW_IDLEN 5
00049
00051 typedef struct apr_sha1_ctx_t apr_sha1_ctx_t;
00052
00056 struct apr_sha1_ctx_t {
00058 apr_uint32_t digest[5];
00060 apr_uint32_t count_lo, count_hi;
00062 apr_uint32_t data[16];
00064 int local;
00065 };
00066
00082 APU_DECLARE(void) apr_sha1_base64(const char *clear, int len, char *out);
00083
00088 APU_DECLARE(void) apr_sha1_init(apr_sha1_ctx_t *context);
00089
00096 APU_DECLARE(void) apr_sha1_update(apr_sha1_ctx_t *context, const char *input,
00097 unsigned int inputLen);
00098
00105 APU_DECLARE(void) apr_sha1_update_binary(apr_sha1_ctx_t *context,
00106 const unsigned char *input,
00107 unsigned int inputLen);
00108
00114 APU_DECLARE(void) apr_sha1_final(unsigned char digest[APR_SHA1_DIGESTSIZE],
00115 apr_sha1_ctx_t *context);
00116
00117 #ifdef __cplusplus
00118 }
00119 #endif
00120
00121 #endif