Check-in [180aff4740]
Overview
Comment:Start of work on a Tcl-based random processor -- but for now disable all randomness
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 180aff4740b8531ad5a859c1981ebf4e4b75b2a5799e5b1904dc21c131d9b30a
User & Date: rkeene on 2018-07-02 23:33:20
Other Links: manifest | tags
Context
2018-07-02
23:50
Added support for comments in block JSON format check-in: e6a2a65611 user: rkeene tags: trunk
23:33
Start of work on a Tcl-based random processor -- but for now disable all randomness check-in: 180aff4740 user: rkeene tags: trunk
23:24
More options for signing and verifying a block check-in: 53b03b2ef6 user: rkeene tags: trunk
Changes

Modified randombytes.c from [71404a8978] to [643507802d].

38
39
40
41
42
43
44



































45
46
47
48
49
50
51
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