ECDHEncryption¶
Elliptic-curve Diffie-Hellman class using AES 256 Encryption. More...
#include <ECDHEncryption.hpp>
Inherits from Encryption
Public Functions¶
| Name | |
|---|---|
| virtual std::vector< std::uint8_t > | EncryptData(std::vector< std::uint8_t > data, std::vector< std::uint8_t > key_data) override Encrypts a vector of data using the session secret. |
| virtual std::vector< std::uint8_t > | DecryptData(std::vector< std::uint8_t > data, std::vector< std::uint8_t > key_data) override Decrypts a vector of data using the session secret. |
| virtual bool | CheckEqual(const Encryption & lhs, const Encryption & rhs) const override Checks if two ECDHEncryption instances are equal. |
| ECDHEncryption(const nil::crypto3::pubkey::ext_private_key< PolicyType > & own_key, const nil::crypto3::pubkey::public_key< PolicyType > & foreign_key) Constructs an ECDHEncryption object and creates a session secret. |
Additional inherited members¶
Public Functions inherited from Encryption
| Name | |
|---|---|
| virtual | ~Encryption() Virtual destructor to prevent memory leakage. |
| bool | operator==(const Encryption & other) const Overloads equality operator to CheckEqual. |
Detailed Description¶
Elliptic-curve Diffie-Hellman class using AES 256 Encryption.
Public Functions Documentation¶
function EncryptData¶
inline virtual std::vector< std::uint8_t > EncryptData(
std::vector< std::uint8_t > data,
std::vector< std::uint8_t > key_data
) override
Encrypts a vector of data using the session secret.
Parameters:
- data Vector of data to be encrypted
- key_data Unused in this implementation
Return: Encrypted data vector
Reimplements: Encryption::EncryptData
function DecryptData¶
inline virtual std::vector< std::uint8_t > DecryptData(
std::vector< std::uint8_t > data,
std::vector< std::uint8_t > key_data
) override
Decrypts a vector of data using the session secret.
Parameters:
- data Vector of data to be decrypted
- key_data Unused in this implementation
Return: Decrypted data vector
Reimplements: Encryption::DecryptData
function CheckEqual¶
Checks if two ECDHEncryption instances are equal.
Parameters:
- lhs First instance of Encryption to be downcasted
- rhs Second instance of Encryption to be downcasted
Return: true if session secrets are equal, false otherwise
Reimplements: Encryption::CheckEqual
function ECDHEncryption¶
inline ECDHEncryption(
const nil::crypto3::pubkey::ext_private_key< PolicyType > & own_key,
const nil::crypto3::pubkey::public_key< PolicyType > & foreign_key
)
Constructs an ECDHEncryption object and creates a session secret.
Parameters:
- own_key The owner's private ECDSA key
- foreign_key The other party's public key
Updated on 2026-03-04 at 13:10:44 -0800