DDraceNetwork Documentation
Loading...
Searching...
No Matches
secure.cpp File Reference
#include "secure.h"
#include "dbg.h"
#include "types.h"
#include "windows.h"
#include <cstddef>
#include <mutex>
#include "system.h"
Include dependency graph for secure.cpp:

Classes

struct  SECURE_RANDOM_DATA

Functions

static void ensure_secure_random_init ()
void generate_password (char *buffer, unsigned length, const unsigned short *random, unsigned random_length)
void secure_random_password (char *buffer, unsigned length, unsigned pw_length)
void secure_random_fill (void *bytes, unsigned length)
static unsigned int find_next_power_of_two_minus_one (unsigned int n)
int secure_rand_below (int below)

Variables

static struct SECURE_RANDOM_DATA secure_random_data = {}
static constexpr unsigned MAX_PASSWORD_LENGTH = 128

Function Documentation

◆ ensure_secure_random_init()

void ensure_secure_random_init ( )
static

◆ find_next_power_of_two_minus_one()

unsigned int find_next_power_of_two_minus_one ( unsigned int n)
static

Variable Documentation

◆ MAX_PASSWORD_LENGTH

unsigned MAX_PASSWORD_LENGTH = 128
staticconstexpr

◆ secure_random_data

struct SECURE_RANDOM_DATA secure_random_data = {}
static