/*
 * Noise generation for PuTTY's cryptographic random number
 * generator.
 */

#include <windows.h>
#include <stdio.h>

/*#include "putty.h"*/
#include "ssh.h"

#include "def.h"
#include "syslogif.h"

static char seedpath[2*256+10] = "\0";

/*
 * Find the random seed file path and store it in `seedpath'.
 */
static void get_seedpath(void) {
    HKEY rkey;
    DWORD type, size;

    size = sizeof(seedpath);

    strcpy(seedpath,"<Wimp$ScrapDir>.seed");

    xsyslogf(SYSLOG_FILE,LOG_ERROR,"get_seedpath: Noise is stubbed out\n");
}

/*
 * This function is called once, at PuTTY startup, and will do some
 * seriously silly things like listing directories and getting disk
 * free space and a process snapshot.
 */

void noise_get_heavy(void (*func) (void *, int)) {
  char noiseBlock[1024];
    xsyslogf(SYSLOG_FILE,LOG_ERROR,"noise_get_heavy: Noise is stubbed out\n");
    /* very silly - use the stack as a noise source */
  func(noiseBlock,sizeof(noiseBlock));
}

void random_save_seed(void) {
    xsyslogf(SYSLOG_FILE,LOG_ERROR,"random_save_seed: Noise is stubbed out\n");
}

/*
 * This function is called every time the random pool needs
 * stirring, and will acquire the system time in all available
 * forms and the battery status.
 */
void noise_get_light(void (*func) (void *, int)) {
  char noiseBlock[128];
    xsyslogf(SYSLOG_FILE,LOG_ERROR,"noise_get_light: Noise is stubbed out\n");
    /* very silly - use the stack as a noise source */
  func(noiseBlock,sizeof(noiseBlock));
}

/*
 * This function is called on every keypress or mouse move, and
 * will add the current Windows time and performance monitor
 * counter to the noise pool. It gets the scan code or mouse
 * position passed in.
 */
void noise_ultralight(DWORD data) {
    xsyslogf(SYSLOG_FILE,LOG_ERROR,"noise_ultralight: Noise is stubbed out\n");
}
