| 341 | } |
| 342 | |
| 343 | void ECC_Start() { |
| 344 | assert(secp256k1_context_sign == nullptr); |
| 345 | |
| 346 | secp256k1_context *ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN); |
| 347 | assert(ctx != nullptr); |
| 348 | |
| 349 | { |
| 350 | // Pass in a random blinding seed to the secp256k1 context. |
| 351 | std::vector<unsigned char, secure_allocator<unsigned char>> vseed(32); |
| 352 | GetRandBytes(vseed.data(), 32); |
| 353 | bool ret = secp256k1_context_randomize(ctx, vseed.data()); |
| 354 | assert(ret); |
| 355 | } |
| 356 | |
| 357 | secp256k1_context_sign = ctx; |
| 358 | } |
| 359 | |
| 360 | void ECC_Stop() { |
| 361 | secp256k1_context *ctx = secp256k1_context_sign; |