The AesAlgorithmLite class provides static methods to encrypt and decrypt using the AES symmetric key cipher. More...
#include <aes-algorithm-lite.hpp>
Static Public Member Functions | |
| static ndn_Error | decrypt128Cbc (const uint8_t *key, size_t keyLength, const uint8_t *initialVector, size_t initialVectorLength, const uint8_t *encryptedData, size_t encryptedDataLength, uint8_t *plainData, size_t &plainDataLength) |
| Use the key to decrypt encryptedData using AES 128 in CBC mode. More... | |
| static ndn_Error | decrypt128Cbc (const BlobLite &key, const BlobLite &initialVector, const BlobLite &encryptedData, uint8_t *plainData, size_t &plainDataLength) |
| Use the key to decrypt encryptedData using AES 128 in CBC mode. More... | |
| static ndn_Error | decrypt128Ecb (const uint8_t *key, size_t keyLength, const uint8_t *encryptedData, size_t encryptedDataLength, uint8_t *plainData, size_t &plainDataLength) |
| Use the key to decrypt encryptedData using AES 128 in ECB mode. More... | |
| static ndn_Error | decrypt128Ecb (const BlobLite &key, const BlobLite &encryptedData, uint8_t *plainData, size_t &plainDataLength) |
| Use the key to decrypt encryptedData using AES 128 in ECB mode. More... | |
| static ndn_Error | encrypt128Cbc (const uint8_t *key, size_t keyLength, const uint8_t *initialVector, size_t initialVectorLength, const uint8_t *plainData, size_t plainDataLength, uint8_t *encryptedData, size_t &encryptedDataLength) |
| Use the key to encrypt encryptedData using AES 128 in CBC mode. More... | |
| static ndn_Error | encrypt128Cbc (const BlobLite &key, const BlobLite &initialVector, const BlobLite &plainData, uint8_t *encryptedData, size_t &encryptedDataLength) |
| Use the key to encrypt encryptedData using AES 128 in CBC mode. More... | |
| static ndn_Error | encrypt128Ecb (const uint8_t *key, size_t keyLength, const uint8_t *plainData, size_t plainDataLength, uint8_t *encryptedData, size_t &encryptedDataLength) |
| Use the key to encrypt encryptedData using AES 128 in ECB mode. More... | |
| static ndn_Error | encrypt128Ecb (const BlobLite &key, const BlobLite &plainData, uint8_t *encryptedData, size_t &encryptedDataLength) |
| Use the key to encrypt encryptedData using AES 128 in ECB mode. More... | |
The AesAlgorithmLite class provides static methods to encrypt and decrypt using the AES symmetric key cipher.
|
static |
Use the key to decrypt encryptedData using AES 128 in CBC mode.
| key | A pointer to the key byte array. |
| keyLength | The length of key. It is an error if this is not ndn_AES_128_BLOCK_SIZE. This value is proved as a safety check that the correct algorithm is being used. |
| initialVector | A pointer to the initial vector byte array. |
| initialVectorLength | The length of initialVector. It is an error if this is not ndn_AES_128_BLOCK_SIZE. This value is proved as a safety check that the correct algorithm is being used. |
| encryptedData | A pointer to the input byte array to decrypt. |
| encryptedDataLength | The length of encryptedData. |
| plainData | A pointer to the decrypted output buffer. The caller must provide a large enough buffer, which should be at least encryptedDataLength bytes. |
| plainDataLength | This sets plainDataLength to the number of bytes placed in the plainData buffer. |
|
inlinestatic |
Use the key to decrypt encryptedData using AES 128 in CBC mode.
| key | The key byte array. It is an error if its size is not ndn_AES_128_BLOCK_SIZE. This value is proved as a safety check that the correct algorithm is being used. |
| initialVector | The initial vector byte array. It is an error if its size is not ndn_AES_128_BLOCK_SIZE. This value is proved as a safety check that the correct algorithm is being used. |
| encryptedData | The input byte array to decrypt. |
| plainData | A pointer to the decrypted output buffer. The caller must provide a large enough buffer, which should be at least encryptedDataLength bytes. |
| plainDataLength | This sets plainDataLength to the number of bytes placed in the plainData buffer. |
|
static |
Use the key to decrypt encryptedData using AES 128 in ECB mode.
| key | A pointer to the key byte array. |
| keyLength | The length of key. It is an error if this is not ndn_AES_128_BLOCK_SIZE. This value is proved as a safety check that the correct algorithm is being used. |
| encryptedData | A pointer to the input byte array to decrypt. |
| encryptedDataLength | The length of encryptedData. |
| plainData | A pointer to the decrypted output buffer. The caller must provide a large enough buffer, which should be at least encryptedDataLength bytes. |
| plainDataLength | This sets plainDataLength to the number of bytes placed in the plainData buffer. |
|
inlinestatic |
Use the key to decrypt encryptedData using AES 128 in ECB mode.
| key | The key byte array. It is an error if its size is not ndn_AES_128_BLOCK_SIZE. This value is proved as a safety check that the correct algorithm is being used. |
| encryptedData | The input byte array to decrypt. |
| plainData | A pointer to the decrypted output buffer. The caller must provide a large enough buffer, which should be at least encryptedDataLength bytes. |
| plainDataLength | This sets plainDataLength to the number of bytes placed in the plainData buffer. |
|
static |
Use the key to encrypt encryptedData using AES 128 in CBC mode.
| key | A pointer to the key byte array. |
| keyLength | The length of key. It is an error if this is not ndn_AES_128_BLOCK_SIZE. This value is proved as a safety check that the correct algorithm is being used. |
| initialVector | A pointer to the initial vector byte array. |
| initialVectorLength | The length of initialVector. It is an error if this is not ndn_AES_128_BLOCK_SIZE. This value is proved as a safety check that the correct algorithm is being used. |
| plainData | A pointer to the input byte array to encrypt. |
| plainDataLength | The length of plainData. |
| encryptedData | A pointer to the decrypted output buffer. The caller must provide a large enough buffer, which should be at least encryptedDataLength + ndn_AES_128_BLOCK_SIZE bytes. |
| encryptedDataLength | This sets encryptedDataLength to the number of bytes placed in the encryptedData buffer. |
|
inlinestatic |
Use the key to encrypt encryptedData using AES 128 in CBC mode.
| key | The key byte array. It is an error if its size is not ndn_AES_128_BLOCK_SIZE. This value is proved as a safety check that the correct algorithm is being used. |
| initialVector | The initial vector byte array. It is an error if its size is not ndn_AES_128_BLOCK_SIZE. This value is proved as a safety check that the correct algorithm is being used. |
| plainData | The input byte array to encrypt. |
| encryptedData | A pointer to the decrypted output buffer. The caller must provide a large enough buffer, which should be at least encryptedDataLength + ndn_AES_128_BLOCK_SIZE bytes. |
| encryptedDataLength | This sets encryptedDataLength to the number of bytes placed in the encryptedData buffer. |
|
static |
Use the key to encrypt encryptedData using AES 128 in ECB mode.
| key | A pointer to the key byte array. |
| keyLength | The length of key. It is an error if this is not ndn_AES_128_BLOCK_SIZE. This value is proved as a safety check that the correct algorithm is being used. |
| plainData | A pointer to the input byte array to encrypt. |
| plainDataLength | The length of plainData. |
| encryptedData | A pointer to the decrypted output buffer. The caller must provide a large enough buffer, which should be at least encryptedDataLength + ndn_AES_128_BLOCK_SIZE bytes. |
| encryptedDataLength | This sets encryptedDataLength to the number of bytes placed in the encryptedData buffer. |
|
inlinestatic |
Use the key to encrypt encryptedData using AES 128 in ECB mode.
| key | The key byte array. It is an error if its size is not ndn_AES_128_BLOCK_SIZE. This value is proved as a safety check that the correct algorithm is being used. |
| plainData | The input byte array to encrypt. |
| encryptedData | A pointer to the decrypted output buffer. The caller must provide a large enough buffer, which should be at least encryptedDataLength + ndn_AES_128_BLOCK_SIZE bytes. |
| encryptedDataLength | This sets encryptedDataLength to the number of bytes placed in the encryptedData buffer. |
1.8.6