20 #ifndef SGCTP_CPAYLOAD_AES128_HPP
21 #define SGCTP_CPAYLOAD_AES128_HPP
23 #ifdef __SGCTP_USE_OPENSSL__
26 #include "openssl/evp.h"
28 #else // __SGCTP_USE_OPENSSL__
33 #endif // NOT __SGCTP_USE_OPENSSL__
56 #ifdef __SGCTP_USE_OPENSSL__
58 #else //__SGCTP_USE_OPENSSL__
61 #endif //__SGCTP_USE_OPENSSL__
115 virtual int serialize(
unsigned char *_pucBuffer,
116 const CData &_roData );
119 const unsigned char *_pucBuffer,
120 uint16_t _ui16tBufferSize );
139 int _iPasswordLength,
140 const unsigned char *_pucNonce );
152 #endif // SGCTP_CPAYLOAD_AES128_HPP
int makeCryptoKey(const unsigned char *_pucPassword, int _iPasswordLength, const unsigned char *_pucNonce)
Create cryptographic key (and seal)
int incrCryptoKey()
Increment cryptographic key (and seal)
static const uint16_t CRYPTO_KEY_ITER
virtual int alloc()
Allocate resources for payload (un-)serialization.
virtual ~CPayload_AES128()
static const uint16_t CRYPTO_SEAL_SIZE
static const uint16_t CRYPTO_KEY_SIZE
static const uint16_t CRYPTO_NONCE_SIZE
unsigned char pucCryptoKey[CRYPTO_BLOCK_SIZE]
Cryptographic key (used for encryption/decryption)
static const int CRYPTO_CIPHER
unsigned char pucCryptoSeal[CRYPTO_SEAL_SIZE]
Cryptographic seal (used to check valid decryption)
static int initCryptoEngine()
Initialize cryptographic engine.
static int makeCryptoNonce(unsigned char *_pucNonce)
Create cryptographic nonce.
virtual int unserialize(CData *_poData, const unsigned char *_pucBuffer, uint16_t _ui16tBufferSize)
Unserialize the SGCTP data from the given payload buffer.
virtual int serialize(unsigned char *_pucBuffer, const CData &_roData)
Serialize the given SGCTP data into the given payload buffer.
static const uint16_t CRYPTO_BLOCK_SIZE
unsigned char * pucBufferTmp
Payload temporary import/export buffer.
AES128-encrypted SGCTP payload.
virtual void free()
Free resources for payload (un-)serialization.
static const int CRYPTO_MODE
unsigned char pucCryptoNonce[CRYPTO_NONCE_SIZE]
Cryptographic nonce (used for cryptographic hashing)