diff --git a/validat6.cpp b/validat6.cpp index 6ad2055d..9576efc8 100644 --- a/validat6.cpp +++ b/validat6.cpp @@ -133,7 +133,7 @@ bool AuthenticatedKeyAgreementValidate(AuthenticatedKeyAgreementDomain &d) return true; } -bool AuthenticatedKeyAgreementValidateWithRoles(AuthenticatedKeyAgreementDomain &initiator, AuthenticatedKeyAgreementDomain &responder) +bool AuthenticatedKeyAgreementWithRolesValidate(AuthenticatedKeyAgreementDomain &initiator, AuthenticatedKeyAgreementDomain &responder) { if (initiator.GetCryptoParameters().Validate(GlobalRNG(), 3)) std::cout << "passed authenticated key agreement domain parameters validation (initiator)" << std::endl; @@ -157,12 +157,12 @@ bool AuthenticatedKeyAgreementValidateWithRoles(AuthenticatedKeyAgreementDomain initiator.EphemeralPublicKeyLength() != responder.EphemeralPublicKeyLength() || initiator.AgreedValueLength() != responder.AgreedValueLength()) { - std::cout << "passed authenticated key agreement domain parameter consistency" << std::endl; + std::cout << "FAILED authenticated key agreement domain parameter consistency" << std::endl; + return false; } else { - std::cout << "FAILED authenticated key agreement domain parameter consistency" << std::endl; - return false; + std::cout << "passed authenticated key agreement domain parameter consistency" << std::endl; } SecByteBlock spriv1(initiator.StaticPrivateKeyLength()), spriv2(responder.StaticPrivateKeyLength()); diff --git a/validat7.cpp b/validat7.cpp index db5e73f2..97f1f81b 100644 --- a/validat7.cpp +++ b/validat7.cpp @@ -91,7 +91,7 @@ bool ValidateHMQV() const OID oid = ASN1::secp256r1(); ECHMQV< ECP >::Domain hmqvA256(oid, true /*client*/); - success = AuthenticatedKeyAgreementValidateWithRoles(hmqvA256, hmqvB256) && success; + success = AuthenticatedKeyAgreementWithRolesValidate(hmqvA256, hmqvB256) && success; ///////////////////////// @@ -102,7 +102,7 @@ bool ValidateHMQV() const OID oid384 = ASN1::secp384r1(); ECHMQV384 hmqvA384(oid384, true /*client*/); - success = AuthenticatedKeyAgreementValidateWithRoles(hmqvA384, hmqvB384) && success; + success = AuthenticatedKeyAgreementWithRolesValidate(hmqvA384, hmqvB384) && success; ///////////////////////// @@ -113,7 +113,7 @@ bool ValidateHMQV() const OID oid521 = ASN1::secp521r1(); ECHMQV512 hmqvA521(oid521, true /*client*/); - success = AuthenticatedKeyAgreementValidateWithRoles(hmqvA521, hmqvB521) && success; + success = AuthenticatedKeyAgreementWithRolesValidate(hmqvA521, hmqvB521) && success; return success; } @@ -136,7 +136,7 @@ bool ValidateFHMQV() const OID oid = ASN1::secp256r1(); ECFHMQV< ECP >::Domain fhmqvA256(oid, true /*client*/); - success = AuthenticatedKeyAgreementValidateWithRoles(fhmqvA256, fhmqvB256) && success; + success = AuthenticatedKeyAgreementWithRolesValidate(fhmqvA256, fhmqvB256) && success; ///////////////////////// @@ -147,7 +147,7 @@ bool ValidateFHMQV() const OID oid384 = ASN1::secp384r1(); ECHMQV384 fhmqvA384(oid384, true /*client*/); - success = AuthenticatedKeyAgreementValidateWithRoles(fhmqvA384, fhmqvB384) && success; + success = AuthenticatedKeyAgreementWithRolesValidate(fhmqvA384, fhmqvB384) && success; ///////////////////////// @@ -158,7 +158,7 @@ bool ValidateFHMQV() const OID oid521 = ASN1::secp521r1(); ECHMQV512 fhmqvA521(oid521, true /*client*/); - success = AuthenticatedKeyAgreementValidateWithRoles(fhmqvA521, fhmqvB521) && success; + success = AuthenticatedKeyAgreementWithRolesValidate(fhmqvA521, fhmqvB521) && success; return success; } diff --git a/validate.h b/validate.h index ffb8dad5..4a8bd30a 100644 --- a/validate.h +++ b/validate.h @@ -344,7 +344,7 @@ bool RunTestDataFile(const char *filename, const NameValuePairs &overrideParamet // Definitions in validat6.cpp bool CryptoSystemValidate(PK_Decryptor &priv, PK_Encryptor &pub, bool thorough = false); bool SimpleKeyAgreementValidate(SimpleKeyAgreementDomain &d); -bool AuthenticatedKeyAgreementValidateWithRoles(AuthenticatedKeyAgreementDomain &initiator, AuthenticatedKeyAgreementDomain &responder); +bool AuthenticatedKeyAgreementWithRolesValidate(AuthenticatedKeyAgreementDomain &initiator, AuthenticatedKeyAgreementDomain &responder); bool AuthenticatedKeyAgreementValidate(AuthenticatedKeyAgreementDomain &d); bool SignatureValidate(PK_Signer &priv, PK_Verifier &pub, bool thorough = false);