| ... | ... | @@ -1259,12 +1259,11 @@ void bigint_and(BigInt *dest, const BigInt *op1, const BigInt *op2) { |
| 1259 | 1259 | bigint_normalize(dest); |
| 1260 | 1260 | return; |
| 1261 | 1261 | } |
| 1262 | | // TODO this code path is untested |
| 1263 | | uint64_t first_digit = dest->data.digit; |
| 1262 | |
| 1264 | 1263 | dest->digit_count = max(op1->digit_count, op2->digit_count); |
| 1265 | 1264 | dest->data.digits = allocate_nonzero<uint64_t>(dest->digit_count); |
| 1266 | | dest->data.digits[0] = first_digit; |
| 1267 | | size_t i = 1; |
| 1265 | |
| 1266 | size_t i = 0; |
| 1268 | 1267 | for (; i < op1->digit_count && i < op2->digit_count; i += 1) { |
| 1269 | 1268 | dest->data.digits[i] = op1_digits[i] & op2_digits[i]; |
| 1270 | 1269 | } |
| ... | ... | @@ -1412,7 +1411,6 @@ void bigint_shr(BigInt *dest, const BigInt *op1, const BigInt *op2) { |
| 1412 | 1411 | return; |
| 1413 | 1412 | } |
| 1414 | 1413 | |
| 1415 | | // TODO this code path is untested |
| 1416 | 1414 | size_t digit_shift_count = shift_amt / 64; |
| 1417 | 1415 | size_t leftover_shift_count = shift_amt % 64; |
| 1418 | 1416 | |
| ... | ... | @@ -1427,7 +1425,7 @@ void bigint_shr(BigInt *dest, const BigInt *op1, const BigInt *op2) { |
| 1427 | 1425 | uint64_t digit = op1_digits[op_digit_index]; |
| 1428 | 1426 | size_t dest_digit_index = op_digit_index - digit_shift_count; |
| 1429 | 1427 | dest->data.digits[dest_digit_index] = carry | (digit >> leftover_shift_count); |
| 1430 | | carry = (0xffffffffffffffffULL << leftover_shift_count) & digit; |
| 1428 | carry = digit << leftover_shift_count; |
| 1431 | 1429 | |
| 1432 | 1430 | if (dest_digit_index == 0) { break; } |
| 1433 | 1431 | op_digit_index -= 1; |