Loading...
Searching...
No Matches
apr_sha1.h
Go to the documentation of this file.
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* NIST Secure Hash Algorithm
* heavily modified by Uwe Hollerbach uh@alumni.caltech edu
* from Peter C. Gutmann's implementation as found in
* Applied Cryptography by Bruce Schneier
* This code is hereby placed in the public domain
*/
#ifndef APR_SHA1_H
#define APR_SHA1_H
#include "apu.h"
#include "apr_general.h"
#ifdef __cplusplus
extern "C" {
#endif
#define APR_SHA1_DIGESTSIZE 20
#define APR_SHA1PW_ID "{SHA}"
#define APR_SHA1PW_IDLEN 5
typedef struct apr_sha1_ctx_t apr_sha1_ctx_t;
struct apr_sha1_ctx_t {
apr_uint32_t digest[5];
apr_uint32_t count_lo, count_hi;
apr_uint32_t data[16];
int local;
};
APU_DECLARE(void) apr_sha1_base64(const char *clear, int len, char *out);
APU_DECLARE(void) apr_sha1_init(apr_sha1_ctx_t *context);
APU_DECLARE(void) apr_sha1_update(apr_sha1_ctx_t *context, const char *input,
unsigned int inputLen);
APU_DECLARE(void) apr_sha1_update_binary(apr_sha1_ctx_t *context,
const unsigned char *input,
unsigned int inputLen);
APU_DECLARE(void) apr_sha1_final(unsigned char digest[APR_SHA1_DIGESTSIZE],
apr_sha1_ctx_t *context);
#ifdef __cplusplus
}
#endif
#endif /* APR_SHA1_H */
apr_sha1_final
void apr_sha1_final(unsigned char digest[APR_SHA1_DIGESTSIZE], apr_sha1_ctx_t *context)
apr_sha1_base64
void apr_sha1_base64(const char *clear, int len, char *out)
apr_sha1_update_binary
void apr_sha1_update_binary(apr_sha1_ctx_t *context, const unsigned char *input, unsigned int inputLen)
apr_sha1_init
void apr_sha1_init(apr_sha1_ctx_t *context)
apr_sha1_update
void apr_sha1_update(apr_sha1_ctx_t *context, const char *input, unsigned int inputLen)
APR_SHA1_DIGESTSIZE
#define APR_SHA1_DIGESTSIZE
Definition apr_sha1.h:39
apr_sha1_ctx_t
Definition apr_sha1.h:56
apr_sha1_ctx_t::digest
apr_uint32_t digest[5]
Definition apr_sha1.h:58
apr_sha1_ctx_t::local
int local
Definition apr_sha1.h:64
apr_sha1_ctx_t::count_lo
apr_uint32_t count_lo
Definition apr_sha1.h:60
apr_sha1_ctx_t::data
apr_uint32_t data[16]
Definition apr_sha1.h:62