w1_ds28el15_sha256.h 938 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * 1-Wire SHA256 software implementation for the ds23el15 chip
  3. *
  4. * Copyright (C) 2013 maximintergrated
  5. *
  6. *
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. */
  13. #ifndef _W1_DS28EL15_SHA256_H
  14. #define _W1_DS28EL15_SHA256_H
  15. #ifndef uchar
  16. typedef unsigned char uchar;
  17. #endif
  18. #ifndef ushort
  19. typedef unsigned short ushort;
  20. #endif
  21. #ifndef ulong
  22. typedef unsigned long ulong;
  23. #endif
  24. int compute_sha256(uchar* message, short length, ushort skipconst, ushort reverse, uchar* digest);
  25. int verify_mac256(uchar* MT, short lenght, uchar* compare_MAC);
  26. int compute_mac256(uchar* message, short length, uchar* MAC);
  27. int calculate_nextsecret256(uchar* binding, uchar* partial, int page_num, uchar* man_id);
  28. void set_secret(uchar *secret_data);
  29. void set_romid(uchar *romid_data);
  30. #endif