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.

26 lines
416 B

  1. /*
  2. xmss_commons.c 20160210
  3. Andreas Hülsing
  4. Joost Rijneveld
  5. Public domain.
  6. */
  7. #include "xmss_commons.h"
  8. #include <stdlib.h>
  9. #include <stdio.h>
  10. void to_byte(unsigned char *out, unsigned int in, int bytes)
  11. {
  12. int i;
  13. for (i = 0; i < bytes; i++) {
  14. out[i] = in & 0xff;
  15. in = in >> 8;
  16. }
  17. }
  18. void hexdump(const unsigned char *a, size_t len)
  19. {
  20. size_t i;
  21. for (i = 0; i < len; i++)
  22. printf("%02x", a[i]);
  23. }