FreeBSD/sys/kgssapi/krb5/kcrypto.c
/*
 * Add two variable precision numbers in big-endian representation
 * using ones-complement arithmetic.
 */
Add two variable precision numbers in big-endian representation
using ones-complement arithmetic.
Add two variable precision numbers in big - endian representation using ones - complement arithmetic .
static void
krb5_ones_complement_add(uint8_t *out, const uint8_t *in, size_t len)
{
	int n, i;
	n = 0;
	for (i = len - 1; i >= 0; i--) {
		n = out[i] + in[i] + n;
		out[i] = n;
		n >>= 8;
	}
	for (i = len - 1; n && i >= 0; i--) {
		n = out[i] + n;
		out[i] = n;
		n >>= 8;
	}
}
static void krb5_ones_complement_add ( uint8_t * out , const uint8_t * in , size_t len ) { int n , i ; n = 0 ; for ( i = len - 1 ; i >= 0 ; i -- ) { n = out [ i ] + in [ i ] + n ; out [ i ] = n ; n >>= 8 ; } for ( i = len - 1 ; n && i >= 0 ; i -- ) { n = out [ i ] + n ; out [ i ] = n ; n >>= 8 ; } }
Add two variable precision numbers in big-endian representation
 using ones-complement arithmetic.
Add two variable precision numbers in big - endian representation using ones - complement arithmetic .
/*
	 * First calculate the 2s complement sum, remembering the
	 * carry.
	 */ /*
	 * Then add back the carry.
	 */