| 521 | } |
| 522 | |
| 523 | bool 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 | |
| 538 | bool CEC25519PrivateKeyBase::SetRawData( const void *pData, size_t cbData ) |
| 539 | { |