AES128-encrypted SGCTP payload.
More...
#include <sgctp/payload_aes128.hpp>
|
static int | makeCryptoNonce (unsigned char *_pucNonce) |
| Create cryptographic nonce. More...
|
|
static unsigned char * | allocBuffer () |
| Allocate a buffer for payload (un-)serialization. More...
|
|
static void | zeroBuffer (unsigned char *_pucBuffer) |
| Zero-out a buffer required for payload (un-)serialization. More...
|
|
static void | freeBuffer (unsigned char *_pucBuffer) |
| Free a buffer allocated for payload (un-)serialization. More...
|
|
AES128-encrypted SGCTP payload.
This class (un-)serializes SGCTP data from/to an AES128-encrypted SGCTP payload.
Definition at line 48 of file payload_aes128.hpp.
CPayload_AES128::CPayload_AES128 |
( |
| ) |
|
CPayload_AES128::~CPayload_AES128 |
( |
| ) |
|
|
virtual |
int CPayload_AES128::makeCryptoNonce |
( |
unsigned char * |
_pucNonce | ) |
|
|
static |
Create cryptographic nonce.
- Parameters
-
[in] | _pucNonce | Nonce buffer (to store nonce into); it MUST have been allocated previously |
- Returns
- Negative error code in case of error, zero otherwise
- See Also
- CRYPTO_NONCE_SIZE
Definition at line 71 of file payload_aes128.cpp.
int CPayload_AES128::initCryptoEngine |
( |
| ) |
|
|
staticprivate |
Initialize cryptographic engine.
- Returns
- Negative error code in case of error, zero otherwise
Definition at line 87 of file payload_aes128.cpp.
int CPayload_AES128::alloc |
( |
| ) |
|
|
virtual |
Allocate resources for payload (un-)serialization.
- Returns
- Negative error code in case of error, zero otherwise
Reimplemented from SGCTP::CPayload.
Definition at line 123 of file payload_aes128.cpp.
int CPayload_AES128::serialize |
( |
unsigned char * |
_pucBuffer, |
|
|
const CData & |
_roData |
|
) |
| |
|
virtual |
Serialize the given SGCTP data into the given payload buffer.
- Parameters
-
[in] | _pucBuffer | Payload buffer (to write the serialization data to) |
[in] | _roData | SGCTP data object (to be serialized) |
- Returns
- (Positive) Quantity of data actually serialized; Negative error code in case of error
Reimplemented from SGCTP::CPayload.
Definition at line 134 of file payload_aes128.cpp.
int CPayload_AES128::unserialize |
( |
CData * |
_poData, |
|
|
const unsigned char * |
_pucBuffer, |
|
|
uint16_t |
_ui16tBufferSize |
|
) |
| |
|
virtual |
Unserialize the SGCTP data from the given payload buffer.
- Parameters
-
[in] | _poData | SGCTP data object (to store unserialized data) |
[in] | _pucBuffer | Payload buffer (to read the serialization data from) |
- Returns
- (Positive) Quantity of data actually unserialized; Negative error code in case of error
Reimplemented from SGCTP::CPayload.
Definition at line 222 of file payload_aes128.cpp.
void CPayload_AES128::free |
( |
| ) |
|
|
virtual |
int CPayload_AES128::makeCryptoKey |
( |
const unsigned char * |
_pucPassword, |
|
|
int |
_iPasswordLength, |
|
|
const unsigned char * |
_pucNonce |
|
) |
| |
Create cryptographic key (and seal)
- Parameters
-
[in] | _pucPassword | User password |
[in] | _iPasswordLength | User password length |
[in] | _pucNonce | Nonce (salt) used for password hashing |
- Returns
- Negative error code in case of error, zero otherwise
- See Also
- makeCryptoNonce()
Definition at line 325 of file payload_aes128.cpp.
int CPayload_AES128::incrCryptoKey |
( |
| ) |
|
Increment cryptographic key (and seal)
- Returns
- Negative error code in case of error, zero otherwise
Definition at line 375 of file payload_aes128.cpp.
const int SGCTP::CPayload_AES128::CRYPTO_CIPHER = GCRY_CIPHER_AES128 |
|
static |
const int SGCTP::CPayload_AES128::CRYPTO_MODE = GCRY_CIPHER_MODE_CBC |
|
static |
const uint16_t SGCTP::CPayload_AES128::CRYPTO_BLOCK_SIZE = 16 |
|
static |
const uint16_t SGCTP::CPayload_AES128::CRYPTO_NONCE_SIZE = 16 |
|
static |
const uint16_t SGCTP::CPayload_AES128::CRYPTO_KEY_SIZE = 16 |
|
static |
const uint16_t SGCTP::CPayload_AES128::CRYPTO_KEY_ITER = 16384 |
|
static |
const uint16_t SGCTP::CPayload_AES128::CRYPTO_SEAL_SIZE = 4 |
|
static |
unsigned char* SGCTP::CPayload_AES128::pucBufferTmp |
|
private |
Cryptographic nonce (used for cryptographic hashing)
Definition at line 92 of file payload_aes128.hpp.
Cryptographic key (used for encryption/decryption)
Definition at line 94 of file payload_aes128.hpp.
Cryptographic seal (used to check valid decryption)
Definition at line 96 of file payload_aes128.hpp.
The documentation for this class was generated from the following files: