Function with_raw_global_context

Source
pub fn with_raw_global_context<T, F: FnOnce(NonNull<Context>) -> T>(
    f: F,
    rerandomize_seed: Option<&[u8; 32]>,
) -> T
Expand description

Borrows the global context as a raw pointer and does some operation on it.

If rerandomize_seed is provided, then rerandomize_global_context is called on the context after the operation. This argument should be provided alongside any operation that uses secret data (e.g. signing, but not verification). If you have random data available, it should be provided here; it will be mixed with the current random state as well as the system RNG if it is available. If you do not have any random data, it is fine to provide all zeros, or a counter, or a weak source of entropy. This is a defense-in-depth measure to protect against side-channel attacks, and anything helps (and nothing will hurt).