comparison dcrypt/crypto/MAC.d @ 27:8b5eaf3c2979

Fixed error in hash message padding reported by Glenn Haecker.
author Thomas Dixon <reikon@reikon.us>
date Sat, 09 May 2009 23:29:20 -0400
parents 4589f8c5eb3c
children ad687db713a4
comparison
equal deleted inserted replaced
26:176c933827a8 27:8b5eaf3c2979
12 public import dcrypt.crypto.params.SymmetricKey; 12 public import dcrypt.crypto.params.SymmetricKey;
13 public import dcrypt.crypto.errors.InvalidParameterError; 13 public import dcrypt.crypto.errors.InvalidParameterError;
14 import dcrypt.misc.ByteConverter; 14 import dcrypt.misc.ByteConverter;
15 15
16 /** Base MAC class */ 16 /** Base MAC class */
17 abstract class MAC { 17 abstract class MAC
18 {
18 /** 19 /**
19 * Initialize a MAC. 20 * Initialize a MAC.
20 * 21 *
21 * Params: 22 * Params:
22 * params = Parameters to be passed to the MAC. (Key, etc.) 23 * params = Parameters to be passed to the MAC. (Key, etc.)
45 46
46 /** Returns: The computed MAC. */ 47 /** Returns: The computed MAC. */
47 ubyte[] digest(); 48 ubyte[] digest();
48 49
49 /** Returns: The computed MAC in hexadecimal. */ 50 /** Returns: The computed MAC in hexadecimal. */
50 char[] hexDigest() { 51 char[] hexDigest()
52 {
51 return ByteConverter.hexEncode(digest()); 53 return ByteConverter.hexEncode(digest());
52 } 54 }
53 } 55 }