Branch Coverage

AES.xs
Criterion Covered Total %
branch 77 100 77.0


line true false branch
39 16 16 if (hv_exists(options, name, strlen(name))) {
41 16 0 if (SvIOKp(*svp)) {
42 16 0 value = SvIV(*svp);
53 76 18 if (hv_exists(options, name, strlen(name))) {
56 76 0 return SvPV_nolen(value);
70 3 29 if (name == NULL)
72 2 27 else if (strcmp(name, "AES-128-ECB") == 0)
74 4 23 else if (strcmp(name, "AES-192-ECB") == 0)
76 4 19 else if (strcmp(name, "AES-256-ECB") == 0)
78 2 17 else if (strcmp(name, "AES-128-CBC") == 0)
80 2 15 else if (strcmp(name, "AES-192-CBC") == 0)
82 5 10 else if (strcmp(name, "AES-256-CBC") == 0)
84 1 9 else if (strcmp(name, "AES-128-CFB") == 0)
86 1 8 else if (strcmp(name, "AES-192-CFB") == 0)
88 1 7 else if (strcmp(name, "AES-256-CFB") == 0)
91 1 6 else if (strcmp(name, "AES-128-CTR") == 0)
93 1 5 else if (strcmp(name, "AES-192-CTR") == 0)
95 1 4 else if (strcmp(name, "AES-256-CTR") == 0)
104 1 3 else if (strcmp(name, "AES-128-OFB") == 0)
106 1 2 else if (strcmp(name, "AES-192-OFB") == 0)
108 1 1 else if (strcmp(name, "AES-256-OFB") == 0)
117 3 28 if (value == NULL)
133 31 0 if (!SvROK(sv) || SvTYPE(SvRV(sv)) != SVt_PVHV)
0 31 if (!SvROK(sv) || SvTYPE(SvRV(sv)) != SVt_PVHV)
170 31 1 if (items > 2)
173 0 32 if (!SvPOK (key_sv))
176 32 0 key = (unsigned char *) SvPVbyte_nolen(key_sv);
179 25 7 if (keysize != 16 && keysize != 24 && keysize != 32)
18 7 if (keysize != 16 && keysize != 24 && keysize != 32)
0 18 if (keysize != 16 && keysize != 24 && keysize != 32)
188 29 2 if ((strcmp(cipher_name, "AES-128-ECB") == 0 ||
25 4 if ((strcmp(cipher_name, "AES-128-ECB") == 0 ||
189 7 18 strcmp(cipher_name, "AES-192-ECB") == 0 ||
191 1 12 && hv_exists(options, "iv", strlen("iv")))
195 0 30 if(!(RETVAL->enc_ctx = EVP_CIPHER_CTX_new()))
198 0 30 if(!(RETVAL->dec_ctx = EVP_CIPHER_CTX_new()))
201 0 30 if(1 != EVP_EncryptInit_ex(RETVAL->enc_ctx, cipher,
205 0 30 if(1 != EVP_DecryptInit_ex(RETVAL->dec_ctx, cipher,
226 32 0 unsigned char * plaintext = (unsigned char *) SvPVbyte(data,size);
237 32 0 if (size)
239 4 28 if ((size % block_size != 0) && self->padding != 1)
2 2 if ((size % block_size != 0) && self->padding != 1)
244 0 30 if(1 != EVP_EncryptUpdate(self->enc_ctx, ciphertext , &out_len, plaintext, size))
249 0 30 if(1 != EVP_EncryptFinal_ex(self->enc_ctx, ciphertext + ciphertext_len, &out_len))
281 29 0 unsigned char * ciphertext = (unsigned char *) SvPVbyte(data,size);
291 29 0 if (size)
293 0 29 if ((size % block_size != 0) && self->padding != 1)
0 0 if ((size % block_size != 0) && self->padding != 1)
297 0 29 if (1 != EVP_DecryptUpdate(self->dec_ctx, plaintext, &out_len, ciphertext, size))
302 0 29 if(1 != EVP_DecryptFinal_ex(self->dec_ctx, plaintext + out_len, &out_len))