Apache2
sha2.h
Go to the documentation of this file.
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 /*
17  * FILE: sha2.h
18  * AUTHOR: Aaron D. Gifford <me@aarongifford.com>
19  *
20  * A licence was granted to the ASF by Aaron on 4 November 2003.
21  */
22 
23 #ifndef __SHA2_H__
24 #define __SHA2_H__
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #include "apr.h"
31 
32 /*** SHA-256 Various Length Definitions ***********************/
33 #define SHA256_BLOCK_LENGTH 64
34 #define SHA256_DIGEST_LENGTH 32
35 #define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1)
36 
37 
38 /*** SHA-256/384/512 Context Structures *******************************/
39 typedef struct _SHA256_CTX {
44 
45 
46 /*** SHA-256/384/512 Function Prototypes ******************************/
48 void apr__SHA256_Update(SHA256_CTX *, const apr_byte_t *, size_t);
51 char* apr__SHA256_Data(const apr_byte_t *, size_t,
53 
54 #ifdef __cplusplus
55 }
56 #endif /* __cplusplus */
57 
58 #endif /* __SHA2_H__ */
59 
APR Platform Definitions.
unsigned int apr_uint32_t
Definition: apr.h:348
unsigned char apr_byte_t
Definition: apr.h:342
uint64_t apr_uint64_t
Definition: apr.h:387
#define SHA256_DIGEST_STRING_LENGTH
Definition: sha2.h:35
#define SHA256_DIGEST_LENGTH
Definition: sha2.h:34
char * apr__SHA256_Data(const apr_byte_t *, size_t, char[SHA256_DIGEST_STRING_LENGTH])
void apr__SHA256_Update(SHA256_CTX *, const apr_byte_t *, size_t)
char * apr__SHA256_End(SHA256_CTX *, char[SHA256_DIGEST_STRING_LENGTH])
struct _SHA256_CTX SHA256_CTX
void apr__SHA256_Init(SHA256_CTX *)
void apr__SHA256_Final(apr_byte_t[SHA256_DIGEST_LENGTH], SHA256_CTX *)
#define SHA256_BLOCK_LENGTH
Definition: sha2.h:33
Definition: sha2.h:39
apr_byte_t buffer[SHA256_BLOCK_LENGTH]
Definition: sha2.h:42
apr_uint32_t state[8]
Definition: sha2.h:40
apr_uint64_t bitcount
Definition: sha2.h:41