LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
symmetric_cipher.hpp
Go to the documentation of this file.
1
7#ifndef SYMETRICCIPHER_HPP
8#define SYMETRICCIPHER_HPP
9
10#include "logicalaccess/plugins/crypto/lla_crypto_api.hpp"
12
13namespace logicalaccess
14{
15class InitializationVector;
16
17namespace openssl
18{
19class SymmetricKey;
20
24class LLA_CRYPTO_API SymmetricCipher
25{
26 public:
33 virtual ~SymmetricCipher();
34
44 virtual void cipher(const ByteVector &src, ByteVector &dest, const SymmetricKey &key,
45 const InitializationVector &iv, bool padding) = 0;
46
47 void cipher(const ByteVector &src, ByteVector &dest, const SymmetricKey &key);
48
49 void cipher(const ByteVector &src, ByteVector &dest, const ByteVector &key,
50 const ByteVector &iv = {});
51
61 virtual void decipher(const ByteVector &src, ByteVector &dest,
62 const SymmetricKey &key, const InitializationVector &iv,
63 bool padding) = 0;
64
65 void decipher(const ByteVector &src, ByteVector &dest, const SymmetricKey &key);
66
67 void decipher(const ByteVector &src, ByteVector &dest, const ByteVector &key,
68 const ByteVector &iv = {});
69
70 virtual unsigned char getBlockSize() const = 0;
71};
72}
73}
74
75#endif /* SYMETRICCIPHER_HPP */
An initialisation vector.
Definition: initialization_vector.hpp:26
A symmetric cipher.
Definition: symmetric_cipher.hpp:25
virtual void cipher(const ByteVector &src, ByteVector &dest, const SymmetricKey &key, const InitializationVector &iv, bool padding)=0
Cipher a buffer.
virtual unsigned char getBlockSize() const =0
virtual void decipher(const ByteVector &src, ByteVector &dest, const SymmetricKey &key, const InitializationVector &iv, bool padding)=0
Decipher a buffer.
An immutable symmetric key.
Definition: symmetric_key.hpp:27
Initialization vector base class.
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
Definition: asn1.hpp:9