File: getentropy.c

package info (click to toggle)
python-xeddsa 0.4.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 884 kB
  • sloc: ansic: 5,442; python: 525; makefile: 5
file content (14 lines) | stat: -rw-r--r-- 252 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "kernelrandombytes.h"
#include <sys/random.h>

void kernelrandombytes(unsigned char *x,unsigned long long xlen)
{
  int i;

  while (xlen > 0) {
    if (xlen < 256) i = xlen; else i = 256;
    getentropy(x,i);
    x += i;
    xlen -= i;
  }
}