| 185 | } |
| 186 | |
| 187 | void CLKeySearchDevice::init(const secp256k1::uint256 &start, int compression, const secp256k1::uint256 &stride) |
| 188 | { |
| 189 | if(start.cmp(secp256k1::N) >= 0) { |
| 190 | throw KeySearchException("Starting key is out of range"); |
| 191 | } |
| 192 | |
| 193 | _start = start; |
| 194 | |
| 195 | _stride = stride; |
| 196 | |
| 197 | _compression = compression; |
| 198 | |
| 199 | try { |
| 200 | allocateBuffers(); |
| 201 | |
| 202 | generateStartingPoints(); |
| 203 | |
| 204 | // Set the incrementor |
| 205 | secp256k1::ecpoint g = secp256k1::G(); |
| 206 | secp256k1::ecpoint p = secp256k1::multiplyPoint(secp256k1::uint256((uint64_t)_points ) * _stride, g); |
| 207 | |
| 208 | setIncrementor(p); |
| 209 | } catch(cl::CLException ex) { |
| 210 | throw KeySearchException(ex.msg); |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | void CLKeySearchDevice::doStep() |
| 215 | { |
nothing calls this directly
no test coverage detected