calculateServerEvidenceMessage method

  1. @override
BigInt? calculateServerEvidenceMessage()
override

Computes the server evidence message M2 using the previously verified values. To be called after successfully verifying the client evidence message M1. @return M2: the server side generated evidence message @throws CryptoException

Implementation

@override
BigInt? calculateServerEvidenceMessage() {
  // Verify pre-requirements
  if (A == null || M1 == null || S == null) {
    throw Exception(
        'Impossible to compute M2: some data are missing from the previous operations (A,M1,S)');
  }

  // Compute the server evidence message 'M2'
  M2 = SRP6Util.calculateM2(digest, N, A!, M1!, S!);
  return M2;
}