177
184
/* Compute s = inv(k) (m + xr) mod q */
178
185
if (!BN_mod_mul(&xr,dsa->priv_key,r,dsa->q,ctx)) goto err;/* s = xr */
179
186
if (!BN_add(s, &xr, &m)) goto err; /* s = m + xr */
180
187
if (BN_cmp(s,dsa->q) > 0)
182
189
if (!BN_mod_mul(s,s,kinv,dsa->q,ctx)) goto err;