MCPcopy Create free account
hub / github.com/ValveSoftware/GameNetworkingSockets / MatchesPublicKey

Method MatchesPublicKey

src/common/keypair.cpp:523–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

521}
522
523bool CEC25519PrivateKeyBase::MatchesPublicKey( const CEC25519PublicKeyBase &publicKey ) const
524{
525 if ( m_eKeyType == k_ECryptoKeyTypeKeyExchangePrivate && publicKey.GetKeyType() != k_ECryptoKeyTypeKeyExchangePublic )
526 return false;
527 if ( m_eKeyType == k_ECryptoKeyTypeSigningPrivate && publicKey.GetKeyType() != k_ECryptoKeyTypeSigningPublic )
528 return false;
529 if ( !IsValid() || !publicKey.IsValid() )
530 return false;
531
532 uint8 pubKey2[32];
533 DbgVerify( publicKey.GetRawData( pubKey2 ) == 32 );
534
535 return memcmp( GetPublicKeyRawData(), pubKey2, 32 ) == 0;
536}
537
538bool CEC25519PrivateKeyBase::SetRawData( const void *pData, size_t cbData )
539{

Callers 3

TestEllipticCryptoFunction · 0.80
TestOpenSSHEd25519Function · 0.80

Calls 3

GetKeyTypeMethod · 0.80
IsValidMethod · 0.45
GetRawDataMethod · 0.45

Tested by 2

TestEllipticCryptoFunction · 0.64
TestOpenSSHEd25519Function · 0.64