FreeBSD/sys/kgssapi/krb5/kcrypto.c
/*
 * Rotate right 13 of a variable precision number in 'in', storing the
 * result in 'out'. The number is assumed to be big-endian in memory
 * representation.
 */
Rotate right 13 of a variable precision number in 'in', storing the
result in 'out'. The number is assumed to be big-endian in memory
representation.
Rotate right 13 of a variable precision number in ' in ' storing the result in ' out ' . The number is assumed to be big - endian in memory representation .
static void
krb5_rotate_right_13(uint8_t *out, uint8_t *in, size_t numlen)
{
	uint32_t carry;
	size_t i;
	if (numlen == 1) {
		carry = in[0] >> 5;
		out[0] = (in[0] << 3) | carry;
		return;
	}
	carry = ((in[numlen - 2] & 31) << 8) | in[numlen - 1];
	for (i = 2; i < numlen; i++) {
		out[i] = ((in[i - 2] & 31) << 3) | (in[i - 1] >> 5);
	}
	out[1] = ((carry & 31) << 3) | (in[0] >> 5);
	out[0] = carry >> 5;
}
static void krb5_rotate_right_13 ( uint8_t * out , uint8_t * in , size_t numlen ) { uint32_t carry ; size_t i ; if ( numlen == 1 ) { carry = in [ 0 ] >> 5 ; out [ 0 ] = ( in [ 0 ] << 3 ) | carry ; return ; } carry = ( ( in [ numlen - 2 ] & 31 ) << 8 ) | in [ numlen - 1 ] ; for ( i = 2 ; i < numlen ; i ++ ) { out [ i ] = ( ( in [ i - 2 ] & 31 ) << 3 ) | ( in [ i - 1 ] >> 5 ) ; } out [ 1 ] = ( ( carry & 31 ) << 3 ) | ( in [ 0 ] >> 5 ) ; out [ 0 ] = carry >> 5 ; }
Rotate right 13 of a variable precision number in 'in', storing the
 result in 'out'.
Rotate right 13 of a variable precision number in ' in ' storing the result in ' out ' .
/*
	 * Special case when numlen == 1. A rotate right 13 of a
	 * single byte number changes to a rotate right 5.
	 */