lfsr_test.c revision f1b68725503ff3e46001eee5a1751e29a43a09d1
/*
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* 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 INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM 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.11 2001/11/27 00:55:43 gson Exp $ */
#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);
}