use of com.github.zhenwei.core.crypto.params.HKDFParameters in project LinLong-Java by zhenwei1108.
the class HKDFBytesGenerator method init.
public void init(DerivationParameters param) {
if (!(param instanceof HKDFParameters)) {
throw new IllegalArgumentException("HKDF parameters required for HKDFBytesGenerator");
}
HKDFParameters params = (HKDFParameters) param;
if (params.skipExtract()) {
// use IKM directly as PRK
hMacHash.init(new KeyParameter(params.getIKM()));
} else {
hMacHash.init(extract(params.getSalt(), params.getIKM()));
}
info = params.getInfo();
generatedBytes = 0;
currentT = new byte[hashLen];
}
Aggregations