diff --git a/app/src/main/java/com/bitshares/bitshareswallet/wallet/private_key.java b/app/src/main/java/com/bitshares/bitshareswallet/wallet/private_key.java index e84fe55..9ef2790 100644 --- a/app/src/main/java/com/bitshares/bitshareswallet/wallet/private_key.java +++ b/app/src/main/java/com/bitshares/bitshareswallet/wallet/private_key.java @@ -110,30 +110,19 @@ private private_key(KeyPair ecKey){ public compact_signature sign_compact(sha256_object digest, boolean require_canonical ) { compact_signature signature = null; - try { - final HmacPRNG prng = new HmacPRNG(key_data); - RandomSource randomSource = new RandomSource() { - @Override - public void nextBytes(byte[] bytes) { - prng.nextBytes(bytes); - } - }; - - while (true) { - InMemoryPrivateKey inMemoryPrivateKey = new InMemoryPrivateKey(key_data); - SignedMessage signedMessage = inMemoryPrivateKey.signHash(new Sha256Hash(digest.hash), randomSource); - byte[] byteCompact = signedMessage.bitcoinEncodingOfSignature(); - signature = new compact_signature(byteCompact); - - boolean bResult = public_key.is_canonical(signature); - if (bResult == true) { - break; - } + while (true) { + InMemoryPrivateKey inMemoryPrivateKey = new InMemoryPrivateKey(key_data); + SignedMessage signedMessage = inMemoryPrivateKey.signHash(new Sha256Hash(digest.hash)); + byte[] byteCompact = signedMessage.bitcoinEncodingOfSignature(); + signature = new compact_signature(byteCompact); + + boolean bResult = public_key.is_canonical(signature); + if (bResult == true) { + break; } - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); } + return signature; }