| line |
true |
false |
branch |
|
13
|
16 |
0 |
if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar"); |
|
|
0 |
16 |
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
|
1 |
15 |
if (nonce) { |
|
16
|
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"); |
|
21
|
0 |
16 |
if (id == -1) croak("FATAL: find_cipher failed for '%s'", cipher_name); |
|
24
|
0 |
16 |
if (!RETVAL) croak("FATAL: Newz failed"); |
|
27
|
0 |
16 |
if (rv != CRYPT_OK) { |
|
33
|
1 |
15 |
if (iv && iv_len > 0) { |
|
|
1 |
0 |
if (iv && iv_len > 0) { |
|
35
|
0 |
1 |
if (rv != CRYPT_OK) { |
|
48
|
17 |
0 |
if (self) { |
|
57
|
0 |
1 |
if (!RETVAL) croak("FATAL: Newz failed"); |
|
68
|
0 |
1 |
if (rv != CRYPT_OK) croak("FATAL: gcm_reset failed: %s", error_to_string(rv)); |
|
70
|
0 |
1 |
XPUSHs(ST(0)); /* return self */ |
|
81
|
1 |
10 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
83
|
0 |
10 |
if (in_data_len == 0) { |
|
93
|
0 |
10 |
if (rv != CRYPT_OK) { |
|
110
|
0 |
16 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
113
|
0 |
16 |
if (rv != CRYPT_OK) croak("FATAL: gcm_add_iv failed: %s", error_to_string(rv)); |
|
114
|
0 |
16 |
XPUSHs(ST(0)); /* return self */ |
|
125
|
0 |
17 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
128
|
0 |
17 |
if (rv != CRYPT_OK) croak("FATAL: gcm_add_aad failed: %s", error_to_string(rv)); |
|
129
|
0 |
17 |
XPUSHs(ST(0)); /* return self */ |
|
140
|
0 |
27 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
142
|
0 |
27 |
if (in_data_len == 0) { |
|
151
|
0 |
27 |
if (rv != CRYPT_OK) { |
|
169
|
1 |
10 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
171
|
0 |
10 |
if (rv != CRYPT_OK) croak("FATAL: gcm_done failed: %s", error_to_string(rv)); |
|
173
|
0 |
10 |
XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len))); |
|
187
|
0 |
8 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
189
|
0 |
8 |
if (rv != CRYPT_OK) croak("FATAL: gcm_done failed: %s", error_to_string(rv)); |
|
191
|
8 |
0 |
if (items == 1) { |
|
192
|
0 |
8 |
XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len))); |
|
196
|
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"); |
|
198
|
0 |
0 |
if (expected_tag_len!=tag_len) { |
|
199
|
0 |
0 |
XPUSHs(sv_2mortal(newSViv(0))); /* false */ |
|
201
|
0 |
0 |
else if (mem_neq(expected_tag, tag, tag_len)) { |
|
202
|
0 |
0 |
XPUSHs(sv_2mortal(newSViv(0))); /* false */ |
|
205
|
0 |
0 |
XPUSHs(sv_2mortal(newSViv(1))); /* true */ |
|
221
|
10 |
0 |
if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar"); |
|
|
1 |
9 |
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"); |
|
223
|
10 |
0 |
if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar"); |
|
|
1 |
9 |
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"); |
|
225
|
10 |
0 |
if (!SvPOK_spec(plaintext)) croak("FATAL: plaintext must be string/buffer scalar"); |
|
|
0 |
10 |
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"); |
|
227
|
10 |
0 |
if (header && SvOK(header)) { |
|
|
10 |
0 |
if (header && SvOK(header)) { |
|
228
|
10 |
0 |
if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar"); |
|
|
0 |
10 |
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
|
0 |
10 |
if(id==-1) croak("FATAL: find_cipher failed for '%s'", cipher_name); |
|
235
|
10 |
0 |
output = NEWSV(0, pt_len > 0 ? pt_len : 1); /* avoid zero! */ |
|
242
|
0 |
10 |
if (rv != CRYPT_OK) { |
|
246
|
0 |
10 |
XPUSHs(sv_2mortal(output)); |
|
247
|
0 |
10 |
XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len))); |
|
261
|
11 |
0 |
if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar"); |
|
|
0 |
11 |
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"); |
|
263
|
11 |
0 |
if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar"); |
|
|
0 |
11 |
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"); |
|
265
|
11 |
0 |
if (!SvPOK_spec(ciphertext)) croak("FATAL: ciphertext must be string/buffer scalar"); |
|
|
0 |
11 |
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
|
11 |
0 |
if (!SvPOK_spec(tagsv)) croak("FATAL: tag must be string/buffer scalar"); |
|
|
0 |
11 |
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
|
11 |
0 |
if (header && SvOK(header)) { |
|
|
11 |
0 |
if (header && SvOK(header)) { |
|
270
|
11 |
0 |
if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar"); |
|
|
0 |
11 |
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"); |
|
276
|
0 |
11 |
if(id==-1) croak("FATAL: find_cipher failed for '%s'", cipher_name); |
|
277
|
11 |
0 |
output = NEWSV(0, ct_len > 0 ? ct_len : 1); /* avoid zero! */ |
|
282
|
11 |
0 |
if (tag_len > 0) { |
|
289
|
3 |
8 |
if (rv != CRYPT_OK) { |
|
291
|
0 |
3 |
XPUSHs(sv_2mortal(newSVpvn(NULL,0))); /* undef */ |
|
294
|
0 |
8 |
XPUSHs(sv_2mortal(output)); |