1 /* Declaration of functions and data types used for SHA512 sum computing
3 Copyright (C) 2007 Free Software Foundation, Inc.
5 Copied here from the GNU C Library version 2.7 on the 10 May 2009
6 by Steve McIntyre <93sam@debian.org>. This code was under GPL v2.1
7 in glibc, and that license gives us the option to use and
8 distribute the code under the terms of the GPL v2 instead. I'm
11 This program is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2, or (at your option) any
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
33 /* Structure to save state of computation between the single steps. */
40 char buffer[256] __attribute__ ((__aligned__ (__alignof__ (uint64_t))));
43 /* Initialize structure containing state of computation.
44 (FIPS 180-2: 5.3.3) */
45 extern void sha512_init_ctx (struct sha512_ctx *ctx) __THROW;
47 /* Starting with the result of former calls of this function (or the
48 initialization function update the context for the next LEN bytes
50 It is NOT required that LEN is a multiple of 128. */
51 extern void sha512_process_bytes (const void *buffer, size_t len,
52 struct sha512_ctx *ctx) __THROW;
54 /* Process the remaining bytes in the buffer and put result from CTX
55 in first 64 bytes following RESBUF.
57 IMPORTANT: On some systems it is required that RESBUF is correctly
58 aligned for a 64 bits value. */
59 extern void *sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf)