semf
aescbc.h
Go to the documentation of this file.
1
10#ifndef SEMF_APP_PROCESSING_AESCBC_H_
11#define SEMF_APP_PROCESSING_AESCBC_H_
12
13#include <cstddef>
14#include <cstdint>
15
16namespace semf
17{
18namespace app
19{
26class AesCbc
27{
28public:
30 enum State : bool
31 {
32 Ok = true,
33 Error = false,
34 };
35
36 virtual ~AesCbc() = default;
37
44 virtual void setKey(const uint8_t key[], size_t size) = 0;
50 virtual void setInitializationVector(const uint8_t initializationVector[]) = 0;
52 virtual void resetInitializationVector() = 0;
67 virtual State encrypt(const uint8_t dataIn[], uint8_t bufferOut[], size_t size) = 0;
82 virtual State decrypt(const uint8_t dataIn[], uint8_t bufferOut[], size_t size) = 0;
83};
84} /* namespace app */
85} /* namespace semf */
86#endif // SEMF_APP_PROCESSING_AESCBC_H_
Class for representing errors. Every error should have a unique source code. As a user feel encourage...
Definition: error.h:22
Abstract class for AES-CBC (Advanced Encryption Standard-Cipher Block Chaining) for symmetric encrypt...
Definition: aescbc.h:27
virtual ~AesCbc()=default
virtual void setKey(const uint8_t key[], size_t size)=0
Sets the AES key.
virtual void setInitializationVector(const uint8_t initializationVector[])=0
Sets the initialization vector.
virtual void resetInitializationVector()=0
virtual State decrypt(const uint8_t dataIn[], uint8_t bufferOut[], size_t size)=0
Performs an AES-CBC decryption on the given (encrypted) data.
virtual State encrypt(const uint8_t dataIn[], uint8_t bufferOut[], size_t size)=0
Encrypts the given data using AES-CBC algorithm.