|
Packit |
13e0ca |
/* Declaration of functions and data types used for SHA512 sum computing
|
|
Packit |
13e0ca |
library functions.
|
|
Packit |
13e0ca |
Copyright (C) 2007-2017 Free Software Foundation, Inc.
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
This library is free software; you can redistribute it and/or
|
|
Packit |
13e0ca |
modify it under the terms of the GNU Lesser General Public License
|
|
Packit |
13e0ca |
as published by the Free Software Foundation; either version 2.1 of
|
|
Packit |
13e0ca |
the License, or (at your option) any later version.
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
This library is distributed in the hope that it will be useful,
|
|
Packit |
13e0ca |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
13e0ca |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
13e0ca |
GNU Lesser General Public License for more details.
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
13e0ca |
License along with this library; if not, see
|
|
Packit |
13e0ca |
<https://www.gnu.org/licenses/>. */
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
#ifndef _CRYPT_ALG_SHA512_H
|
|
Packit |
13e0ca |
#define _CRYPT_ALG_SHA512_H 1
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
/* Structure to save state of computation between the single steps. */
|
|
Packit |
13e0ca |
struct sha512_ctx
|
|
Packit |
13e0ca |
{
|
|
Packit |
13e0ca |
uint64_t H[8];
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
uint64_t total[2];
|
|
Packit |
13e0ca |
uint32_t buflen;
|
|
Packit |
13e0ca |
unsigned char buffer[256];
|
|
Packit |
13e0ca |
};
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
/* Initialize structure containing state of computation.
|
|
Packit |
13e0ca |
(FIPS 180-2: 5.3.3) */
|
|
Packit |
13e0ca |
extern void sha512_init_ctx (struct sha512_ctx *ctx);
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
/* Starting with the result of former calls of this function (or the
|
|
Packit |
13e0ca |
initialization function) update the context for the next LEN bytes
|
|
Packit |
13e0ca |
starting at BUFFER. LEN does not need to be a multiple of 128. */
|
|
Packit |
13e0ca |
extern void sha512_process_bytes (const void *buffer, size_t len,
|
|
Packit |
13e0ca |
struct sha512_ctx *ctx);
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
/* Process the remaining bytes in the buffer and write the finalized
|
|
Packit |
13e0ca |
hash to RESBUF, which should point to 64 bytes of storage. */
|
|
Packit |
13e0ca |
extern void *sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf);
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
#endif /* alg-sha512.h */
|