| 78 | #endif |
| 79 | |
| 80 | Sketch* Construct(int bits, int impl) |
| 81 | { |
| 82 | switch (FieldImpl(impl)) { |
| 83 | case FieldImpl::GENERIC: |
| 84 | switch ((bits + 7) / 8) { |
| 85 | case 1: |
| 86 | return ConstructGeneric1Byte(bits, impl); |
| 87 | case 2: |
| 88 | return ConstructGeneric2Bytes(bits, impl); |
| 89 | case 3: |
| 90 | return ConstructGeneric3Bytes(bits, impl); |
| 91 | case 4: |
| 92 | return ConstructGeneric4Bytes(bits, impl); |
| 93 | case 5: |
| 94 | return ConstructGeneric5Bytes(bits, impl); |
| 95 | case 6: |
| 96 | return ConstructGeneric6Bytes(bits, impl); |
| 97 | case 7: |
| 98 | return ConstructGeneric7Bytes(bits, impl); |
| 99 | case 8: |
| 100 | return ConstructGeneric8Bytes(bits, impl); |
| 101 | default: |
| 102 | return nullptr; |
| 103 | } |
| 104 | break; |
| 105 | #ifdef HAVE_CLMUL |
| 106 | case FieldImpl::CLMUL: |
| 107 | if (EnableClmul()) { |
| 108 | switch ((bits + 7) / 8) { |
| 109 | case 1: |
| 110 | return ConstructClMul1Byte(bits, impl); |
| 111 | case 2: |
| 112 | return ConstructClMul2Bytes(bits, impl); |
| 113 | case 3: |
| 114 | return ConstructClMul3Bytes(bits, impl); |
| 115 | case 4: |
| 116 | return ConstructClMul4Bytes(bits, impl); |
| 117 | case 5: |
| 118 | return ConstructClMul5Bytes(bits, impl); |
| 119 | case 6: |
| 120 | return ConstructClMul6Bytes(bits, impl); |
| 121 | case 7: |
| 122 | return ConstructClMul7Bytes(bits, impl); |
| 123 | case 8: |
| 124 | return ConstructClMul8Bytes(bits, impl); |
| 125 | default: |
| 126 | return nullptr; |
| 127 | } |
| 128 | } |
| 129 | break; |
| 130 | case FieldImpl::CLMUL_TRI: |
| 131 | if (EnableClmul()) { |
| 132 | switch ((bits + 7) / 8) { |
| 133 | case 1: |
| 134 | return ConstructClMulTri1Byte(bits, impl); |
| 135 | case 2: |
| 136 | return ConstructClMulTri2Bytes(bits, impl); |
| 137 | case 3: |
no test coverage detected