/*
* Copyright (C) 1999-2002, 2004, 2005, 2007, 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: lfsr.c,v 1.20 2007/06/19 23:47:17 tbox Exp $ */
/*! \file */
#include <config.h>
#include <stddef.h>
#include <stdlib.h>
#include <isc/assertions.h>
void
{
}
/*!
* Return the next state of the lfsr.
*/
static inline isc_uint32_t
{
/*
* If the previous state is zero, we must fill it with something
* here, or we will begin to generate an extremely predictable output.
*
* First, give the reseed function a crack at it. If the state is
* still 0, set it to all ones.
*/
}
return (1);
} else {
return (0);
}
}
void
{
unsigned char *p;
unsigned int bit;
unsigned int byte;
p = data;
while (byte--) {
*p = 0;
*p |= lfsr_generate(lfsr);
*p <<= 1;
}
*p |= lfsr_generate(lfsr);
p++;
}
else
}
}
static inline isc_uint32_t
{
while (skip--)
(void)lfsr_generate(lfsr);
(void)lfsr_generate(lfsr);
}
/*
* Skip "skip" states in "lfsr".
*/
void
{
while (skip--)
(void)lfsr_generate(lfsr);
}
/*
* Skip states in lfsr1 and lfsr2 using the other's current state.
* Return the final state of lfsr1 ^ lfsr2.
*/
{
/* cross-skip. */
}