view src/lib-otp/otp-parity.h @ 22711:25d4771ad0fd

lib-storage: mailbox_list_index - indentation cleanup
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 14 Dec 2017 02:10:27 +0200
parents 62cf70991cf2
children
line wrap: on
line source

#ifndef OTP_PARITY_H
#define OTP_PARITY_H

extern const unsigned char parity_table[256];

static inline unsigned int otp_parity(unsigned char *data)
{
	unsigned int i, parity = 0;

	for (i = 0; i < OTP_HASH_SIZE; i++)
		parity += parity_table[*data++];

	return parity & 3;
}

#endif