Generate public key in android platform error [SOLVED]

Hi, when I use nem core code to generate public key in android platform I got an error:
java.security.NoSuchAlgorithmException: MessageDigest Keccak-512 implementation not found…

While there’s no error in java platform, which project jdk is 1.8.0_144.

I see the source code:
public static byte[] sha3_512(final byte[]… inputs) {
return hash(“KECCAK-512”, inputs);
}
digest = MessageDigest.getInstance(algorithm, “BC”);

Can anyone help me about this problem? thank you very much.

I would check how key pair generation is made in current native Android app https://github.com/NemProject/NEMAndroidApp
It should be a tip. Android java version is not same as desktop so some algorithms may missing.

@CryptoBeliever OK, Got it. Thanks for your reply. We have already changed the provider to Security.addProvider(SpongyCastleProvider.getInstance()); It worked well now. thanks a lot for help.

1 Like