Branch Coverage

Bignum.xs
Criterion Covered Total %
branch 77 130 59.2


line true false branch
23 7 0 if (SvROK(sv) && sv_derived_from(sv, "Crypt::OpenSSL::Bignum")) {
7 0 if (SvROK(sv) && sv_derived_from(sv, "Crypt::OpenSSL::Bignum")) {
24 7 0 return INT2PTR(Crypt__OpenSSL__Bignum, SvIV((SV*)SvRV(sv)));
49 0 10 checkOpenSslCall( bn = BN_new() );
50 0 10 checkOpenSslCall( BN_set_word( bn, p_word ) );
62 0 5 checkOpenSslCall( BN_dec2bn( &bn, p_dec_string ) );
74 0 1 checkOpenSslCall( BN_hex2bn( &bn, p_hex_string ) );
87 2 0 bin = (unsigned char*) SvPV( p_bin_string_SV, bin_length );
88 0 2 checkOpenSslCall( bn = BN_bin2bn( bin, bin_length, NULL ) );
98 0 1 checkOpenSslCall( bn = BN_new() );
99 0 1 checkOpenSslCall( BN_set_word( bn, 0 ) );
109 0 2 checkOpenSslCall( bn = BN_new() );
110 0 2 checkOpenSslCall( BN_set_word( bn, 0 ) );
120 0 2 checkOpenSslCall( bn = BN_new() );
121 0 2 checkOpenSslCall( BN_one( bn ) );
131 0 1 checkOpenSslCall( bn = BN_new() );
132 0 1 checkOpenSslCall( BN_rand( bn, bits, top, bottom) );
142 0 1 checkOpenSslCall( bn = BN_new() );
143 0 1 checkOpenSslCall( BN_pseudo_rand( bn, bits, top, bottom) );
153 0 1 checkOpenSslCall( bn = BN_new() );
154 0 1 checkOpenSslCall( BN_rand_range( bn, r) );
168 0 9 checkOpenSslCall( RETVAL = BN_bn2dec( self ) );
177 0 1 checkOpenSslCall( RETVAL = BN_bn2hex( self ) );
190 3 0 if (length>0) {
194 3 0 bin = (unsigned char *)SvPV_nolen(RETVAL);
220 0 2 if( items > 3 )
222 1 1 bn = ( items < 3 ) ? BN_new() : sv2bn( ST(2) );
223 0 2 checkOpenSslCall( BN_add( bn, self, b ) );
224 1 1 ST(0) = ( (items < 3 ) ? new_obj( bn ) : ST(2) );
232 0 2 if( items > 3 )
234 1 1 bn = ( items < 3 ) ? BN_new() : sv2bn( ST(2) );
235 0 2 checkOpenSslCall( BN_sub( bn, self, b ) );
236 1 1 ST(0) = ( (items < 3 ) ? new_obj( bn ) : ST(2) );
247 0 2 if( items > 4 )
249 1 1 bn = ( items < 4 ) ? BN_new() : sv2bn( ST(3) );
250 0 2 checkOpenSslCall( BN_mul( bn, self, b, ctx ) );
251 1 1 ST(0) = ( (items < 4 ) ? new_obj( bn ) : ST(3) );
263 0 3 if( items > 5 )
265 1 2 quotient = ( items < 4 ) ? BN_new() : sv2bn( ST(3) );
266 2 1 remainder = ( items < 5 ) ? BN_new() : sv2bn( ST(4) );
267 0 3 checkOpenSslCall( BN_div( quotient, remainder, self, b, ctx ) );
268 1 2 ST(0) = ( (items < 4 ) ? new_obj( quotient ) : ST(3) );
269 2 1 ST(1) = ( (items < 5 ) ? new_obj( remainder ) : ST(4) );
277 0 1 checkOpenSslCall( bn = BN_new() );
278 0 1 checkOpenSslCall( BN_sqr( bn, self, ctx ) );
291 0 2 if( items > 4 )
293 1 1 bn = ( items < 4 ) ? BN_new() : sv2bn( ST(3) );
294 0 2 checkOpenSslCall( BN_mod( bn, self, b, ctx ) );
295 1 1 ST(0) = ( (items < 4 ) ? new_obj( bn ) : ST(3) );
307 0 1 checkOpenSslCall( bn = BN_new() );
308 0 1 checkOpenSslCall( BN_mod_mul( bn, self, b, m, ctx ) );
321 0 1 checkOpenSslCall( bn = BN_new() );
322 0 1 checkOpenSslCall( BN_exp( bn, self, exp, ctx ) );
336 0 1 checkOpenSslCall( bn = BN_new() );
337 0 1 checkOpenSslCall( BN_mod_exp( bn, self, exp, mod, ctx ) );
350 0 1 checkOpenSslCall( bn = BN_new() );
351 0 1 checkOpenSslCall( BN_mod_inverse( bn, self, n, ctx ) );
364 0 1 checkOpenSslCall( bn = BN_new() );
365 0 1 checkOpenSslCall( BN_gcd( bn, self, b, ctx ) );
391 0 1 checkOpenSslCall( bn = BN_new() );
392 0 1 checkOpenSslCall( BN_rshift( bn, self, n ) );
402 0 1 checkOpenSslCall( bn = BN_new() );
403 0 1 checkOpenSslCall( BN_lshift( bn, self, n ) );
417 0 1 checkOpenSslCall( RETVAL = BN_dup(self) );
424 0 1 checkOpenSslCall( RETVAL = PTR2IV(BN_dup(self)) );