22 #ifndef NDN_AES_ALGORITHM_LITE_HPP
23 #define NDN_AES_ALGORITHM_LITE_HPP
25 #include "../../util/blob-lite.hpp"
26 #include "../../../c/errors.h"
60 (
const uint8_t* key,
size_t keyLength,
const uint8_t* initialVector,
61 size_t initialVectorLength,
const uint8_t* encryptedData,
62 size_t encryptedDataLength, uint8_t* plainData,
size_t& plainDataLength);
85 const BlobLite& encryptedData, uint8_t *plainData,
size_t& plainDataLength)
89 encryptedData.
buf(), encryptedData.
size(), plainData, plainDataLength);
110 (
const uint8_t* key,
size_t keyLength,
const uint8_t* encryptedData,
111 size_t encryptedDataLength, uint8_t* plainData,
size_t& plainDataLength);
130 size_t& plainDataLength)
133 (key.
buf(), key.
size(), encryptedData.
buf(), encryptedData.
size(),
134 plainData, plainDataLength);
160 (
const uint8_t* key,
size_t keyLength,
const uint8_t* initialVector,
161 size_t initialVectorLength,
const uint8_t* plainData,
162 size_t plainDataLength, uint8_t* encryptedData,
size_t& encryptedDataLength);
185 const BlobLite& plainData, uint8_t *encryptedData,
size_t& encryptedDataLength)
188 (key.
buf(), key.
size(), initialVector.
buf(), initialVector.
size(),
189 plainData.
buf(), plainData.
size(), encryptedData, encryptedDataLength);
210 (
const uint8_t* key,
size_t keyLength,
const uint8_t* plainData,
211 size_t plainDataLength, uint8_t* encryptedData,
size_t& encryptedDataLength);
230 size_t& encryptedDataLength)
233 (key.
buf(), key.
size(), plainData.
buf(), plainData.
size(), encryptedData,
234 encryptedDataLength);
size_t size() const
Return size given to the constructor.
Definition: blob-lite.hpp:61
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:36
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.
Definition: aes-algorithm-lite.cpp:29
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.
Definition: aes-algorithm-lite.cpp:40
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.
Definition: aes-algorithm-lite.cpp:61
The AesAlgorithmLite class provides static methods to encrypt and decrypt using the AES symmetric key...
Definition: aes-algorithm-lite.hpp:35
A BlobLite holds a pointer to an immutable pre-allocated buffer and its length This is like a JavaScr...
Definition: blob-lite.hpp:37
const uint8_t * buf() const
Return buf given to the constructor.
Definition: blob-lite.hpp:55
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.
Definition: aes-algorithm-lite.cpp:50