Mercurial > projects > dcrypt
comparison dcrypt/crypto/hashes/SHA512.d @ 6:5cb17e09d685
Minor edits to the unittests of hash functions and ciphers. Added AES and test vectors.
author | Thomas Dixon <reikon@reikon.us> |
---|---|
date | Sat, 16 Aug 2008 22:43:22 -0400 |
parents | a5789a7b3b3b |
children | 4589f8c5eb3c |
comparison
equal
deleted
inserted
replaced
5:cff9960a019c | 6:5cb17e09d685 |
---|---|
8 | 8 |
9 module dcrypt.crypto.hashes.SHA512; | 9 module dcrypt.crypto.hashes.SHA512; |
10 | 10 |
11 public import dcrypt.crypto.Hash; | 11 public import dcrypt.crypto.Hash; |
12 | 12 |
13 /** Implementation of SHA-512. */ | 13 /** |
14 * Implementation of the US NSA's SHA-512. | |
15 * | |
16 * Conforms: FIPS-180-2 | |
17 * References: http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf | |
18 */ | |
14 class SHA512 : Hash { | 19 class SHA512 : Hash { |
15 private const ulong[] K = [ | 20 private const ulong[] K = [ |
16 0x428a2f98d728ae22u, 0x7137449123ef65cdu, 0xb5c0fbcfec4d3b2fu, 0xe9b5dba58189dbbcu, | 21 0x428a2f98d728ae22u, 0x7137449123ef65cdu, 0xb5c0fbcfec4d3b2fu, 0xe9b5dba58189dbbcu, |
17 0x3956c25bf348b538u, 0x59f111f1b605d019u, 0x923f82a4af194f9bu, 0xab1c5ed5da6d8118u, | 22 0x3956c25bf348b538u, 0x59f111f1b605d019u, 0x923f82a4af194f9bu, 0xab1c5ed5da6d8118u, |
18 0xd807aa98a3030242u, 0x12835b0145706fbeu, 0x243185be4ee4b28cu, 0x550c7dc3d5ffb4e2u, | 23 0xd807aa98a3030242u, 0x12835b0145706fbeu, 0x243185be4ee4b28cu, 0x550c7dc3d5ffb4e2u, |