Debian Codegraph @

src/SHA512.c

raw symbols SCIP
1 /*
2 * An implementation of the SHA-512 hash function.
3 *
4 * The Federal Information Processing Standards (FIPS) Specification
5 * can be found here (FIPS 180-3):
6 * http://csrc.nist.gov/publications/PubsFIPS.html
7 *
8 * Written in 2010 by Lorenz Quack <[email protected]>
9 *
10 * ===================================================================
11 * The contents of this file are dedicated to the public domain. To
12 * the extent that dedication to the public domain is not available,
13 * everyone is granted a worldwide, perpetual, royalty-free,
14 * non-exclusive license to exercise all rights associated with the
15 * contents of this file for any purpose whatsoever.
16 * No rights are reserved.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
22 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 * ===================================================================
27 *
28 */
29
30 #define MODULE_NAME SHA512
31 #define DIGEST_SIZE (512/8)
32 #define WORD_SIZE 8
33
34 #include "common.h"
35
36 /* Initial Values H for SHA-512, SHA-512/224 and SHA-512/256 */
37 static const uint64_t H_SHA_512[3][8] = {
38 {
39 0x6a09e667f3bcc908ULL,
40 0xbb67ae8584caa73bULL,
41 0x3c6ef372fe94f82bULL,
42 0xa54ff53a5f1d36f1ULL,
43 0x510e527fade682d1ULL,
44 0x9b05688c2b3e6c1fULL,
45 0x1f83d9abfb41bd6bULL,
46 0x5be0cd19137e2179ULL
47 },
48 {
49 0x8C3D37C819544DA2ULL,
50 0x73E1996689DCD4D6ULL,
51 0x1DFAB7AE32FF9C82ULL,
52 0x679DD514582F9FCFULL,
53 0x0F6D2B697BD44DA8ULL,
54 0x77E36F7304C48942ULL,
55 0x3F9D85A86A1D36C8ULL,
56 0x1112E6AD91D692A1ULL
57 },
58 {
59 0x22312194FC2BF72CULL,
60 0x9F555FA3C84C64C2ULL,
61 0x2393B86B6F53B151ULL,
62 0x963877195940EABDULL,
63 0x96283EE2A88EFFE3ULL,
64 0xBE5E1E2553863992ULL,
65 0x2B0199FC2C85B8AAULL,
66 0x0EB72DDC81C52CA2ULL
67 }
68 };
69
70 #include "hash_SHA2_template.c"