lfsr_test.c revision 1a69a1a78cfaa86f3b68bbc965232b7876d4da2a
/*
* Copyright (C) 1999, 2000 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.
*/
#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);
}