All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Static Public Member Functions | List of all members
ndn::AesAlgorithmLite Class Reference

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...
 

Detailed Description

The AesAlgorithmLite class provides static methods to encrypt and decrypt using the AES symmetric key cipher.

Note
This class is an experimental feature. The API may change.

Member Function Documentation

static ndn_Error ndn::AesAlgorithmLite::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 
)
static

Use the key to decrypt encryptedData using AES 128 in CBC mode.

Parameters
keyA pointer to the key byte array.
keyLengthThe 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.
initialVectorA pointer to the initial vector byte array.
initialVectorLengthThe 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.
encryptedDataA pointer to the input byte array to decrypt.
encryptedDataLengthThe length of encryptedData.
plainDataA pointer to the decrypted output buffer. The caller must provide a large enough buffer, which should be at least encryptedDataLength bytes.
plainDataLengthThis sets plainDataLength to the number of bytes placed in the plainData buffer.
Returns
0 for success, else NDN_ERROR_Incorrect_key_size for incorrect keyLength or NDN_ERROR_Incorrect_initial_vector_size for incorrect initialVectorLength.
static ndn_Error ndn::AesAlgorithmLite::decrypt128Cbc ( const BlobLite key,
const BlobLite initialVector,
const BlobLite encryptedData,
uint8_t *  plainData,
size_t &  plainDataLength 
)
inlinestatic

Use the key to decrypt encryptedData using AES 128 in CBC mode.

Parameters
keyThe 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.
initialVectorThe 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.
encryptedDataThe input byte array to decrypt.
plainDataA pointer to the decrypted output buffer. The caller must provide a large enough buffer, which should be at least encryptedDataLength bytes.
plainDataLengthThis sets plainDataLength to the number of bytes placed in the plainData buffer.
Returns
0 for success, else NDN_ERROR_Incorrect_key_size for incorrect keyLength or NDN_ERROR_Incorrect_initial_vector_size for incorrect initialVectorLength.
static ndn_Error ndn::AesAlgorithmLite::decrypt128Ecb ( const uint8_t *  key,
size_t  keyLength,
const uint8_t *  encryptedData,
size_t  encryptedDataLength,
uint8_t *  plainData,
size_t &  plainDataLength 
)
static

Use the key to decrypt encryptedData using AES 128 in ECB mode.

Parameters
keyA pointer to the key byte array.
keyLengthThe 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.
encryptedDataA pointer to the input byte array to decrypt.
encryptedDataLengthThe length of encryptedData.
plainDataA pointer to the decrypted output buffer. The caller must provide a large enough buffer, which should be at least encryptedDataLength bytes.
plainDataLengthThis sets plainDataLength to the number of bytes placed in the plainData buffer.
Returns
0 for success, else NDN_ERROR_Incorrect_key_size for incorrect keyLength.
static ndn_Error ndn::AesAlgorithmLite::decrypt128Ecb ( const BlobLite key,
const BlobLite encryptedData,
uint8_t *  plainData,
size_t &  plainDataLength 
)
inlinestatic

Use the key to decrypt encryptedData using AES 128 in ECB mode.

Parameters
keyThe 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.
encryptedDataThe input byte array to decrypt.
plainDataA pointer to the decrypted output buffer. The caller must provide a large enough buffer, which should be at least encryptedDataLength bytes.
plainDataLengthThis sets plainDataLength to the number of bytes placed in the plainData buffer.
Returns
0 for success, else NDN_ERROR_Incorrect_key_size for incorrect keyLength.
static ndn_Error ndn::AesAlgorithmLite::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 
)
static

Use the key to encrypt encryptedData using AES 128 in CBC mode.

Parameters
keyA pointer to the key byte array.
keyLengthThe 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.
initialVectorA pointer to the initial vector byte array.
initialVectorLengthThe 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.
plainDataA pointer to the input byte array to encrypt.
plainDataLengthThe length of plainData.
encryptedDataA 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.
encryptedDataLengthThis sets encryptedDataLength to the number of bytes placed in the encryptedData buffer.
Returns
0 for success, else NDN_ERROR_Incorrect_key_size for incorrect keyLength or NDN_ERROR_Incorrect_initial_vector_size for incorrect initialVectorLength.
static ndn_Error ndn::AesAlgorithmLite::encrypt128Cbc ( const BlobLite key,
const BlobLite initialVector,
const BlobLite plainData,
uint8_t *  encryptedData,
size_t &  encryptedDataLength 
)
inlinestatic

Use the key to encrypt encryptedData using AES 128 in CBC mode.

Parameters
keyThe 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.
initialVectorThe 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.
plainDataThe input byte array to encrypt.
encryptedDataA 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.
encryptedDataLengthThis sets encryptedDataLength to the number of bytes placed in the encryptedData buffer.
Returns
0 for success, else NDN_ERROR_Incorrect_key_size for incorrect keyLength or NDN_ERROR_Incorrect_initial_vector_size for incorrect initialVectorLength.
static ndn_Error ndn::AesAlgorithmLite::encrypt128Ecb ( const uint8_t *  key,
size_t  keyLength,
const uint8_t *  plainData,
size_t  plainDataLength,
uint8_t *  encryptedData,
size_t &  encryptedDataLength 
)
static

Use the key to encrypt encryptedData using AES 128 in ECB mode.

Parameters
keyA pointer to the key byte array.
keyLengthThe 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.
plainDataA pointer to the input byte array to encrypt.
plainDataLengthThe length of plainData.
encryptedDataA 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.
encryptedDataLengthThis sets encryptedDataLength to the number of bytes placed in the encryptedData buffer.
Returns
0 for success, else NDN_ERROR_Incorrect_key_size for incorrect keyLength.
static ndn_Error ndn::AesAlgorithmLite::encrypt128Ecb ( const BlobLite key,
const BlobLite plainData,
uint8_t *  encryptedData,
size_t &  encryptedDataLength 
)
inlinestatic

Use the key to encrypt encryptedData using AES 128 in ECB mode.

Parameters
keyThe 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.
plainDataThe input byte array to encrypt.
encryptedDataA 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.
encryptedDataLengthThis sets encryptedDataLength to the number of bytes placed in the encryptedData buffer.
Returns
0 for success, else NDN_ERROR_Incorrect_key_size for incorrect keyLength.

The documentation for this class was generated from the following file: