|
|
@ -71,18 +71,17 @@ namespace crypto |
|
|
|
|
|
|
|
|
|
|
|
void GenerateKeys (); |
|
|
|
void GenerateKeys (); |
|
|
|
const uint8_t * GetPublicKey () const { return m_PublicKey; }; |
|
|
|
const uint8_t * GetPublicKey () const { return m_PublicKey; }; |
|
|
|
const uint8_t * GetPrivateKey () const { return m_PrivateKey; }; // TODO: remove
|
|
|
|
|
|
|
|
void Agree (const uint8_t * pub, uint8_t * shared); |
|
|
|
void Agree (const uint8_t * pub, uint8_t * shared); |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
|
|
|
|
|
|
|
|
uint8_t m_PublicKey[32]; |
|
|
|
uint8_t m_PublicKey[32]; |
|
|
|
uint8_t m_PrivateKey[32]; // TODO: move to #else
|
|
|
|
|
|
|
|
#if OPENSSL_X25519 |
|
|
|
#if OPENSSL_X25519 |
|
|
|
EVP_PKEY_CTX * m_Ctx; |
|
|
|
EVP_PKEY_CTX * m_Ctx; |
|
|
|
EVP_PKEY * m_Pkey; |
|
|
|
EVP_PKEY * m_Pkey; |
|
|
|
#else |
|
|
|
#else |
|
|
|
BN_CTX * m_Ctx; |
|
|
|
BN_CTX * m_Ctx; |
|
|
|
|
|
|
|
uint8_t m_PrivateKey[32]; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|