IPSEC_PARITYOFBUFFER(3)

NAME
ipsec parityofbuffer - return difference of counts of 0-bits and 1-bits in a buffer

SYNOPSIS
#include <freeswan.h>

int parityofbuffer(const unsigned char *buf, size_t len)

DESCRIPTION
parityofbuffer counts the number of 0-bits and the number 1-bits in the bytes of the buffer.

The difference between the two counts is then computed, ones minus zeros. The result is returned.

This function may be of utility in discovering non-randomess in supposedly random sources.

DIAGNOSTICS

HISTORY
Written for the FreeS/WAN project by Michael Richardson.