1220496Smarkm/*-
2220496Smarkm * Copyright 2005 Colin Percival
3220496Smarkm * All rights reserved.
4220496Smarkm *
5220496Smarkm * Redistribution and use in source and binary forms, with or without
6220496Smarkm * modification, are permitted provided that the following conditions
7220496Smarkm * are met:
8220496Smarkm * 1. Redistributions of source code must retain the above copyright
9220496Smarkm *    notice, this list of conditions and the following disclaimer.
10220496Smarkm * 2. Redistributions in binary form must reproduce the above copyright
11220496Smarkm *    notice, this list of conditions and the following disclaimer in the
12220496Smarkm *    documentation and/or other materials provided with the distribution.
13220496Smarkm *
14220496Smarkm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15220496Smarkm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16220496Smarkm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17220496Smarkm * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18220496Smarkm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19220496Smarkm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20220496Smarkm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21220496Smarkm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22220496Smarkm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23220496Smarkm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24220496Smarkm * SUCH DAMAGE.
25220496Smarkm *
26220496Smarkm * $FreeBSD$
27220496Smarkm */
28220496Smarkm
29220496Smarkm#ifndef _SHA512_H_
30220496Smarkm#define _SHA512_H_
31220496Smarkm
32220496Smarkm#include <sys/types.h>
33220496Smarkm
34220496Smarkmtypedef struct SHA512Context {
35220496Smarkm	uint64_t state[8];
36220496Smarkm	uint64_t count[2];
37220496Smarkm	unsigned char buf[128];
38220496Smarkm} SHA512_CTX;
39220496Smarkm
40220496Smarkm__BEGIN_DECLS
41220496Smarkmvoid	SHA512_Init(SHA512_CTX *);
42220496Smarkmvoid	SHA512_Update(SHA512_CTX *, const void *, size_t);
43220496Smarkmvoid	SHA512_Final(unsigned char [64], SHA512_CTX *);
44220496Smarkmchar   *SHA512_End(SHA512_CTX *, char *);
45220496Smarkmchar   *SHA512_File(const char *, char *);
46220496Smarkmchar   *SHA512_FileChunk(const char *, char *, off_t, off_t);
47220496Smarkmchar   *SHA512_Data(const void *, unsigned int, char *);
48220496Smarkm__END_DECLS
49220496Smarkm
50220496Smarkm#endif /* !_SHA512_H_ */
51