remove unused

This commit is contained in:
iceman1001 2019-04-07 10:58:50 +02:00
commit ff74d56741
3 changed files with 1 additions and 53 deletions

View file

@ -1,30 +0,0 @@
#include "random.h"
static uint32_t g_nextrandom;
/* Generates a (non-cryptographically secure) 32-bit random number.
*
* We don't have an implementation of the "rand" function. Instead we use a
* method of seeding with the time it took to call "autoseed" from first run.
*
* https://github.com/Proxmark/proxmark3/pull/209/commits/f9c1dcd9f6e68a8c07cffed697a9c4c8caed6015
*
* Iceman, rand needs to be fast.
* https://software.intel.com/en-us/articles/fast-random-number-generator-on-the-intel-pentiumr-4-processor/
*/
inline void fast_prand() {
fast_prandEx(GetTickCount());
}
inline void fast_prandEx(uint32_t seed) {
g_nextrandom = seed;
}
uint32_t prand() {
// g_nextrandom *= 6364136223846793005;
// g_nextrandom += 1;
//return (uint32_t)(g_nextrandom >> 32) % 0xffffffff;
g_nextrandom = (214013 * g_nextrandom + 2531011);
return (g_nextrandom >> 16) & 0xFFFF;
}

View file

@ -1,21 +0,0 @@
//-----------------------------------------------------------------------------
// Micolous Jan 2017
// Iceman Jan 2017
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// pseudo rng generator. To be used when PM3 simulates Mifare tag.
// i.e. 'hf mf sim'
// 'hf 14a sim'
//-----------------------------------------------------------------------------
#ifndef __RANDOM_H
#define __RANDOM_H
#include "common.h"
#include "ticks.h"
void fast_prand();
void fast_prandEx(uint32_t seed);
uint32_t prand();
#endif