lfsr_test.c revision 3759f10fc543747668b1ca4b4671f35b0dea8445
/*
* Copyright (C) 2004, 2005, 2007, 2015 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-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: lfsr_test.c,v 1.16 2007/06/19 23:46:59 tbox Exp $ */
/*! \file */
#include <config.h>
#include <stdio.h>
int
int i;
/*
* Verify that returned values are reproducable.
*/
for (i = 0; i < 32; i++) {
}
for (i = 0; i < 32; i++) {
printf("lfsr1: state[%2d] = %08x, "
"but new state is %08x\n",
}
/*
* Now do the same with skipping.
*/
for (i = 0; i < 32; i++) {
}
for (i = 0; i < 32; i++) {
printf("lfsr1: state[%2d] = %08x, "
"but new state is %08x\n",
}
/*
* Try to find the period of the LFSR.
*
* x^16 + x^5 + x^3 + x^2 + 1
*/
for (i = 0; i < 32; i++) {
}
for (i = 0; i < 32; i++) {
printf("lfsr2: state[%2d] = %08x, "
"but new state is %08x\n",
}
return (0);
}