From 576adf229b554aa3213b247f594943a7caee9367 Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Sat, 16 Sep 2023 17:29:35 -0700 Subject: [PATCH] PBKDF2SHA512: remove redundant `Mac.reset()` calls Calls to `Mac.reset()` are not needed after `Mac.doFinal(input)`. --- core/src/main/java/org/bitcoinj/crypto/PBKDF2SHA512.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/src/main/java/org/bitcoinj/crypto/PBKDF2SHA512.java b/core/src/main/java/org/bitcoinj/crypto/PBKDF2SHA512.java index bf4052087..fd8b1eb9a 100644 --- a/core/src/main/java/org/bitcoinj/crypto/PBKDF2SHA512.java +++ b/core/src/main/java/org/bitcoinj/crypto/PBKDF2SHA512.java @@ -93,10 +93,8 @@ public class PBKDF2SHA512 { U_XOR = mac.doFinal(baU); U_LAST = U_XOR; - mac.reset(); } else { byte[] baU = mac.doFinal(U_LAST); - mac.reset(); for (int k = 0; k < U_XOR.length; k++) { U_XOR[k] = (byte) (U_XOR[k] ^ baU[k]);