Java Code Examples for org.spongycastle.crypto.digests.SHA3Digest#getDigestSize()

The following examples show how to use org.spongycastle.crypto.digests.SHA3Digest#getDigestSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SHA3Helper.java    From wkcwallet-java with Apache License 2.0 5 votes vote down vote up
private static byte[] sha3(byte[] message, int start, int length, SHA3Digest digest, boolean bouncyencoder) {
    byte[] hash = new byte[digest.getDigestSize()];

    if (message.length != 0) {
        digest.update(message, start, length);
    }
    digest.doFinal(hash, 0);
    return hash;
}
 
Example 2
Source File: SHA3Helper.java    From wkcwallet-java with Apache License 2.0 5 votes vote down vote up
private static byte[] doSha3(byte[] message, SHA3Digest digest, boolean bouncyencoder) {
    byte[] hash = new byte[digest.getDigestSize()];

    if (message.length != 0) {
        digest.update(message, 0, message.length);
    }
    digest.doFinal(hash, 0);
    return hash;
}
 
Example 3
Source File: SHA3Helper.java    From wkcwallet-java with Apache License 2.0 5 votes vote down vote up
private static byte[] doSha3(byte[] m1, byte[] m2, SHA3Digest digest, boolean bouncyencoder) {
    byte[] hash = new byte[digest.getDigestSize()];
    digest.update(m1, 0, m1.length);
    digest.update(m2, 0, m2.length);

    digest.doFinal(hash, 0);
    return hash;
}
 
Example 4
Source File: SHA3Helper.java    From ethereumj with MIT License 5 votes vote down vote up
private static byte[] doSha3(byte[] message, SHA3Digest digest, boolean bouncyencoder) {
    byte[] hash = new byte[digest.getDigestSize()];

    if (message.length != 0) {
        digest.update(message, 0, message.length);
    }
    digest.doFinal(hash, 0);
    return hash;
}