Mercurial > projects > dcrypt
comparison dcrypt/crypto/hashes/SHA256.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.SHA256; | 9 module dcrypt.crypto.hashes.SHA256; |
10 | 10 |
11 public import dcrypt.crypto.Hash; | 11 public import dcrypt.crypto.Hash; |
12 | 12 |
13 /** Implementation of SHA-256. */ | 13 /** |
14 * Implementation of the US NSA's SHA-256. | |
15 * | |
16 * Conforms: FIPS-180-2 | |
17 * References: http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf | |
18 */ | |
14 class SHA256 : Hash { | 19 class SHA256 : Hash { |
15 private const uint[] K = [ | 20 private const uint[] K = [ |
16 0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, | 21 0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, |
17 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u, | 22 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u, |
18 0xd807aa98u, 0x12835b01u, 0x243185beu, 0x550c7dc3u, | 23 0xd807aa98u, 0x12835b01u, 0x243185beu, 0x550c7dc3u, |