List of usage examples for org.bouncycastle.crypto.digests KeccakDigest update
public void update(byte in)
From source file:uk.co.platosys.dinigma.Digester.java
License:GNU General Public License
/**Takes a byte array and returns a string which is * the Base64 encoded version the digest. * This uses SHA3-512 as the digest algorithm. * * *///from w w w. j a v a 2 s .com public static String digest(byte[] bytes) throws MinigmaException { try { KeccakDigest digest = new SHA3Digest(512); for (byte byt : bytes) { digest.update(byt); } byte[] digested = new byte[digest.getDigestSize()]; digest.doFinal(digested, 0); return (MinigmaUtils.encode(digested)); } catch (Exception e) { throw new MinigmaException("error making digest", e); } }