Improve HMac reset
@@ -210,16 +210,16 @@ public int doFinal(
*/
public void reset()
{
- /*
- * reset the underlying digest.
- */
+ if (ipadState != null)
+ {
+ ((Memoable)digest).reset(ipadState);
+ }
+ else
+ {
digest.reset();
-
- /*
- * reinitialize the digest.
- */
digest.update(inputPad, 0, inputPad.length);
}
+ }
private static void xorPad(byte[] pad, int len, byte n)
{
