Select Git revision
test-oop.c
Forked from
liboop / liboop
Source project has a limited visibility.
-
Niels Möller authoredNiels Möller authored
sha512.c 8.00 KiB
/* sha512.c
The sha512 hash function.
See http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf
Copyright (C) 2001, 2010 Niels Möller
Copyright (C) 2014 Joachim Strömbergson
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your
option) any later version.
or both in parallel, as here.
GNU Nettle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see http://www.gnu.org/licenses/.
*/
/* Modelled after the sha1.c code by Peter Gutmann. */
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "sha2.h"
#include "sha2-internal.h"
#include "macros.h"
/* Generated by the gp script
{
print("obase=16");
for (i = 1,80,
root = prime(i)^(1/3);
fraction = root - floor(root);
print(floor(2^64 * fraction));
);
quit();
}
piped through
|grep -v '^[' | bc \
|awk '{printf("0x%sULL,%s", $1, NR%3 == 0 ? "\n" : "");}'
to convert it to hex.
*/