entropy_test.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 2000, 2001, 2004, 2005, 2007, 2015, 2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* $Id: entropy_test.c,v 1.23 2007/06/19 23:46:59 tbox Exp $ */
/*! \file */
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
static void
unsigned int len;
unsigned char *base;
printf("\n\t");
}
printf("\n");
}
static void
if (result != ISC_R_SUCCESS) {
exit(1);
}
}
int
unsigned char buffer[512];
unsigned int returned;
unsigned int flags;
CHECK("isc_mem_create()",
isc_mem_create(0, 0, &mctx));
CHECK("isc_entropy_create()",
#if 1
CHECK("isc_entropy_createfilesource() 1",
CHECK("isc_entropy_createfilesource() 2",
#else
CHECK("isc_entropy_createfilesource() 3",
#endif
"Reading 32 bytes of GOOD random data only, partial OK\n");
flags = 0;
if (result == ISC_R_NOENTROPY) {
goto any;
}
any:
CHECK("isc_entropy_getdata() pseudorandom",
flags = 0;
flags);
{
}
return (0);
}