Mercurial > projects > dcrypt
comparison dcrypt/crypto/macs/HMAC.d @ 26:176c933827a8
Implemented MD4. Refactored MD5. Replaced all instances of 'version (UnitTest)' with 'debug (UnitTest)'.
author | Thomas Dixon <reikon@reikon.us> |
---|---|
date | Sun, 01 Mar 2009 13:06:48 -0500 |
parents | 4589f8c5eb3c |
children | 8b5eaf3c2979 |
comparison
equal
deleted
inserted
replaced
25:528676d20398 | 26:176c933827a8 |
---|---|
11 import dcrypt.crypto.MAC; | 11 import dcrypt.crypto.MAC; |
12 import dcrypt.crypto.Hash; | 12 import dcrypt.crypto.Hash; |
13 import dcrypt.crypto.params.SymmetricKey; | 13 import dcrypt.crypto.params.SymmetricKey; |
14 import dcrypt.crypto.errors.NotInitializedError; | 14 import dcrypt.crypto.errors.NotInitializedError; |
15 | 15 |
16 version (UnitTest) { | 16 debug (UnitTest) { |
17 import dcrypt.crypto.hashes.SHA1; | 17 import dcrypt.crypto.hashes.SHA1; |
18 } | 18 } |
19 | 19 |
20 /** | 20 /** |
21 * Implementation of Keyed-Hash Message Authentication Code (HMAC) | 21 * Implementation of Keyed-Hash Message Authentication Code (HMAC) |
111 h.hash = hash.copy(); | 111 h.hash = hash.copy(); |
112 h.initialized = true; | 112 h.initialized = true; |
113 return h; | 113 return h; |
114 } | 114 } |
115 | 115 |
116 version (UnitTest) { | 116 debug (UnitTest) { |
117 unittest { | 117 unittest { |
118 static char[][] test_keys = [ | 118 static char[][] test_keys = [ |
119 "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", | 119 "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", |
120 "4a656665", // Jefe? | 120 "4a656665", // Jefe? |
121 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | 121 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", |