it.auties.curve25519.crypto.Sha512 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of curve25519 Show documentation
Show all versions of curve25519 Show documentation
Curve25519 implementation based on Java 11 and the Java Cryptographic Architecture
The newest version!
package it.auties.curve25519.crypto;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class Sha512 {
public static void calculateDigest(byte[] out, byte[] in, long length) {
try {
var messageDigest = MessageDigest.getInstance("SHA-512");
messageDigest.update(in, 0, (int) length);
var digest = messageDigest.digest();
System.arraycopy(digest, 0, out, 0, digest.length);
} catch (NoSuchAlgorithmException exception) {
throw new UnsupportedOperationException("Missing SHA512 implementation", exception);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy