docs: function ecp_sign(r, s, p, a, G, n, d, z, l) {
  	var R = ecp_new(l), S = ecp_new(l), k = mpn_new(l);
  	for (;;) {
  		for (var i = 0; i < l; ++i) {
  			k[i] = Math.random() * 0x80000000 | 0;
  		}
  		var r0 = ecp_proj(R, ecp_mul(S, k, G, a, p, l), p, l)[0];
  		if (mpn_cmp(r0, n, l) >= 0) {
  			mpn_sub(r0, r0, n, l);
  		}
  		if (!mpn_zero_p(r0, l)) {
  			var t0 = _ecp_t0, t1 = _ecp_t1;
  			fp_mul(s, fp_inv(t0, k, n, l), fp_add(t1, z, fp_mul(t1, r0, d, n, l), n, l), n, l);
  			if (!mpn_zero_p(s, l)) {
  				mpn_copyi(r, r0, l);
  				break;
  			}
  		}
  	}
  }