Simple AES chat program
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.

randsource.c 324B

1234567891011121314151617181920
  1. // Change this file if your system uses a different randomness source.
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <errno.h>
  5. int fill_random(void *buf, int size)
  6. {
  7. FILE *random = fopen("/dev/urandom", "r");
  8. if (!random)
  9. {
  10. return errno;
  11. }
  12. fread(buf, size, 1, random);
  13. fclose(random);
  14. return 0;
  15. }