extract method
Performs the extract part of the key derivation function.
Implementation
KeyParameter extract(Uint8List? salt, Uint8List ikm) {
if (salt == null || salt.isEmpty) {
if (_hashLen != _hMac.macSize) {
throw ArgumentError(
'Hash length doesn\'t equal MAC size of: ${_hMac.algorithmName}');
}
_hMac.init(KeyParameter(Uint8List(_hashLen)));
} else {
_hMac.init(KeyParameter(salt));
}
_hMac.update(ikm, 0, ikm.length);
var prk = Uint8List(_hashLen);
_hMac.doFinal(prk, 0);
return KeyParameter(prk);
}