38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
buffer += current_length;
length -= current_length;
}
return;
}
#else
# ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
# endif
# ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
# endif
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
buffer += current_length;
length -= current_length;
}
return;
}
#elif 1
#include <tcl.h>
void randombytes(uint8_t *buffer, uint64_t length) {
Tcl_Panic("Random data is not available");
#if 0
Tcl_Channel fd;
fd = Tcl_FSOpenFileChannel(NULL, Tcl_NewStringObj("/dev/urandom", -1), "rb", 0644);
if (!fd) {
Tcl_Panic("Unable to get random data");
}
while (length > 0) {
read_ret = Tcl_ReadChars(fd, buffer, length);
if (read_ret <= 0) {
continue;
}
buffer += read_ret;
length -= read_ret;
}
Tcl_Close(fd);
#endif
return;
/* NOTREACH */
buffer = buffer;
length = length;
}
#else
# ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
# endif
# ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
# endif
|