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.

xmss_commons.c 454 B

8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
123456789101112131415161718192021222324252627
  1. /*
  2. xmss_commons.c 20160722
  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. #include <stdint.h>
  11. void to_byte(unsigned char *out, unsigned long long in, uint32_t bytes)
  12. {
  13. int32_t i;
  14. for (i = bytes-1; i >= 0; i--) {
  15. out[i] = in & 0xff;
  16. in = in >> 8;
  17. }
  18. }
  19. void hexdump(const unsigned char *a, size_t len)
  20. {
  21. size_t i;
  22. for (i = 0; i < len; i++)
  23. printf("%02x", a[i]);
  24. }