]>
git.ipfire.org Git - people/ms/strongswan.git/blob - lib/libcrypto/libsha2/sha2.h
6 * Written by Jari Ruusu, April 16 2001
8 * Copyright 2001 by Jari Ruusu.
9 * Redistribution of this file is permitted under the GNU Public License.
13 #include <linux/types.h>
15 #include <sys/types.h>
19 unsigned char sha_out
[64]; /* results are here, bytes 0...31 */
26 unsigned char sha_out
[128]; /* results are here, bytes 0...63 */
29 u_int64_t sha_blocksMSB
;
33 /* no sha384_context, use sha512_context */
35 /* 256 bit hash, provides 128 bits of security against collision attacks */
36 extern void sha256_init(sha256_context
*);
37 extern void sha256_write(sha256_context
*, const unsigned char *, int);
38 extern void sha256_final(sha256_context
*);
39 extern void sha256_hash_buffer(unsigned char *, int, unsigned char *, int);
41 /* 512 bit hash, provides 256 bits of security against collision attacks */
42 extern void sha512_init(sha512_context
*);
43 extern void sha512_write(sha512_context
*, const unsigned char *, int);
44 extern void sha512_final(sha512_context
*);
45 extern void sha512_hash_buffer(unsigned char *, int, unsigned char *, int);
47 /* 384 bit hash, provides 192 bits of security against collision attacks */
48 extern void sha384_init(sha512_context
*);
49 /* no sha384_write(), use sha512_write() */
50 /* no sha384_final(), use sha512_final(), result in ctx->sha_out[0...47] */
51 extern void sha384_hash_buffer(unsigned char *, int, unsigned char *, int);