The module to encrypt data using block cipher. More...
#include <block-cipher.hpp>
Classes | |
class | Impl |
Public Member Functions | |
BlockCipher (BlockCipherAlgorithm algo, CipherOperator op, const uint8_t *key, size_t keyLen, const uint8_t *iv, size_t ivLen) | |
Create a block cipher. More... | |
Public Member Functions inherited from ndn::security::transform::Upstream | |
virtual | ~Upstream ()=default |
Public Member Functions inherited from ndn::security::transform::Downstream | |
virtual | ~Downstream ()=default |
size_t | write (const uint8_t *buf, size_t size) |
Accept input data and perform transformation. More... | |
void | end () |
Close the input interface of a module. More... | |
bool | isEnd () const |
Check if the input interface of a module is closed. More... | |
void | setIndex (size_t index) |
Set the module index. More... | |
size_t | getIndex () const |
Get the module index. More... | |
Additional Inherited Members | |
Protected Types inherited from ndn::security::transform::Transform | |
typedef std::vector< uint8_t > | OBuffer |
Protected Member Functions inherited from ndn::security::transform::Transform | |
Transform () | |
void | flushOutputBuffer () |
Read the content from output buffer and write it into next module. More... | |
void | flushAllOutput () |
Read the all the content from output buffer and write it into next module. More... | |
void | setOutputBuffer (unique_ptr< OBuffer > buffer) |
Set output buffer to buffer . More... | |
bool | isOutputBufferEmpty () const |
Check if output buffer is empty. More... | |
Protected Member Functions inherited from ndn::security::transform::Upstream | |
Upstream () | |
void | appendChain (unique_ptr< Downstream > tail) |
connect to next transformation module More... | |
Downstream * | getNext () |
Protected Member Functions inherited from ndn::security::transform::Downstream | |
Downstream () | |
Protected Attributes inherited from ndn::security::transform::Upstream | |
unique_ptr< Downstream > | m_next |
The module to encrypt data using block cipher.
The padding scheme of the block cipher is set to the default padding scheme of OpenSSl, which is PKCS padding.
Definition at line 38 of file block-cipher.hpp.
ndn::security::transform::BlockCipher::BlockCipher | ( | BlockCipherAlgorithm | algo, |
CipherOperator | op, | ||
const uint8_t * | key, | ||
size_t | keyLen, | ||
const uint8_t * | iv, | ||
size_t | ivLen | ||
) |
Create a block cipher.
algo | The block cipher algorithm (e.g., EncryptMode::AES_CBC). |
op | The operation that the cipher needs to perform, e.g., CipherOperator::ENCRYPT or CipherOperator::DECRYPT |
key | The pointer to the key. |
keyLen | The size of the key. |
iv | The pointer to the initial vector. |
ivLen | The length of the initial vector. |
Definition at line 51 of file block-cipher.cpp.
References ndn::AES_CBC, ndn::security::transform::Transform::flushOutputBuffer(), ndn::security::transform::Downstream::getIndex(), ndn::security::transform::Transform::isOutputBufferEmpty(), and ndn::security::transform::Transform::setOutputBuffer().