2 // System.Security.Cryptography.SHAConstants.cs
4 // Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
6 // Permission is hereby granted, free of charge, to any person obtaining
7 // a copy of this software and associated documentation files (the
8 // "Software"), to deal in the Software without restriction, including
9 // without limitation the rights to use, copy, modify, merge, publish,
10 // distribute, sublicense, and/or sell copies of the Software, and to
11 // permit persons to whom the Software is furnished to do so, subject to
12 // the following conditions:
14 // The above copyright notice and this permission notice shall be
15 // included in all copies or substantial portions of the Software.
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 namespace System
.Security
.Cryptography
{
28 internal static class SHAConstants
{
30 // Represent the first 32 bits of the fractional parts of the
31 // cube roots of the first sixty-four prime numbers
32 public readonly static uint[] K1
= {
33 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
34 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
35 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
36 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
37 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
38 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
39 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
40 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
41 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
42 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
43 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
44 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
45 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
46 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
47 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
48 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
51 // SHA-384 and SHA-512 Constants
52 // Represent the first 64 bits of the fractional parts of the
53 // cube roots of the first sixty-four prime numbers
54 public readonly static ulong[] K2
= {
55 0x428a2f98d728ae22L
, 0x7137449123ef65cdL
, 0xb5c0fbcfec4d3b2fL
, 0xe9b5dba58189dbbcL
,
56 0x3956c25bf348b538L
, 0x59f111f1b605d019L
, 0x923f82a4af194f9bL
, 0xab1c5ed5da6d8118L
,
57 0xd807aa98a3030242L
, 0x12835b0145706fbeL
, 0x243185be4ee4b28cL
, 0x550c7dc3d5ffb4e2L
,
58 0x72be5d74f27b896fL
, 0x80deb1fe3b1696b1L
, 0x9bdc06a725c71235L
, 0xc19bf174cf692694L
,
59 0xe49b69c19ef14ad2L
, 0xefbe4786384f25e3L
, 0x0fc19dc68b8cd5b5L
, 0x240ca1cc77ac9c65L
,
60 0x2de92c6f592b0275L
, 0x4a7484aa6ea6e483L
, 0x5cb0a9dcbd41fbd4L
, 0x76f988da831153b5L
,
61 0x983e5152ee66dfabL
, 0xa831c66d2db43210L
, 0xb00327c898fb213fL
, 0xbf597fc7beef0ee4L
,
62 0xc6e00bf33da88fc2L
, 0xd5a79147930aa725L
, 0x06ca6351e003826fL
, 0x142929670a0e6e70L
,
63 0x27b70a8546d22ffcL
, 0x2e1b21385c26c926L
, 0x4d2c6dfc5ac42aedL
, 0x53380d139d95b3dfL
,
64 0x650a73548baf63deL
, 0x766a0abb3c77b2a8L
, 0x81c2c92e47edaee6L
, 0x92722c851482353bL
,
65 0xa2bfe8a14cf10364L
, 0xa81a664bbc423001L
, 0xc24b8b70d0f89791L
, 0xc76c51a30654be30L
,
66 0xd192e819d6ef5218L
, 0xd69906245565a910L
, 0xf40e35855771202aL
, 0x106aa07032bbd1b8L
,
67 0x19a4c116b8d2d0c8L
, 0x1e376c085141ab53L
, 0x2748774cdf8eeb99L
, 0x34b0bcb5e19b48a8L
,
68 0x391c0cb3c5c95a63L
, 0x4ed8aa4ae3418acbL
, 0x5b9cca4f7763e373L
, 0x682e6ff3d6b2b8a3L
,
69 0x748f82ee5defb2fcL
, 0x78a5636f43172f60L
, 0x84c87814a1f0ab72L
, 0x8cc702081a6439ecL
,
70 0x90befffa23631e28L
, 0xa4506cebde82bde9L
, 0xbef9a3f7b2c67915L
, 0xc67178f2e372532bL
,
71 0xca273eceea26619cL
, 0xd186b8c721c0c207L
, 0xeada7dd6cde0eb1eL
, 0xf57d4f7fee6ed178L
,
72 0x06f067aa72176fbaL
, 0x0a637dc5a2c898a6L
, 0x113f9804bef90daeL
, 0x1b710b35131c471bL
,
73 0x28db77f523047d84L
, 0x32caab7b40c72493L
, 0x3c9ebe0a15c9bebcL
, 0x431d67c49c100d4cL
,
74 0x4cc5d4becb3e42b6L
, 0x597f299cfc657e2aL
, 0x5fcb6fab3ad6faecL
, 0x6c44198c4a475817L