Branch Coverage

inc/CryptX_AuthEnc_CCM.xs.inc
Criterion Covered Total %
branch 50 160 31.2


line true false branch
17 3 0 if (tag_len < 1 || tag_len > MAXBLOCKSIZE) croak("FATAL: invalid tag_len %d", tag_len);
0 3 if (tag_len < 1 || tag_len > MAXBLOCKSIZE) croak("FATAL: invalid tag_len %d", tag_len);
18 0 3 if (pt_len < 0) croak("FATAL: invalid pt_len");
19 3 0 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
0 3 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
0 0 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
0 0 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
0 0 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
21 3 0 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
0 3 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
0 0 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
0 0 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
0 0 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
23 3 0 if (!SvPOK_spec(adata)) croak("FATAL: adata must be string/buffer scalar");
0 3 if (!SvPOK_spec(adata)) croak("FATAL: adata must be string/buffer scalar");
0 0 if (!SvPOK_spec(adata)) croak("FATAL: adata must be string/buffer scalar");
0 0 if (!SvPOK_spec(adata)) croak("FATAL: adata must be string/buffer scalar");
0 0 if (!SvPOK_spec(adata)) croak("FATAL: adata must be string/buffer scalar");
27 0 3 if (id == -1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
30 0 3 if (!RETVAL) croak("FATAL: Newz failed");
33 0 3 if (rv != CRYPT_OK) {
38 0 3 if (rv != CRYPT_OK) {
43 0 3 if (rv != CRYPT_OK) {
60 0 0 if (!RETVAL) croak("FATAL: Newz failed");
74 0 2 if (in_data_len == 0) {
83 0 2 if (rv != CRYPT_OK) {
101 0 21 if (in_data_len == 0) {
110 0 21 if (rv != CRYPT_OK) {
128 0 1 if (rv != CRYPT_OK) croak("FATAL: ccm_done failed: %s", error_to_string(rv));
129 0 1 XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len)));
143 0 2 if (rv != CRYPT_OK) croak("FATAL: ccm_done failed: %s", error_to_string(rv));
144 2 0 if (items == 1) {
145 0 2 XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len)));
148 0 0 if (!SvPOK_spec(ST(1))) croak("FATAL: expected_tag must be string/buffer scalar");
0 0 if (!SvPOK_spec(ST(1))) croak("FATAL: expected_tag must be string/buffer scalar");
0 0 if (!SvPOK_spec(ST(1))) croak("FATAL: expected_tag must be string/buffer scalar");
0 0 if (!SvPOK_spec(ST(1))) croak("FATAL: expected_tag must be string/buffer scalar");
0 0 if (!SvPOK_spec(ST(1))) croak("FATAL: expected_tag must be string/buffer scalar");
150 0 0 if (expected_tag_len!=tag_len) {
151 0 0 XPUSHs(sv_2mortal(newSViv(0))); /* false */
153 0 0 else if (memNE(expected_tag, tag, tag_len)) {
154 0 0 XPUSHs(sv_2mortal(newSViv(0))); /* false */
157 0 0 XPUSHs(sv_2mortal(newSViv(1))); /* true */
172 9 0 if (SvPOK_spec(key)) k = (unsigned char *) SvPVbyte(key, k_len);
0 9 if (SvPOK_spec(key)) k = (unsigned char *) SvPVbyte(key, k_len);
0 0 if (SvPOK_spec(key)) k = (unsigned char *) SvPVbyte(key, k_len);
0 0 if (SvPOK_spec(key)) k = (unsigned char *) SvPVbyte(key, k_len);
0 0 if (SvPOK_spec(key)) k = (unsigned char *) SvPVbyte(key, k_len);
173 9 0 if (SvPOK_spec(nonce)) n = (unsigned char *) SvPVbyte(nonce, n_len);
0 9 if (SvPOK_spec(nonce)) n = (unsigned char *) SvPVbyte(nonce, n_len);
0 0 if (SvPOK_spec(nonce)) n = (unsigned char *) SvPVbyte(nonce, n_len);
0 0 if (SvPOK_spec(nonce)) n = (unsigned char *) SvPVbyte(nonce, n_len);
0 0 if (SvPOK_spec(nonce)) n = (unsigned char *) SvPVbyte(nonce, n_len);
174 9 0 if (SvPOK_spec(plaintext)) pt = (unsigned char *) SvPVbyte(plaintext, pt_len);
0 9 if (SvPOK_spec(plaintext)) pt = (unsigned char *) SvPVbyte(plaintext, pt_len);
0 0 if (SvPOK_spec(plaintext)) pt = (unsigned char *) SvPVbyte(plaintext, pt_len);
0 0 if (SvPOK_spec(plaintext)) pt = (unsigned char *) SvPVbyte(plaintext, pt_len);
0 0 if (SvPOK_spec(plaintext)) pt = (unsigned char *) SvPVbyte(plaintext, pt_len);
175 6 3 if (SvPOK_spec(header)) h = (unsigned char *) SvPVbyte(header, h_len);
0 6 if (SvPOK_spec(header)) h = (unsigned char *) SvPVbyte(header, h_len);
0 0 if (SvPOK_spec(header)) h = (unsigned char *) SvPVbyte(header, h_len);
0 0 if (SvPOK_spec(header)) h = (unsigned char *) SvPVbyte(header, h_len);
0 0 if (SvPOK_spec(header)) h = (unsigned char *) SvPVbyte(header, h_len);
178 0 9 if(id==-1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
179 9 0 output = NEWSV(0, pt_len > 0 ? pt_len : 1); /* avoid zero! */
182 9 0 if(tag_len < 4 || tag_len > 16) tag_len = 16;
0 9 if(tag_len < 4 || tag_len > 16) tag_len = 16;
187 0 9 if (rv != CRYPT_OK) {
191 0 9 XPUSHs(sv_2mortal(output));
192 0 9 XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len)));
206 12 0 if (SvPOK(key)) k = (unsigned char *) SvPVbyte(key, k_len);
207 12 0 if (SvPOK(nonce)) n = (unsigned char *) SvPVbyte(nonce, n_len);
208 12 0 if (SvPOK(ciphertext)) ct = (unsigned char *) SvPVbyte(ciphertext, ct_len);
209 12 0 if (SvPOK(tagsv)) t = (unsigned char *) SvPVbyte(tagsv, t_len);
210 12 0 if (SvPOK(header)) h = (unsigned char *) SvPVbyte(header, h_len);
213 0 12 if(id==-1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
214 12 0 output = NEWSV(0, ct_len > 0 ? ct_len : 1); /* avoid zero! */
223 6 6 if (rv != CRYPT_OK) {
225 0 6 XPUSHs(sv_2mortal(newSVpvn(NULL,0))); /* undef */
228 0 6 XPUSHs(sv_2mortal(output));