LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
aes_crypto_service.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <logicalaccess/lla_core_api.hpp>
5
6namespace logicalaccess
7{
17class LLA_CORE_API AESCryptoService
18{
19 public:
20 ByteVector aes_encrypt(const ByteVector &data, const ByteVector &iv,
21 std::shared_ptr<Key> key);
22
23 ByteVector aes_decrypt(const ByteVector &data, const ByteVector &iv,
24 std::shared_ptr<Key> key);
25
26 private:
27 // Adjust IV. If `iv` is empty vector, return an full zero iv.
28 ByteVector adjust_iv(const ByteVector &iv);
29
30 ByteVector perform_operation(const ByteVector &data, const ByteVector &iv,
31 std::shared_ptr<Key> key, bool encrypt);
32
33 ByteVector in_memory(const ByteVector &data, const ByteVector &iv,
34 std::shared_ptr<Key> key, bool encrypt);
35
36 ByteVector with_pkcs(const ByteVector &data, const ByteVector &iv,
37 std::shared_ptr<Key> key, bool encrypt);
38};
39
48class LLA_CORE_API IAESCryptoService
49{
50 public:
51 virtual ByteVector aes_encrypt(const ByteVector &data, const ByteVector &iv,
52 std::shared_ptr<Key> key) = 0;
53
54 virtual ByteVector aes_decrypt(const ByteVector &data, const ByteVector &iv,
55 std::shared_ptr<Key> key) = 0;
56};
57}
Definition: aes_crypto_service.hpp:18
Definition: aes_crypto_service.hpp:49
virtual ByteVector aes_encrypt(const ByteVector &data, const ByteVector &iv, std::shared_ptr< Key > key)=0
virtual ByteVector aes_decrypt(const ByteVector &data, const ByteVector &iv, std::shared_ptr< Key > key)=0
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
Definition: asn1.hpp:9