use of com.github.zhenwei.core.crypto.params.Blake3Parameters in project LinLong-Java by zhenwei1108.
the class Blake3Mac method init.
public void init(final CipherParameters pParams) {
CipherParameters myParams = pParams;
if (myParams instanceof KeyParameter) {
myParams = Blake3Parameters.key(((KeyParameter) myParams).getKey());
}
if (!(myParams instanceof Blake3Parameters)) {
throw new IllegalArgumentException("Invalid parameter passed to Blake3Mac init - " + pParams.getClass().getName());
}
final Blake3Parameters myBlakeParams = (Blake3Parameters) myParams;
if (myBlakeParams.getKey() == null) {
throw new IllegalArgumentException("Blake3Mac requires a key parameter.");
}
/* Configure the digest */
theDigest.init(myBlakeParams);
}
Aggregations