2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 * AUTHOR: Aaron D. Gifford <me@aarongifford.com>
21 * A licence was granted to the ASF by Aaron on 4 November 2003.
29 /*** SHA-256 Various Length Definitions ***********************/
30 #define SECKM_SHA256_BLOCK_LENGTH 64
31 #define SECKM_SHA256_DIGEST_LENGTH 32
32 #define SECKM_SHA256_DIGEST_STRING_LENGTH (SECKM_SHA256_DIGEST_LENGTH * 2 + 1)
35 /*** SHA-256 Context Structures *******************************/
36 typedef struct _SECKM_SHA256_CTX {
39 unsigned char buffer[SECKM_SHA256_BLOCK_LENGTH];
43 /*** SHA-256 Function Prototypes ******************************/
44 void SECKM_SHA256_Init(SECKM_SHA256_CTX *);
45 void SECKM_SHA256_Update(SECKM_SHA256_CTX *, const unsigned char *, size_t);
46 void SECKM_SHA256_Final(SECKM_SHA256_CTX *, unsigned char [SECKM_SHA256_DIGEST_LENGTH]);
48 #endif /* __SHA2_H__ */