versadac  1
versadac - Scalable Recorder Firmware
DISE_encryption_IDM.h
1 // Copyright (c) 2013 Invensys Eurotherm Ltd.
3 //
4 // MODULE : IDMEncryption
5 // FILENAME : DISE_Crypto_IDM.h
6 // AUTHOR : Adrian Oliver
7 // CREATED : November 2012
8 // DESCRIPTION : Header file for IDM Encryption:
10 // These functions will use Instrument database data to automatically generate
11 // Encryption/Decryption keys.
12 //
13 // Once the key has been generated, it uses the Authenticated Encryption/Decryption
14 // functions
15 
16 // The Key generation is automatic - however on initialisation, the device/IDM
17 // needs to register here which instrument database parameters are to be used
18 // during the key generation. This is done by the host providing the
19 // structure - if this is not provided, this module will fail to link
21 
22 #ifndef DeviceIDMSymmetricEncryption_IDM_H
23 #define DeviceIDMSymmetricEncryption_IDM_H
24 
25 #include "stdtypes.h"
26 #include "DISE_encryption.h"
27 
30 typedef struct
31 {
32  unsigned long CISP;
33  bool HasBeenUpdated;
35 
38 // The IDM needs additional information from the base class, which is all
39 // the target device needs...
41 {
42 public:
44 
46 
49  const char* pszKDF_Salt,
50  const char* pszKDF_FixedSourceKey,
51  const bool UseIV);
52 
54  virtual void ParameterHasBeenUpdatedFromDevice(unsigned long CISP);
55 
56  virtual bool IsThisParameterRequiredForKDF(unsigned long CISP);
57 
58  virtual bool HaveAllParametersRequiredForKDFBeenUpdated(void);
59 
60 private:
62 
63 };
64 
67 // MUST CALL THIS BEFORE DeviceIDMSymmetricEncryption_Initialise
68 void DeviceIDMSymmetricEncryption_Initialise_IDM(void);
69 
70 // Call as the last think in IDM - otherwise memory leak!
71 void DeviceIDMSymmetricEncryption_UnInitialise(void);
72 
73 void DeviceIDMSymmetricEncryption_IDM_ParameterHasBeenUpdatedFromDevice(unsigned long CISP);
74 
75 bool DeviceIDMSymmetricEncryption_IDM_IsThisParameterRequiredForDISE(unsigned long CISP);
76 
78 
79 #endif
Definition: DISE_encryption.h:105
Definition: DISE_encryption_IDM.h:30
Definition: DISE_encryption_IDM.h:40