TuyaOS
apr_sha1.h
浏览该文件的文档.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16/* NIST Secure Hash Algorithm
17 * heavily modified by Uwe Hollerbach uh@alumni.caltech edu
18 * from Peter C. Gutmann's implementation as found in
19 * Applied Cryptography by Bruce Schneier
20 * This code is hereby placed in the public domain
21 */
22
23#ifndef APR_SHA1_H
24#define APR_SHA1_H
25
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
37#define APR_SHA1_DIGESTSIZE 20
38
43#define APR_SHA1PW_ID "{SHA}"
44
46#define APR_SHA1PW_IDLEN 5
47
50
56 unsigned int digest[5];
58 unsigned int count_lo, count_hi;
60 unsigned int data[16];
62 int local;
63};
64
70
77void apr_sha1_update(apr_sha1_ctx_t *context, const char *input,
78 unsigned int inputLen);
79
87 const unsigned char *input,
88 unsigned int inputLen);
89
95void apr_sha1_final(unsigned char digest[APR_SHA1_DIGESTSIZE],
96 apr_sha1_ctx_t *context);
97
98//calculate HMAC_SHA1
99void HMAC_SHA1(unsigned char hmac[20], const unsigned char *key, int key_len,
100 const unsigned char *message, int message_len);
101
102
103#ifdef __cplusplus
104}
105#endif
106
107#endif /* APR_SHA1_H */
void apr_sha1_update_binary(apr_sha1_ctx_t *context, const unsigned char *input, unsigned int inputLen)
void apr_sha1_final(unsigned char digest[20], apr_sha1_ctx_t *context)
void apr_sha1_init(apr_sha1_ctx_t *context)
void apr_sha1_update(apr_sha1_ctx_t *context, const char *input, unsigned int inputLen)
#define APR_SHA1_DIGESTSIZE
Definition: apr_sha1.h:37
Definition: apr_sha1.h:54
unsigned int data[16]
Definition: apr_sha1.h:60
int local
Definition: apr_sha1.h:62
unsigned int count_lo
Definition: apr_sha1.h:58
unsigned int digest[5]
Definition: apr_sha1.h:56