[][src]Function secp256k1_abc_sys::secp256k1_context_randomize

pub unsafe extern "C" fn secp256k1_context_randomize(
    ctx: *mut secp256k1_context,
    seed32: *const c_uchar
) -> c_int

Updates the context randomization to protect against side-channel leakage. Returns: 1: randomization successfully updated 0: error Args: ctx: pointer to a context object (cannot be NULL) In: seed32: pointer to a 32-byte random seed (NULL resets to initial state)

While secp256k1 code is written to be constant-time no matter what secret values are, it's possible that a future compiler may output code which isn't, and also that the CPU may not emit the same radio frequencies or draw the same amount power for all values.

This function provides a seed which is combined into the blinding value: that blinding value is added before each multiplication (and removed afterwards) so that it does not affect function results, but shields against attacks which rely on any input-dependent behaviour.

You should call this after secp256k1_context_create or secp256k1_context_clone, and may call this repeatedly afterwards.