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.
 
 

34 line
535 B

  1. #include <stdio.h>
  2. #include "../prg.h"
  3. static void hexdump(unsigned char *a, size_t len)
  4. {
  5. size_t i;
  6. for (i = 0; i < len; i++)
  7. printf("%02x", a[i]);
  8. }
  9. int main()
  10. {
  11. unsigned char seed[32] = {0};
  12. unsigned char out[64];
  13. unsigned char addr[16] = {2};
  14. printf("Case 1: All 0\n");
  15. prg(out, 64, seed, 32);
  16. printf("\n");
  17. hexdump(out, 64);
  18. printf("\n");
  19. printf("Case 2: key = 1\n");
  20. seed[31] = 1;
  21. prg_with_counter(out, 64, seed, 32, addr);
  22. printf("\n");
  23. hexdump(out, 64);
  24. printf("\n");
  25. return 0;
  26. }