* Add limb a to [c0,c1]: [c0,c1] += a. Then extract the lowest * limb of [c0,c1] into n, and left shift the number by 1 limb. * */
| 94 | * limb of [c0,c1] into n, and left shift the number by 1 limb. |
| 95 | * */ |
| 96 | inline void addnextract2(limb_t& c0, limb_t& c1, const limb_t& a, limb_t& n) |
| 97 | { |
| 98 | limb_t c2 = 0; |
| 99 | |
| 100 | // add |
| 101 | c0 += a; |
| 102 | if (c0 < a) { |
| 103 | c1 += 1; |
| 104 | |
| 105 | // Handle case when c1 has overflown |
| 106 | if (c1 == 0) |
| 107 | c2 = 1; |
| 108 | } |
| 109 | |
| 110 | // extract |
| 111 | n = c0; |
| 112 | c0 = c1; |
| 113 | c1 = c2; |
| 114 | } |
| 115 | |
| 116 | /** in_out = in_out^(2^sq) * mul */ |
| 117 | inline void square_n_mul(Num3072& in_out, const int sq, const Num3072& mul) |
no outgoing calls
no test coverage detected