RadioShuttle Lib for the STM32 L4 Heltec Board

Dependents:   Turtle_RadioShuttle

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RadioSecurity.h Source File

RadioSecurity.h

00001 /*
00002  * The file is licensed under the Apache License, Version 2.0
00003  * (c) 2019 Helmut Tschemernjak
00004  * 30826 Garbsen (Hannover) Germany
00005  */
00006 
00007 #include "sha256.h"
00008 #include "aes.h"
00009 
00010 class RadioSecurity : public RadioSecurityInterface {
00011 public:
00012     RadioSecurity();
00013     virtual ~RadioSecurity();
00014     virtual int GetSecurityVersion(void);
00015     /*
00016      * The hash block size for SHA256 in bytes
00017      */
00018     virtual int GetHashBlockSize(void);
00019     virtual void HashPassword(void *seed, int seedLen, void *password, int pwLen, void *hashResult);
00020     
00021     virtual int GetEncryptionBlockSize(void);
00022     virtual void *CreateEncryptionContext(void *key, int keyLen, void *seed = NULL, int seedlen = 0);
00023     virtual void DestroyEncryptionContext(void *context);
00024     virtual void EncryptMessage(void *context, const void *input, void *output, int len);
00025     virtual void DecryptMessage(void *context, const void *input, void *output, int len);
00026     virtual void EncryptTest(void);
00027 private:
00028     static int const _securityVers = 1;
00029 };