KDF2.fromCbor constructor

KDF2.fromCbor(
  1. CborListValue<CborObject<Object?>> v
)

Implementation

factory KDF2.fromCbor(CborListValue v) {
  final String? prf = v.rawValueAt(2);
  if (prf != _SecretStorageConst.prfAlgorithm) {
    throw Web3SecretStorageDefinationV3Exception(
      "Unsupported kdf2 prf algorithm.",
    );
  }
  final int c = v.rawValueAt(0);
  final int dklen = v.rawValueAt(1);
  final List<int> salt = v.rawValueAt(3);
  return KDF2(iterations: c, salt: salt, dklen: dklen);
}