Branch Coverage

inc/CryptX_AuthEnc_OCB.xs.inc
Criterion Covered Total %
branch 64 142 45.0


line true false branch
15 0 36 if (!SvPOK(key)) croak("FATAL: key must be string/buffer scalar");
16 36 0 k = (unsigned char *) SvPVbyte(key, k_len);
17 0 36 if (!SvPOK(nonce)) croak("FATAL: nonce must be string/buffer scalar");
18 36 0 n = (unsigned char *) SvPVbyte(nonce, n_len);
21 0 36 if (id == -1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
24 0 36 if (!RETVAL) croak("FATAL: Newz failed");
27 0 36 if (rv != CRYPT_OK) {
44 0 0 if (!RETVAL) croak("FATAL: Newz failed");
57 36 0 in_data = (unsigned char *)SvPVbyte(data, in_data_len);
59 24 12 if (in_data_len>0) {
61 0 24 if (rv != CRYPT_OK) croak("FATAL: ocb3_add_aad failed: %s", error_to_string(rv));
63 0 36 XPUSHs(ST(0)); /* return self */
74 1 0 in_data = (unsigned char *)SvPVbyte(data, in_data_len);
75 0 1 if (in_data_len == 0) {
79 0 1 if (in_data_len % 16) {
87 0 1 if (rv != CRYPT_OK) {
104 18 0 in_data = (unsigned char *)SvPVbyte(data, in_data_len);
105 6 12 if (in_data_len == 0) {
107 0 6 if (rv != CRYPT_OK) {
118 0 12 if (rv != CRYPT_OK) {
135 0 0 in_data = (unsigned char *)SvPVbyte(data, in_data_len);
136 0 0 if (in_data_len == 0) {
140 0 0 if (in_data_len % 16) {
148 0 0 if (rv != CRYPT_OK) {
165 1 17 in_data = (unsigned char *)SvPVbyte(data, in_data_len);
166 6 12 if (in_data_len == 0) {
168 0 6 if (rv != CRYPT_OK) {
179 0 12 if (rv != CRYPT_OK) {
197 0 18 if (rv != CRYPT_OK) croak("FATAL: ocb3_done_encrypt failed: %s", error_to_string(rv));
199 0 18 XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len)));
213 0 18 if (rv != CRYPT_OK) croak("FATAL: ocb3_done_decrypt failed: %s", error_to_string(rv));
214 18 0 if (items == 1) {
215 0 18 XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len)));
218 0 0 if (!SvPOK(ST(1))) croak("FATAL: expected_tag must be string/buffer scalar");
219 0 0 expected_tag = (unsigned char *) SvPVbyte(ST(1), expected_tag_len);
220 0 0 if (expected_tag_len!=tag_len) {
221 0 0 XPUSHs(sv_2mortal(newSViv(0))); /* false */
223 0 0 else if (memNE(expected_tag, tag, tag_len)) {
224 0 0 XPUSHs(sv_2mortal(newSViv(0))); /* false */
227 0 0 XPUSHs(sv_2mortal(newSViv(1))); /* true */
242 2 0 if (SvPOK(key)) k = (unsigned char *) SvPVbyte(key, k_len);
2 0 if (SvPOK(key)) k = (unsigned char *) SvPVbyte(key, k_len);
243 2 0 if (SvPOK(nonce)) n = (unsigned char *) SvPVbyte(nonce, n_len);
2 0 if (SvPOK(nonce)) n = (unsigned char *) SvPVbyte(nonce, n_len);
244 2 0 if (SvPOK(plaintext)) pt = (unsigned char *) SvPVbyte(plaintext, pt_len);
2 0 if (SvPOK(plaintext)) pt = (unsigned char *) SvPVbyte(plaintext, pt_len);
245 2 0 if (SvPOK(header)) h = (unsigned char *) SvPVbyte(header, h_len);
2 0 if (SvPOK(header)) h = (unsigned char *) SvPVbyte(header, h_len);
248 0 2 if(id==-1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
249 2 0 output = NEWSV(0, pt_len > 0 ? pt_len : 1); /* avoid zero! */
252 2 0 if(tag_len < 4 || tag_len > 16) tag_len = 16;
0 2 if(tag_len < 4 || tag_len > 16) tag_len = 16;
258 0 2 if (rv != CRYPT_OK) {
262 0 2 XPUSHs(sv_2mortal(output));
263 0 2 XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len)));
275 4 0 if (SvPOK(key)) k = (unsigned char *) SvPVbyte(key, k_len);
4 0 if (SvPOK(key)) k = (unsigned char *) SvPVbyte(key, k_len);
276 4 0 if (SvPOK(nonce)) n = (unsigned char *) SvPVbyte(nonce, n_len);
4 0 if (SvPOK(nonce)) n = (unsigned char *) SvPVbyte(nonce, n_len);
277 4 0 if (SvPOK(ciphertext)) ct = (unsigned char *) SvPVbyte(ciphertext, ct_len);
4 0 if (SvPOK(ciphertext)) ct = (unsigned char *) SvPVbyte(ciphertext, ct_len);
278 4 0 if (SvPOK(tagsv)) t = (unsigned char *) SvPVbyte(tagsv, t_len);
4 0 if (SvPOK(tagsv)) t = (unsigned char *) SvPVbyte(tagsv, t_len);
279 4 0 if (SvPOK(header)) h = (unsigned char *) SvPVbyte(header, h_len);
4 0 if (SvPOK(header)) h = (unsigned char *) SvPVbyte(header, h_len);
282 0 4 if(id==-1) croak("FATAL: find_cipfer failed for '%s'", cipher_name);
283 4 0 output = NEWSV(0, ct_len > 0 ? ct_len : 1); /* avoid zero! */
291 4 0 if (rv != CRYPT_OK || stat != 1) {
2 2 if (rv != CRYPT_OK || stat != 1) {
293 0 2 XPUSHs(sv_2mortal(newSVpvn(NULL,0))); /* undef */
296 0 2 XPUSHs(sv_2mortal(output));