I2C toy code
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

33 lines
1.0 KiB

  1. /* LibTomCrypt, modular cryptographic library -- Tom St Denis
  2. *
  3. * LibTomCrypt is a library that provides various cryptographic
  4. * algorithms in a highly modular and flexible manner.
  5. *
  6. * The library is free for all purposes without any express
  7. * guarantee it works.
  8. */
  9. #ifndef DEMOS_COMMON_H_
  10. #define DEMOS_COMMON_H_
  11. #include <tomcrypt.h>
  12. extern prng_state yarrow_prng;
  13. #ifdef LTC_VERBOSE
  14. #define DO(x) do { fprintf(stderr, "%s:\n", #x); run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0)
  15. #define DOX(x, str) do { fprintf(stderr, "%s - %s:\n", #x, (str)); run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0)
  16. #else
  17. #define DO(x) do { run_cmd((x), __LINE__, __FILE__, #x, NULL); } while (0)
  18. #define DOX(x, str) do { run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0)
  19. #endif
  20. void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm);
  21. void print_hex(const char* what, const void* v, const unsigned long l);
  22. #endif /* DEMOS_COMMON_H_ */
  23. /* ref: $Format:%D$ */
  24. /* git commit: $Format:%H$ */
  25. /* commit time: $Format:%ai$ */