Mercurial > projects > dcrypt
comparison dcrypt/crypto/PRNG.d @ 15:0de48552be35
Added LimitReachedError and PBKDF2. Fixed some errors with the previous commit in PRNGFromHash, etc. Re-implemented HMAC. Changed the name() format of HMAC and PBKDF2.
author | Thomas Dixon <reikon@reikon.us> |
---|---|
date | Wed, 19 Nov 2008 19:30:52 -0500 |
parents | 5ce3012f1def |
children | 8b5eaf3c2979 |
comparison
equal
deleted
inserted
replaced
14:5ce3012f1def | 15:0de48552be35 |
---|---|
15 | 15 |
16 /** Relatively simple interface for PRNGs. */ | 16 /** Relatively simple interface for PRNGs. */ |
17 abstract class PRNG { | 17 abstract class PRNG { |
18 | 18 |
19 protected bool _initialized; | 19 protected bool _initialized; |
20 | |
21 /** Returns: The name of the PRNG. */ | |
22 char[] name(); | |
23 | 20 |
24 /** Returns: Whether or not the PRNG has been initialized. */ | 21 /** Returns: Whether or not the PRNG has been initialized. */ |
25 bool initialized() { | 22 bool initialized() { |
26 return _initialized; | 23 return _initialized; |
27 } | 24 } |
40 * | 37 * |
41 * Params: | 38 * Params: |
42 * output = Array to fill with the next bytes of the keystream | 39 * output = Array to fill with the next bytes of the keystream |
43 */ | 40 */ |
44 uint read(ubyte[] output); | 41 uint read(ubyte[] output); |
42 | |
43 /** Returns: The name of the PRNG algorithm */ | |
44 char[] name(); | |
45 } | 45 } |