Mercurial > projects > dcrypt
comparison dcrypt/crypto/ciphers/RC4.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 |
---|---|
188 | 188 |
189 // Encryption | 189 // Encryption |
190 r.processBytes(Util.hexToUbytes(test_plaintexts[i]), 0, buffer.length, buffer, 0); | 190 r.processBytes(Util.hexToUbytes(test_plaintexts[i]), 0, buffer.length, buffer, 0); |
191 result = Util.ubytesToHex(buffer); | 191 result = Util.ubytesToHex(buffer); |
192 assert(result == test_ciphertexts[i], | 192 assert(result == test_ciphertexts[i], |
193 r.name()~": ("~result~") != ("~test_ciphertexts[i]~")"); | 193 r.name~": ("~result~") != ("~test_ciphertexts[i]~")"); |
194 | 194 |
195 r.reset(); | 195 r.reset(); |
196 | 196 |
197 // Decryption | 197 // Decryption |
198 r.processBytes(Util.hexToUbytes(test_ciphertexts[i]), 0, buffer.length, buffer, 0); | 198 r.processBytes(Util.hexToUbytes(test_ciphertexts[i]), 0, buffer.length, buffer, 0); |
199 result = Util.ubytesToHex(buffer); | 199 result = Util.ubytesToHex(buffer); |
200 assert(result == test_plaintexts[i], | 200 assert(result == test_plaintexts[i], |
201 r.name()~": ("~result~") != ("~test_ciphertexts[i]~")"); | 201 r.name~": ("~result~") != ("~test_ciphertexts[i]~")"); |
202 } | 202 } |
203 } | 203 } |
204 } | 204 } |
205 } | 205 } |