From fb49425915aef7877fedfc58730cef8bcf58aee7 Mon Sep 17 00:00:00 2001 From: Mikko Juola Date: Thu, 1 Oct 2009 14:37:49 +0530 Subject: Harden the PRNG for public servers. Detailed discussion is here: http://www.genodeen.net/index.clua?cwrng Signed-off-by: Darshan Shaligram --- crawl-ref/source/AppHdr.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crawl-ref/source/AppHdr.h') diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h index b4fea9cd14..385d4827a6 100644 --- a/crawl-ref/source/AppHdr.h +++ b/crawl-ref/source/AppHdr.h @@ -226,6 +226,16 @@ // #define DGL_CLEAR_SCREEN "\033[2J" +# ifndef USE_MORE_SECURE_SEED +# error DGAMELAUNCH builds should define USE_MORE_SECURE_SEED +# endif + + // This secures the PRNG itself by hashing the values with SHA256. + // It doesn't have much point if USE_MORE_SECURE_SEED is not used. + // PRNG will be about 15 times slower when this is turned on, but + // even with that the cpu time used by the PRNG is relatively small. + #define MORE_HARDENED_PRNG + // Startup preferences are saved by player name rather than uid, // since all players use the same uid in dgamelaunch. #ifndef DGL_NO_STARTUP_PREFS_BY_NAME -- cgit v1.2.3-54-g00ecf