Mercurial > projects > dcrypt
diff dcrypt/crypto/Hash.d @ 32:2b4bccdc8387
Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
author | Thomas Dixon <reikon@reikon.us> |
---|---|
date | Tue, 12 May 2009 22:09:33 -0400 |
parents | 21847420b1ac |
children | b9f8aa42a547 |
line wrap: on
line diff
--- a/dcrypt/crypto/Hash.d Tue May 12 17:10:47 2009 -0400 +++ b/dcrypt/crypto/Hash.d Tue May 12 22:09:33 2009 -0400 @@ -36,6 +36,15 @@ update(input); } + /** Play nice with D2's idea of const. */ + version (D_Version2) + { + this (string input_) + { + return this(cast(ubyte[])input_); + } + } + /** Returns: The block size of the hash function in bytes. */ abstract uint blockSize(); @@ -85,6 +94,15 @@ return this; } + /** Play nice with D2's idea of const. */ + version (D_Version2) + { + Hash update(string input_) + { + return update(cast(ubyte[])input_); + } + } + /** Hash function's internal transformation. */ protected abstract void transform(ubyte[] input);