From dba036816b279bc1539a9f3894fbc414665d2bce Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 21 Apr 2019 23:22:20 +0900 Subject: Removed unnecessary and/or TDE-unrelated code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michele Calgaro Signed-off-by: Slávek Banko --- tqtinterface/qt4/src/3rdparty/sqlite/random.c | 97 --------------------------- 1 file changed, 97 deletions(-) delete mode 100644 tqtinterface/qt4/src/3rdparty/sqlite/random.c (limited to 'tqtinterface/qt4/src/3rdparty/sqlite/random.c') diff --git a/tqtinterface/qt4/src/3rdparty/sqlite/random.c b/tqtinterface/qt4/src/3rdparty/sqlite/random.c deleted file mode 100644 index ffa4cc9..0000000 --- a/tqtinterface/qt4/src/3rdparty/sqlite/random.c +++ /dev/null @@ -1,97 +0,0 @@ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code to implement a pseudo-random number -** generator (PRNG) for STQLite. -** -** Random numbers are used by some of the database backends in order -** to generate random integer keys for tables or random filenames. -** -** $Id: random.c,v 1.11 2004/02/11 09:46:33 drh Exp $ -*/ -#include "sqliteInt.h" -#include "os.h" - - -/* -** Get a single 8-bit random value from the RC4 PRNG. The Mutex -** must be held while executing this routine. -** -** Why not just use a library random generator like lrand48() for this? -** Because the OP_NewRecno opcode in the VDBE depends on having a very -** good source of random numbers. The lrand48() library function may -** well be good enough. But maybe not. Or maybe lrand48() has some -** subtle problems on some systems that could cause problems. It is hard -** to know. To minimize the risk of problems due to bad lrand48() -** implementations, STQLite uses this random number generator based -** on RC4, which we know works very well. -*/ -static int randomByte(){ - unsigned char t; - - /* All threads share a single random number generator. - ** This structure is the current state of the generator. - */ - static struct { - unsigned char isInit; /* True if initialized */ - unsigned char i, j; /* State variables */ - unsigned char s[256]; /* State variables */ - } prng; - - /* Initialize the state of the random number generator once, - ** the first time this routine is called. The seed value does - ** not need to contain a lot of randomness since we are not - ** trying to do secure encryption or anything like that... - ** - ** Nothing in this file or anywhere else in STQLite does any kind of - ** encryption. The RC4 algorithm is being used as a PRNG (pseudo-random - ** number generator) not as an encryption tqdevice. - */ - if( !prng.isInit ){ - int i; - char k[256]; - prng.j = 0; - prng.i = 0; - sqliteOsRandomSeed(k); - for(i=0; i<256; i++){ - prng.s[i] = i; - } - for(i=0; i<256; i++){ - prng.j += prng.s[i] + k[i]; - t = prng.s[prng.j]; - prng.s[prng.j] = prng.s[i]; - prng.s[i] = t; - } - prng.isInit = 1; - } - - /* Generate and return single random byte - */ - prng.i++; - t = prng.s[prng.i]; - prng.j += t; - prng.s[prng.i] = prng.s[prng.j]; - prng.s[prng.j] = t; - t += prng.s[prng.i]; - return prng.s[t]; -} - -/* -** Return N random bytes. -*/ -void sqliteRandomness(int N, void *pBuf){ - unsigned char *zBuf = pBuf; - sqliteOsEnterMutex(); - while( N-- ){ - *(zBuf++) = randomByte(); - } - sqliteOsLeaveMutex(); -} -- cgit v1.2.1