I'm working on a JAVA project that needs to perform a sha3-256 hash. Since Bouncy Castle implemented Sha3 in its latest update, I plan to use their implementation. Here is my code:
public static String sha3(final String input) {
String hash = "";
final SHA3.DigestSHA3 md = new SHA3.DigestSHA3(256);
md.update(input.getBytes());
hash = Main2.toString(md.digest());
return hash;
}
When running System.out.println(Main2.sha3(""));
, I get the following output:
C5D2460186F7233C927E7DB2DCC703C0E500B653CA82273B7BFAD8045D85A470
When I search fot basic sha3 outputs from:
wikipedia: https://en.wikipedia.org/wiki/SHA-3
or
NIST standards: http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA3-256_Msg0.pdf
, it seems I should obtain:
a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a
Is there any mistake in my code? Any link between bouncy castle's output and NIST's? Would there be a mistake in bouncy castle's implementation?
Thanks for your time and regards.