F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
AesGcmDecryptor.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title AesGcmDecryptor.hpp
3 // \author cadena and claradavisb
4 // \brief hpp file for AesGcmDecryptor component implementation class
5 // ======================================================================
6 
7 #ifndef Svc_Ccsds_AesGcmDecryptor_HPP
8 #define Svc_Ccsds_AesGcmDecryptor_HPP
9 
10 #include "Svc/Ccsds/AesGcmDecryptor/AesGcmDecryptorComponentAc.hpp"
12 
13 #include <openssl/evp.h>
14 
15 namespace Svc {
16 
17 namespace Ccsds {
18 
19 class AesGcmDecryptor final : public AesGcmDecryptorComponentBase {
20  public:
21  // ----------------------------------------------------------------------
22  // Component construction and destruction
23  // ----------------------------------------------------------------------
24 
26  explicit AesGcmDecryptor(const char* const compName
27  );
28 
31 
32  // The component owns an OpenSSL cipher context and a fetched algorithm, it must not be copied or moved
33  AesGcmDecryptor(const AesGcmDecryptor&) = delete;
34  AesGcmDecryptor& operator=(const AesGcmDecryptor&) = delete;
35  AesGcmDecryptor(AesGcmDecryptor&&) = delete;
37 
38  private:
39  // ----------------------------------------------------------------------
40  // Handler implementations for typed input ports
41  // ----------------------------------------------------------------------
42 
46  void decryptIn_handler(FwIndexType portNum,
47  U16 securityAssociationIndex,
48  Fw::Buffer& data,
49  const ComCfg::FrameContext& context) override;
50 
54  void decryptReturnIn_handler(FwIndexType portNum,
55  Fw::Buffer& data,
56  const ComCfg::FrameContext& context) override;
57 
58  private:
59  // ----------------------------------------------------------------------
60  // Member variables
61  // ----------------------------------------------------------------------
62 
64  EVP_CIPHER* m_cipher;
65 
67  EVP_CIPHER_CTX* m_ctx;
68 
71 
73  U8 m_aadVcId;
74 
76  U16 m_aadSaIndex;
77 };
78 
79 } // namespace Ccsds
80 
81 } // namespace Svc
82 
83 #endif
AesGcmDecryptor & operator=(const AesGcmDecryptor &)=delete
AesGcmDecryptor(const char *const compName)
Construct AesGcmDecryptor object.
~AesGcmDecryptor()
Destroy AesGcmDecryptor object.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
PlatformIndexType FwIndexType
Type used to pass context info between components during framing/deframing.
RateGroupDivider component implementation.