KDF2.fromCbor constructor

KDF2.fromCbor(
  1. CborListValue v
)

Implementation

factory KDF2.fromCbor(CborListValue v) {
  final int c = v.value[0].value;
  final int dklen = v.value[1].value;
  final String prf = v.value[2].value;
  if (prf != "hmac-sha256") {
    throw Web3SecretStorageDefinationV3Exception("Invalid prf.",
        details: {"excepted": "hmac-sha256", "prf": prf});
  }
  final List<int> salt = v.value[3].value;
  return KDF2(iterations: c, salt: salt, dklen: dklen);
}