/*
* Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: entropy2_test.c,v 1.16 2007/06/19 23:46:59 tbox Exp $ */
/*! \file */
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <isc/keyboard.h>
static void
unsigned int len;
unsigned char *base;
printf("\n\t");
}
printf("\n");
}
static void
if (result != ISC_R_SUCCESS) {
exit(1);
}
}
static isc_result_t
if (blocking)
printf("start called, blocking mode.\n");
else
printf("start called, non-blocking mode.\n");
return (isc_keyboard_open(kbd));
}
static void
printf("ENOUGH! Stop typing, please.\r\n");
printf("stop called\n");
}
static isc_result_t
isc_time_t t;
unsigned char c;
if (!blocking)
return (ISC_R_NOENTROPY);
if (result != ISC_R_SUCCESS)
return (result);
TIME_NOW(&t);
sample = isc_time_nanoseconds(&t);
extra = c;
if (result != ISC_R_SUCCESS) {
printf("\r\n");
return (result);
}
printf(".");
return (result);
}
int
unsigned int returned;
unsigned int flags;
CHECK("isc_mem_create()",
isc_mem_create(0, 0, &mctx));
CHECK("isc_entropy_create()",
&source);
"Reading 32 bytes of GOOD random data only, partial OK\n");
flags = 0;
returned = 0;
if (result == ISC_R_NOENTROPY) {
}
return (0);
}