sha512.h (282736) | sha512.h (292782) |
---|---|
1/*- 2 * Copyright 2005 Colin Percival 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright 2005 Colin Percival 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/lib/libmd/sha512.h 282736 2015-05-10 21:21:52Z thomas $ | 26 * $FreeBSD: head/sys/crypto/sha2/sha512.h 292782 2015-12-27 17:33:59Z allanjude $ |
27 */ 28 29#ifndef _SHA512_H_ 30#define _SHA512_H_ 31 | 27 */ 28 29#ifndef _SHA512_H_ 30#define _SHA512_H_ 31 |
32#ifndef _KERNEL |
|
32#include <sys/types.h> | 33#include <sys/types.h> |
34#endif |
|
33 | 35 |
36#define SHA512_BLOCK_LENGTH 128 37#define SHA512_DIGEST_LENGTH 64 38#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) 39 |
|
34typedef struct SHA512Context { 35 uint64_t state[8]; 36 uint64_t count[2]; | 40typedef struct SHA512Context { 41 uint64_t state[8]; 42 uint64_t count[2]; |
37 unsigned char buf[128]; | 43 uint8_t buf[SHA512_BLOCK_LENGTH]; |
38} SHA512_CTX; 39 40__BEGIN_DECLS 41 42/* Ensure libmd symbols do not clash with libcrypto */ | 44} SHA512_CTX; 45 46__BEGIN_DECLS 47 48/* Ensure libmd symbols do not clash with libcrypto */ |
43 | |
44#ifndef SHA512_Init 45#define SHA512_Init _libmd_SHA512_Init 46#endif 47#ifndef SHA512_Update 48#define SHA512_Update _libmd_SHA512_Update 49#endif 50#ifndef SHA512_Final 51#define SHA512_Final _libmd_SHA512_Final --- 15 unchanged lines hidden (view full) --- 67#define SHA512_Transform _libmd_SHA512_Transform 68#endif 69#ifndef SHA512_version 70#define SHA512_version _libmd_SHA512_version 71#endif 72 73void SHA512_Init(SHA512_CTX *); 74void SHA512_Update(SHA512_CTX *, const void *, size_t); | 49#ifndef SHA512_Init 50#define SHA512_Init _libmd_SHA512_Init 51#endif 52#ifndef SHA512_Update 53#define SHA512_Update _libmd_SHA512_Update 54#endif 55#ifndef SHA512_Final 56#define SHA512_Final _libmd_SHA512_Final --- 15 unchanged lines hidden (view full) --- 72#define SHA512_Transform _libmd_SHA512_Transform 73#endif 74#ifndef SHA512_version 75#define SHA512_version _libmd_SHA512_version 76#endif 77 78void SHA512_Init(SHA512_CTX *); 79void SHA512_Update(SHA512_CTX *, const void *, size_t); |
75void SHA512_Final(unsigned char [64], SHA512_CTX *); | 80void SHA512_Final(unsigned char [SHA512_DIGEST_LENGTH], SHA512_CTX *); 81#ifndef _KERNEL |
76char *SHA512_End(SHA512_CTX *, char *); | 82char *SHA512_End(SHA512_CTX *, char *); |
83char *SHA512_Data(const void *, unsigned int, char *); |
|
77char *SHA512_File(const char *, char *); 78char *SHA512_FileChunk(const char *, char *, off_t, off_t); | 84char *SHA512_File(const char *, char *); 85char *SHA512_FileChunk(const char *, char *, off_t, off_t); |
79char *SHA512_Data(const void *, unsigned int, char *); | 86#endif 87 |
80__END_DECLS 81 82#endif /* !_SHA512_H_ */ | 88__END_DECLS 89 90#endif /* !_SHA512_H_ */ |