| 302 | } |
| 303 | |
| 304 | void ECC_Start() { |
| 305 | assert(secp256k1_context_sign == NULL); |
| 306 | |
| 307 | secp256k1_context *ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN); |
| 308 | assert(ctx != NULL); |
| 309 | |
| 310 | { |
| 311 | // Pass in a random blinding seed to the secp256k1 context. |
| 312 | unsigned char seed[32]; |
| 313 | LockObject(seed); |
| 314 | GetRandBytes(seed, 32); |
| 315 | bool ret = secp256k1_context_randomize(ctx, seed); |
| 316 | assert(ret); |
| 317 | UnlockObject(seed); |
| 318 | } |
| 319 | |
| 320 | secp256k1_context_sign = ctx; |
| 321 | } |
| 322 | |
| 323 | void ECC_Stop() { |
| 324 | secp256k1_context *ctx = secp256k1_context_sign; |