1 /* Copyright (c) 2004 X-Way Rights BV 2 * 3 * This library is free software; you can redistribute it and/or 4 * modify it under the terms of the GNU Lesser General Public 5 * License as published by the Free Software Foundation; either 6 * version 2.1 of the License, or (at your option) any later version. 7 * 8 * This library is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * Lesser General Public License for more details. 12 * 13 * You should have received a copy of the GNU Lesser General Public 14 * License along with this library; if not, write to the Free Software 15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * 17 */ 18 19 /*!\file sha2k64.c 20 * \brief SHA-512 and SHA-384 hash function constants, as specified by NIST FIPS 180-2. 21 * \author Bob Deblier <bob.deblier@telenet.be> 22 * \ingroup HASH_sha512_m HASH_sha_384_m 23 */ 24 25 #define BEECRYPT_DLL_EXPORT 26 27 #if HAVE_CONFIG_H 28 # include "config.h" 29 #endif 30 31 #include "beecrypt/sha2k64.h" 32 33 const uint64_t SHA2_64BIT_K[80] = { 34 #if (SIZEOF_UNSIGNED_LONG == 8) || !HAVE_UNSIGNED_LONG_LONG 35 0x428a2f98d728ae22UL, 0x7137449123ef65cdUL, 36 0xb5c0fbcfec4d3b2fUL, 0xe9b5dba58189dbbcUL, 37 0x3956c25bf348b538UL, 0x59f111f1b605d019UL, 38 0x923f82a4af194f9bUL, 0xab1c5ed5da6d8118UL, 39 0xd807aa98a3030242UL, 0x12835b0145706fbeUL, 40 0x243185be4ee4b28cUL, 0x550c7dc3d5ffb4e2UL, 41 0x72be5d74f27b896fUL, 0x80deb1fe3b1696b1UL, 42 0x9bdc06a725c71235UL, 0xc19bf174cf692694UL, 43 0xe49b69c19ef14ad2UL, 0xefbe4786384f25e3UL, 44 0x0fc19dc68b8cd5b5UL, 0x240ca1cc77ac9c65UL, 45 0x2de92c6f592b0275UL, 0x4a7484aa6ea6e483UL, 46 0x5cb0a9dcbd41fbd4UL, 0x76f988da831153b5UL, 47 0x983e5152ee66dfabUL, 0xa831c66d2db43210UL, 48 0xb00327c898fb213fUL, 0xbf597fc7beef0ee4UL, 49 0xc6e00bf33da88fc2UL, 0xd5a79147930aa725UL, 50 0x06ca6351e003826fUL, 0x142929670a0e6e70UL, 51 0x27b70a8546d22ffcUL, 0x2e1b21385c26c926UL, 52 0x4d2c6dfc5ac42aedUL, 0x53380d139d95b3dfUL, 53 0x650a73548baf63deUL, 0x766a0abb3c77b2a8UL, 54 0x81c2c92e47edaee6UL, 0x92722c851482353bUL, 55 0xa2bfe8a14cf10364UL, 0xa81a664bbc423001UL, 56 0xc24b8b70d0f89791UL, 0xc76c51a30654be30UL, 57 0xd192e819d6ef5218UL, 0xd69906245565a910UL, 58 0xf40e35855771202aUL, 0x106aa07032bbd1b8UL, 59 0x19a4c116b8d2d0c8UL, 0x1e376c085141ab53UL, 60 0x2748774cdf8eeb99UL, 0x34b0bcb5e19b48a8UL, 61 0x391c0cb3c5c95a63UL, 0x4ed8aa4ae3418acbUL, 62 0x5b9cca4f7763e373UL, 0x682e6ff3d6b2b8a3UL, 63 0x748f82ee5defb2fcUL, 0x78a5636f43172f60UL, 64 0x84c87814a1f0ab72UL, 0x8cc702081a6439ecUL, 65 0x90befffa23631e28UL, 0xa4506cebde82bde9UL, 66 0xbef9a3f7b2c67915UL, 0xc67178f2e372532bUL, 67 0xca273eceea26619cUL, 0xd186b8c721c0c207UL, 68 0xeada7dd6cde0eb1eUL, 0xf57d4f7fee6ed178UL, 69 0x06f067aa72176fbaUL, 0x0a637dc5a2c898a6UL, 70 0x113f9804bef90daeUL, 0x1b710b35131c471bUL, 71 0x28db77f523047d84UL, 0x32caab7b40c72493UL, 72 0x3c9ebe0a15c9bebcUL, 0x431d67c49c100d4cUL, 73 0x4cc5d4becb3e42b6UL, 0x597f299cfc657e2aUL, 74 0x5fcb6fab3ad6faecUL, 0x6c44198c4a475817UL 75 #else 76 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 77 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, 78 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, 79 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 80 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, 81 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, 82 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 83 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, 84 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, 85 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, 86 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, 87 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, 88 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 89 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, 90 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, 91 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, 92 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, 93 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, 94 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 95 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, 96 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, 97 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, 98 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, 99 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, 100 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 101 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, 102 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, 103 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, 104 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, 105 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, 106 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 107 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, 108 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, 109 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, 110 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, 111 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, 112 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 113 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, 114 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, 115 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL 116 #endif 117 }; 118