anisette is done, how to sign?

This commit is contained in:
2026-01-07 18:23:30 +02:00
parent 2b91057589
commit defb60ac53
32 changed files with 455 additions and 61 deletions

29
tier0/rand.cpp Normal file
View File

@@ -0,0 +1,29 @@
#include "tier0/rand.h"
#include "tier0/lib.h"
static bool b_sIsRandInit = false;
static FILE *s_pURandom = NULL;
PLATFORM_INTERFACE void Plat_InitRandom()
{
if (b_sIsRandInit)
return;
s_pURandom = V_fopen("/dev/urandom","rb");
if (!s_pURandom)
Plat_FatalErrorFunc("/dev/urandom wasn't found somehow\n");
b_sIsRandInit = true;
}
PLATFORM_INTERFACE void Plat_ShutdownRandom()
{
b_sIsRandInit = false;
}
PLATFORM_INTERFACE void Plat_URandom( size_t uBufferSize, uint8_t *szBuffer )
{
if (!b_sIsRandInit)
Plat_InitRandom();
V_fread(szBuffer, 1, uBufferSize, s_pURandom);
}