Class Keccak256

java.lang.Object
zephyr.lib.utils.Keccak256

public final class Keccak256 extends Object
Keccak-256 as CryptoNote uses it for address checksums: the Keccak-f[1600] permutation with a rate of 136 bytes, a 256-bit output and the original Keccak padding (a 0x01 domain byte). This is not SHA3-256, which pads with 0x06 and gives different digests. The class depends on nothing outside the JDK, so it behaves the same on every Android version: Android 7 and 8 put their own copy of Bouncy Castle on the boot class path, and that copy has no Keccak.
  • Method Details

    • hash

      public static byte[] hash(byte[] input)
      Computes the Keccak-256 digest of the given bytes.
      Parameters:
      input - the bytes to hash
      Returns:
      the 32-byte digest