MCPcopy Create free account
hub / github.com/ValveSoftware/GameNetworkingSockets / operator==

Method operator==

src/common/keypair.cpp:354–366  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Purpose: Compare two keys for equality Output: true if the keys are identical -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

352// Output: true if the keys are identical
353//-----------------------------------------------------------------------------
354bool CCryptoKeyBase::operator==( const CCryptoKeyBase &rhs ) const
355{
356 if ( m_eKeyType != rhs.m_eKeyType ) return false;
357 uint32 cbRawData = GetRawData(nullptr);
358 if ( cbRawData != rhs.GetRawData(nullptr) ) return false;
359
360 CAutoWipeBuffer bufLHS( cbRawData );
361 CAutoWipeBuffer bufRHS( cbRawData );
362 DbgVerify( GetRawData( bufLHS.Base() ) == cbRawData );
363 DbgVerify( rhs.GetRawData( bufRHS.Base() ) == cbRawData );
364
365 return memcmp( bufLHS.Base(), bufRHS.Base(), cbRawData ) == 0;
366}
367
368
369//-----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 2

GetRawDataMethod · 0.45
BaseMethod · 0.45

Tested by

no test coverage detected