Branch Coverage

Secp256k1.xs
Criterion Covered Total %
branch 130 178 73.0


line true false branch
55 4 4 if (perl_ctx->pubkeys_count > 0) {
57 6 4 for (i = 0; i < perl_ctx->pubkeys_count; ++i) {
76 39 15 if (perl_ctx->pubkey != NULL) {
85 9 9 if (perl_ctx->xonly_pubkey != NULL) {
94 27 9 if (perl_ctx->signature != NULL) {
103 12 9 if (perl_ctx->schnorr_signature != NULL) {
112 16 8 if (perl_ctx->recoverable_signature != NULL) {
123 208 2 if (!(sv_isobject(self) && sv_derived_from(self, "Bitcoin::Secp256k1"))) {
0 208 if (!(sv_isobject(self) && sv_derived_from(self, "Bitcoin::Secp256k1"))) {
140 5 90 if (size != wanted_size) {
149 34 0 if (!SvOK(data) || SvROK(data)) {
0 34 if (!SvOK(data) || SvROK(data)) {
164 4 30 if (!result) {
174 9 0 if (!SvOK(data) || SvROK(data)) {
0 9 if (!SvOK(data) || SvROK(data)) {
187 0 8 if (!result) {
198 160 5 for (i = 0; i < size; ++i) {
206 160 5 for (i = 0; i < CURVE_SIZE; ++i) {
223 0 3 PUSHMARK(SP);
227 0 3 EXTEND(SP, 1);
236 0 3 if (count != 1) {
248 0 3 if (SvOK(tmp)) {
251 0 0 if (!secp256k1_context_randomize(ctx->ctx, randomize)) {
279 35 21 if (items > 1 && SvOK(ST(1))) {
34 1 if (items > 1 && SvOK(ST(1))) {
284 1 21 else if (items > 1) {
290 6 46 if (items > 2 && !SvTRUE(ST(2))) {
3 3 if (items > 2 && !SvTRUE(ST(2))) {
294 49 3 if (ctx->pubkey != NULL) {
319 10 4 if (items > 1 && SvOK(ST(1))) {
9 1 if (items > 1 && SvOK(ST(1))) {
324 1 4 else if (items > 1) {
328 10 3 if (ctx->xonly_pubkey != NULL) {
350 15 8 if (items > 1 && SvOK(ST(1))) {
14 1 if (items > 1 && SvOK(ST(1))) {
352 0 14 if (SvROK(new_signature)) {
367 1 13 if (!result) {
374 1 8 else if (items > 1) {
378 19 3 if (ctx->signature != NULL) {
402 9 7 if (items > 1 && SvOK(ST(1))) {
8 1 if (items > 1 && SvOK(ST(1))) {
404 0 8 if (SvROK(new_signature)) {
415 1 7 else if (items > 1) {
419 13 3 if (ctx->schnorr_signature != NULL) {
434 10 6 if (items > 1 && SvOK(ST(1))) {
10 0 if (items > 1 && SvOK(ST(1))) {
437 0 10 if (!SvOK(new_signature)) {
442 10 0 if (!SvROK(new_signature) || SvTYPE(SvRV(new_signature)) != SVt_PVHV) {
0 10 if (!SvROK(new_signature) || SvTYPE(SvRV(new_signature)) != SVt_PVHV) {
451 10 0 if (!sig_sv || !recovery_id_sv) {
0 10 if (!sig_sv || !recovery_id_sv) {
458 10 0 if (recovery_id < 0 || recovery_id > 3) {
0 10 if (recovery_id < 0 || recovery_id > 3) {
470 0 10 if (!result) {
477 0 6 else if (items > 1) {
481 16 0 if (ctx->recoverable_signature != NULL) {
492 0 16 if (!result) {
513 2 4 if (ctx->pubkeys_count > 0) {
539 0 3 if (!result) {
552 0 1 if (ctx->pubkey == NULL) {
564 0 1 if (!result) {
577 0 12 if (ctx->signature == NULL) {
589 4 8 RETVAL = result ? &PL_sv_yes : &PL_sv_no;
600 8 0 if (ctx->pubkey == NULL || ctx->signature == NULL) {
0 8 if (ctx->pubkey == NULL || ctx->signature == NULL) {
613 5 2 RETVAL = result ? &PL_sv_yes : &PL_sv_no;
624 6 0 if (ctx->xonly_pubkey == NULL || ctx->schnorr_signature == NULL) {
0 6 if (ctx->xonly_pubkey == NULL || ctx->schnorr_signature == NULL) {
638 4 2 RETVAL = result ? &PL_sv_yes : &PL_sv_no;
664 0 2 if (!result) {
690 0 4 if (!result) {
696 0 4 PUSHMARK(SP);
700 0 4 EXTEND(SP, 1);
709 0 4 if (count != 1) {
725 3 1 SvOK(tmp) ? size_bytestr_from_sv(tmp, CURVE_SIZE, "auxiliary randomness") : NULL
728 0 4 if (!result) {
757 0 6 if (!result) {
772 0 10 if (ctx->recoverable_signature == NULL) {
787 0 10 if (!result) {
806 2 1 && secp256k1_ec_seckey_verify(ctx->ctx, seckey_str)
1 1 && secp256k1_ec_seckey_verify(ctx->ctx, seckey_str)
809 1 2 RETVAL = result ? &PL_sv_yes : &PL_sv_no;
830 0 2 if (!result) {
853 0 1 if (!result) {
877 1 1 if (!result) {
902 0 1 if (!result) {
926 0 1 if (!result) {
951 1 1 if (!result) {
970 0 2 if (!result) {