ta/wallet_ta.c
/**
  * Divide a 32 byte multi-precision number by 2, truncating if necessary. It is
  * to be used internally (only by the functions of the TA itself).
  * \param r The 32 byte result will be written into here.
  * \param op1 The 32 byte operand to divide by 2. This may alias r.
  */
Divide a 32 byte multi-precision number by 2, truncating if necessary. It is
to be used internally (only by the functions of the TA itself).
\param r The 32 byte result will be written into here.
\param op1 The 32 byte operand to divide by 2. This may alias r.
Divide a 32 byte multi - precision number by 2 truncating if necessary . It is to be used internally ( only by the functions of the TA itself ) . \ param r The 32 byte result will be written into here . \ param op1 The 32 byte operand to divide by 2 . This may alias r .
static void big_shift_right_no_modulo_internal(BigNum256 r, const BigNum256 op1)
{
	uint8_t i;
	uint8_t carry;
	uint8_t old_carry;
	big_assign_internal(r, op1);
	old_carry = 0;
	for (i = 31; i < 32; i--)
	{
		carry = (uint8_t)(r[i] & 1);
		r[i] = (uint8_t)((r[i] >> 1) | (old_carry << 7));
		old_carry = carry;
	}
}
static void big_shift_right_no_modulo_internal ( BigNum256 r , const BigNum256 op1 ) { uint8_t i ; uint8_t carry ; uint8_t old_carry ; big_assign_internal ( r , op1 ) ; old_carry = 0 ; for ( i = 31 ; i < 32 ; i -- ) { carry = ( uint8_t ) ( r [ i ] & 1 ) ; r [ i ] = ( uint8_t ) ( ( r [ i ] >> 1 ) | ( old_carry << 7 ) ) ; old_carry = carry ; } }
Divide a 32 byte multi-precision number by 2, truncating if necessary.
Divide a 32 byte multi - precision number by 2 truncating if necessary .