| 62 | } |
| 63 | |
| 64 | void multiply(uint32_t factor) { |
| 65 | if (factor == 0 || is_zero()) { |
| 66 | limbs.clear(); |
| 67 | return; |
| 68 | } |
| 69 | uint64_t carry = 0; |
| 70 | for (uint32_t &limb : limbs) { |
| 71 | uint64_t value = static_cast<uint64_t>(limb) * factor + carry; |
| 72 | limb = static_cast<uint32_t>(value); |
| 73 | carry = value >> 32; |
| 74 | } |
| 75 | if (carry != 0) { |
| 76 | limbs.push_back(static_cast<uint32_t>(carry)); |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | void add(uint32_t value) { |
| 81 | uint64_t carry = value; |
no test coverage detected