Function p256_cortex_m4_sys::p256_sign_step2[][src]

pub unsafe extern "C" fn p256_sign_step2(
    r: *mut u32,
    s: *mut u32,
    hash: *const u8,
    hashlen_in_bytes: u32,
    private_key: *const u32,
    sign_precomp: *mut SignPrecomp
) -> bool

Second step of creating an ECDSA signature, using a two-step procedure.

This function performs the second of two steps, and accounts for the last 1% of the time spent for generating an ECDSA signature.

The “sign_precomp” parameter shall contain a pointer to a state generated by p256_sign_step1.

With a small probability (~ 2^-256), this function will fail, due to the given “k” from the first step is not compatible with the rest of the input, and return false. In this case, the procedure MUST be started over from step 1 with a new random “k”. This is in line with the ECDSA standard. Otherwise true is returned and the signature is placed in “r” and “s”.

When this function returns, “sign_precomp” is also zeroed out and may hence not be reused.