From ea0bab5179e384c4831d74de5ebbeff0c9762d0a Mon Sep 17 00:00:00 2001 From: "Nelson R. Perez" Date: Mon, 26 Jun 2017 14:01:17 -0500 Subject: [PATCH] Simple renaming of a variable for semantic purposes --- .../main/java/de/bitsharesmunich/graphenej/FileBin.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/graphenej/src/main/java/de/bitsharesmunich/graphenej/FileBin.java b/graphenej/src/main/java/de/bitsharesmunich/graphenej/FileBin.java index ab2023b..703102f 100644 --- a/graphenej/src/main/java/de/bitsharesmunich/graphenej/FileBin.java +++ b/graphenej/src/main/java/de/bitsharesmunich/graphenej/FileBin.java @@ -4,7 +4,8 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import de.bitsharesmunich.graphenej.crypto.SecureRandomStrengthener; + +import org.bitcoinj.core.ECKey; import java.io.UnsupportedEncodingException; import java.math.BigInteger; @@ -12,8 +13,8 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; +import de.bitsharesmunich.graphenej.crypto.SecureRandomStrengthener; import de.bitsharesmunich.graphenej.models.backup.WalletBackup; -import org.bitcoinj.core.ECKey; /** * Class to manage the backup files @@ -89,9 +90,9 @@ public abstract class FileBin { secureRandom.nextBytes(randomKey); ECKey randomECKey = ECKey.fromPrivate(md.digest(randomKey)); byte[] randPubKey = randomECKey.getPubKey(); - byte[] finalKey = randomECKey.getPubKeyPoint().multiply(ECKey.fromPrivate(md.digest(password.getBytes("UTF-8"))).getPrivKey()).normalize().getXCoord().getEncoded(); + byte[] sharedSecret = randomECKey.getPubKeyPoint().multiply(ECKey.fromPrivate(md.digest(password.getBytes("UTF-8"))).getPrivKey()).normalize().getXCoord().getEncoded(); MessageDigest md1 = MessageDigest.getInstance("SHA-512"); - finalKey = md1.digest(finalKey); + byte[] finalKey = md1.digest(sharedSecret); checksummed = Util.encryptAES(checksummed, Util.byteToString(finalKey).getBytes()); byte[] finalPayload = new byte[checksummed.length + randPubKey.length];