Mercurial > projects > dcrypt
comparison dcrypt/crypto/ciphers/RC6.d @ 2:71aae178f89a
Added copy() to hash functions. Modified some code style.
author | Thomas Dixon <reikon@reikon.us> |
---|---|
date | Wed, 13 Aug 2008 22:01:19 -0400 |
parents | 483e4467b5f6 |
children | 5cb17e09d685 |
comparison
equal
deleted
inserted
replaced
1:483e4467b5f6 | 2:71aae178f89a |
---|---|
194 // Encryption | 194 // Encryption |
195 t.init(true, key); | 195 t.init(true, key); |
196 t.processBlock(Util.hexToUbytes(test_plaintexts[i]), 0, buffer, 0); | 196 t.processBlock(Util.hexToUbytes(test_plaintexts[i]), 0, buffer, 0); |
197 result = Util.ubytesToHex(buffer); | 197 result = Util.ubytesToHex(buffer); |
198 assert(result == test_ciphertexts[i], | 198 assert(result == test_ciphertexts[i], |
199 t.name()~": ("~result~") != ("~test_ciphertexts[i]~")"); | 199 t.name~": ("~result~") != ("~test_ciphertexts[i]~")"); |
200 | 200 |
201 // Decryption | 201 // Decryption |
202 t.init(false, key); | 202 t.init(false, key); |
203 t.processBlock(Util.hexToUbytes(test_ciphertexts[i]), 0, buffer, 0); | 203 t.processBlock(Util.hexToUbytes(test_ciphertexts[i]), 0, buffer, 0); |
204 result = Util.ubytesToHex(buffer); | 204 result = Util.ubytesToHex(buffer); |
205 assert(result == test_plaintexts[i], | 205 assert(result == test_plaintexts[i], |
206 t.name()~": ("~result~") != ("~test_ciphertexts[i]~")"); | 206 t.name~": ("~result~") != ("~test_ciphertexts[i]~")"); |
207 } | 207 } |
208 } | 208 } |
209 } | 209 } |
210 } | 210 } |