diff dcrypt/crypto/ciphers/RC6.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 71aae178f89a
children 23c62e28b3a4
line wrap: on
line diff
--- a/dcrypt/crypto/ciphers/RC6.d	Thu Aug 14 23:51:56 2008 -0400
+++ b/dcrypt/crypto/ciphers/RC6.d	Sat Aug 16 22:43:22 2008 -0400
@@ -1,11 +1,6 @@
 /**
  * This file is part of the dcrypt project.
- *
- * It should be noted that this algorithm is very similar to RC5.
- * Currently there are no plans to implement RC5, but should that change
- * in the future, it may be wise to rewrite both RC5 and RC6 to use some
- * kind of template or base class.
- *
+ * 
  * Copyright: Copyright (C) dcrypt contributors 2008. All rights reserved.
  * License:   MIT
  * Authors:   Thomas Dixon
@@ -19,8 +14,15 @@
 /**
  * Implementation of the RC6-32/20/b cipher designed by 
  * Ron Rivest et al. of RSA Security.
+ * 
+ * It should be noted that this algorithm is very similar to RC5.
+ * Currently there are no plans to implement RC5, but should that change
+ * in the future, it may be wise to rewrite both RC5 and RC6 to use some
+ * kind of template or base class.
  *
- * Note: This algorithm is patented and trademarked.
+ * This algorithm is patented and trademarked.
+ * 
+ * References: http://people.csail.mit.edu/rivest/Rc6.pdf
  */
 class RC6 : BlockCipher {
     private {
@@ -203,7 +205,7 @@
                 t.processBlock(Util.hexToUbytes(test_ciphertexts[i]), 0, buffer, 0);
                 result = Util.ubytesToHex(buffer);
                 assert(result == test_plaintexts[i],
-                        t.name~": ("~result~") != ("~test_ciphertexts[i]~")");
+                        t.name~": ("~result~") != ("~test_plaintexts[i]~")");
             }
         }
     }