Skip to content

Commit 2e64f84

Browse files
authored
Merge pull request tronprotocol#134 from Rovak/crypto-typesafe
use class.getName() instead of string
2 parents d53bbf7 + b008a30 commit 2e64f84

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎src/main/java/org/tron/common/crypto/jce/TronCastleProvider.java‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import java.security.Provider;
2222
import java.security.Security;
2323
import org.spongycastle.jce.provider.BouncyCastleProvider;
24+
import org.tron.common.crypto.cryptohash.Keccak256;
25+
import org.tron.common.crypto.cryptohash.Keccak512;
2426

2527
public final class TronCastleProvider {
2628

@@ -36,11 +38,8 @@ private static class Holder {
3638
Provider p = Security.getProvider("SC");
3739

3840
INSTANCE = (p != null) ? p : new BouncyCastleProvider();
39-
40-
INSTANCE.put("MessageDigest.TRON-KECCAK-256", "org.tron.common.crypto" +
41-
".cryptohash.Keccak256");
42-
INSTANCE.put("MessageDigest.TRON-KECCAK-512", "org.tron.common.crypto" +
43-
".cryptohash.Keccak512");
41+
INSTANCE.put("MessageDigest.TRON-KECCAK-256", Keccak256.class.getName());
42+
INSTANCE.put("MessageDigest.TRON-KECCAK-512", Keccak512.class.getName());
4443
}
4544
}
4645
}

0 commit comments

Comments
 (0)