Branch Coverage

inc/CryptX_AuthEnc_ChaCha20Poly1305.xs.inc
Criterion Covered Total %
branch 91 236 38.5


line true false branch
13 8 0 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
0 8 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");
15 7 1 if (nonce) {
16 7 0 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
0 7 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");
21 0 8 if (!RETVAL) croak("FATAL: Newz failed");
24 0 8 if (rv != CRYPT_OK) {
30 7 1 if (iv && iv_len > 0) {
7 0 if (iv && iv_len > 0) {
32 0 7 if (rv != CRYPT_OK) {
45 10 0 if (self) {
54 0 2 if (!RETVAL) croak("FATAL: Newz failed");
67 1 0 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
0 1 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");
69 0 1 if (self->finalized) croak("FATAL: AEAD object already finalized");
71 0 1 if (rv != CRYPT_OK) croak("FATAL: chacha20poly1305_setiv failed: %s", error_to_string(rv));
72 0 1 XPUSHs(ST(0)); /* return self */;
83 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");
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");
85 0 0 if (self->finalized) croak("FATAL: AEAD object already finalized");
87 0 0 if (rv != CRYPT_OK) croak("FATAL: chacha20poly1305_setiv_rfc7905 failed: %s", error_to_string(rv));
88 0 0 XPUSHs(ST(0)); /* return self */
99 0 8 if (self->finalized) croak("FATAL: AEAD object already finalized");
102 0 8 if (rv != CRYPT_OK) croak("FATAL: chacha20poly1305_add_aad failed: %s", error_to_string(rv));
103 0 8 XPUSHs(ST(0)); /* return self */
114 0 22 if (self->finalized) croak("FATAL: AEAD object already finalized");
116 0 22 if (in_data_len == 0) {
125 0 22 if (rv != CRYPT_OK) {
142 2 9 if (self->finalized) croak("FATAL: AEAD object already finalized");
144 0 9 if (in_data_len == 0) {
153 0 9 if (rv != CRYPT_OK) {
170 2 7 if (self->finalized) croak("FATAL: AEAD object already finalized");
172 0 7 if (rv != CRYPT_OK) croak("FATAL: chacha20poly1305_done failed: %s", error_to_string(rv));
174 0 7 XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len)));
188 0 3 if (self->finalized) croak("FATAL: AEAD object already finalized");
190 0 3 if (rv != CRYPT_OK) croak("FATAL: chacha20poly1305_done failed: %s", error_to_string(rv));
192 2 1 if (items == 1) {
193 0 2 XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len)));
197 1 0 if (!SvPOK_spec(ST(1))) croak("FATAL: expected_tag must be string/buffer scalar");
0 1 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");
199 0 1 if (expected_tag_len!=tag_len) {
200 0 0 XPUSHs(sv_2mortal(newSViv(0))); /* false */
202 0 1 else if (mem_neq(expected_tag, tag, tag_len)) {
203 0 0 XPUSHs(sv_2mortal(newSViv(0))); /* false */
206 0 1 XPUSHs(sv_2mortal(newSViv(1))); /* true */
222 7 0 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
2 5 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
2 0 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
2 0 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
0 2 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
224 7 0 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
2 5 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
2 0 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
2 0 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
0 2 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
226 7 0 if (!SvPOK_spec(plaintext)) croak("FATAL: plaintext must be string/buffer scalar");
0 7 if (!SvPOK_spec(plaintext)) croak("FATAL: plaintext must be string/buffer scalar");
0 0 if (!SvPOK_spec(plaintext)) croak("FATAL: plaintext must be string/buffer scalar");
0 0 if (!SvPOK_spec(plaintext)) croak("FATAL: plaintext must be string/buffer scalar");
0 0 if (!SvPOK_spec(plaintext)) croak("FATAL: plaintext must be string/buffer scalar");
228 7 0 if (header && SvOK(header)) {
7 0 if (header && SvOK(header)) {
229 7 0 if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar");
0 7 if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar");
0 0 if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar");
0 0 if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar");
0 0 if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar");
234 7 0 output = NEWSV(0, pt_len > 0 ? pt_len : 1); /* avoid zero! */
242 0 7 if (rv != CRYPT_OK) {
246 0 7 XPUSHs(sv_2mortal(output));
247 0 7 XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len)));
261 9 0 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
1 8 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
1 0 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
1 0 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
0 1 if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar");
263 9 0 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
1 8 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
1 0 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
1 0 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
0 1 if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar");
265 9 0 if (!SvPOK_spec(ciphertext)) croak("FATAL: ciphertext must be string/buffer scalar");
0 9 if (!SvPOK_spec(ciphertext)) croak("FATAL: ciphertext must be string/buffer scalar");
0 0 if (!SvPOK_spec(ciphertext)) croak("FATAL: ciphertext must be string/buffer scalar");
0 0 if (!SvPOK_spec(ciphertext)) croak("FATAL: ciphertext must be string/buffer scalar");
0 0 if (!SvPOK_spec(ciphertext)) croak("FATAL: ciphertext must be string/buffer scalar");
267 9 0 if (!SvPOK_spec(tagsv)) croak("FATAL: tag must be string/buffer scalar");
0 9 if (!SvPOK_spec(tagsv)) croak("FATAL: tag must be string/buffer scalar");
0 0 if (!SvPOK_spec(tagsv)) croak("FATAL: tag must be string/buffer scalar");
0 0 if (!SvPOK_spec(tagsv)) croak("FATAL: tag must be string/buffer scalar");
0 0 if (!SvPOK_spec(tagsv)) croak("FATAL: tag must be string/buffer scalar");
269 9 0 if (header && SvOK(header)) {
9 0 if (header && SvOK(header)) {
270 9 0 if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar");
0 9 if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar");
0 0 if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar");
0 0 if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar");
0 0 if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar");
275 9 0 output = NEWSV(0, ct_len > 0 ? ct_len : 1); /* avoid zero! */
280 9 0 if (tag_len > 0) {
288 5 4 if (rv != CRYPT_OK) {
290 0 5 XPUSHs(sv_2mortal(newSVpvn(NULL,0))); /* undef */
293 0 4 XPUSHs(sv_2mortal(output));