Threefish cipher based raw PRN/noise generator.
Go to file
Andrey Rys 488716ef22
tfrand: first cmdline argument defines random source file name.
2019-05-16 19:43:03 +02:00
.gitignore fix gitignore 2019-04-02 14:24:26 +07:00
Makefile Rename functions and definitions so that both tfcipher and tfnoisegen code may coexist in programs. 2019-03-21 17:33:31 +07:00
README Rename functions and definitions so that both tfcipher and tfnoisegen code may coexist in programs. 2019-03-21 17:33:31 +07:00
machdefs.h Speed up on 64bit systems by using 64bit registers. 2019-03-21 16:42:27 +07:00
tfcore.h Rename functions and definitions so that both tfcipher and tfnoisegen code may coexist in programs. 2019-03-21 17:33:31 +07:00
tfdef.h Rename functions and definitions so that both tfcipher and tfnoisegen code may coexist in programs. 2019-03-21 17:33:31 +07:00
tfe.c Rename functions and definitions so that both tfcipher and tfnoisegen code may coexist in programs. 2019-03-21 17:33:31 +07:00
tfe.h Rename functions and definitions so that both tfcipher and tfnoisegen code may coexist in programs. 2019-03-21 17:33:31 +07:00
tfenc.c Rename functions and definitions so that both tfcipher and tfnoisegen code may coexist in programs. 2019-03-21 17:33:31 +07:00
tfprng.c tfprng: expose range formula in form of macros to build custom range generators. 2019-04-09 18:14:17 +07:00
tfprng.h tfprng: expose range formula in form of macros to build custom range generators. 2019-04-09 18:14:17 +07:00
tfrand.c tfrand: first cmdline argument defines random source file name. 2019-05-16 19:43:03 +02:00

README

Threefish cipher based raw PRN/noise generator.

PURPOSE
	This PRNG is shortened, 32 bit integer version of Threefish-256 block cipher.
	It is technically a 128 bit block cipher with 256 bit key.

	It's purpose is to generate fillers fast, for use in file or disk shredders.
	It is not meant to be secure, i.e. collision/bias free, but it is good at
	generating random noise equal to average output of /dev/urandom, yet much faster.

	Typical performance on Athlon 5000+, x86-32 is about 170M/sec.

	Included tfrand program generates random noise to stdout.

USAGE
	Build example:

		make tfrand

	Test it:

		./tfrand >rng.out

	Measure performance (install tfcrypt first):

		./tfrand | tfcrypt -V.5 -P - /dev/null

	Use libtfng.a library in your code, see headers for function references:
	tfe.h: STREAM reference.
	tfprng.h: PRNG reference.

	When building together with code which uses tfcipher library, please put
	both tfcipher and tfnoisegen code in separate locations, and do not include
	headers which are used privately by both implementations! Only public headers
	and libtfng.a library externals are guaranteed to be namespace clean.
	File names and private headers definitions are mostly same.

WARNING
	Do NOT use it as cipher! It's just a random block generator.
	You have been warned.

ORIGIN
	This code is derived from tfcipher library.

LICENSE
	Public domain -- free to reuse and adapt.

AUTHOR
	Andrey Rys <rys@lynxlynx.ru>, 17Mar2019.