Smart-Home am Beispiel der Präsenzerkennung im Raum Projektarbeit Lennart Heimbs, Johannes Krug, Sebastian Dohle und Kevin Holzschuh bei Prof. Oliver Hofmann SS2019
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MyCryptoHAL.h 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * The MySensors Arduino library handles the wireless radio link and protocol
  3. * between your home built sensors/actuators and HA controller of choice.
  4. * The sensors forms a self healing radio network with optional repeaters. Each
  5. * repeater and gateway builds a routing tables in EEPROM which keeps track of the
  6. * network topology allowing messages to be routed to nodes.
  7. *
  8. * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
  9. * Copyright (C) 2013-2018 Sensnology AB
  10. * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
  11. *
  12. * Documentation: http://www.mysensors.org
  13. * Support Forum: http://forum.mysensors.org
  14. *
  15. * This program is free software; you can redistribute it and/or
  16. * modify it under the terms of the GNU General Public License
  17. * version 2 as published by the Free Software Foundation.
  18. */
  19. #ifndef MyCryptoHAL_h
  20. #define MyCryptoHAL_h
  21. // Implement these as functions or macros
  22. /**
  23. * @brief SHA256 calculation
  24. *
  25. * The returned hash size is always 32 bytes.
  26. *
  27. * @param dest Buffer to return 32-byte hash.
  28. * @param data Buffer with data to add.
  29. * @param dataLength Size of data buffer.
  30. */
  31. void SHA256(uint8_t *dest, const uint8_t *data, size_t dataLength);
  32. /**
  33. * @brief SHA256 HMAC calculation
  34. *
  35. * The returned hash size is always 32 bytes.
  36. *
  37. * @param dest Buffer to return 32-byte hash.
  38. * @param key Buffer with HMAC key.
  39. * @param keyLength Size of HMAC key.
  40. * @param data Buffer with data to add.
  41. * @param dataLength Size of data buffer.
  42. */
  43. void SHA256HMAC(uint8_t *dest, const uint8_t *key, size_t keyLength, const uint8_t *data,
  44. size_t dataLength);
  45. #endif