| line |
true |
false |
branch |
|
15
|
37 |
0 |
if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar"); |
|
|
0 |
37 |
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"); |
|
17
|
37 |
0 |
if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar"); |
|
|
0 |
37 |
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 |
37 |
if (id == -1) croak("FATAL: find_cipher failed for '%s'", cipher_name); |
|
24
|
0 |
37 |
if (!RETVAL) croak("FATAL: Newz failed"); |
|
27
|
0 |
37 |
if (rv != CRYPT_OK) { |
|
39
|
38 |
0 |
if (self) { |
|
48
|
0 |
1 |
if (!RETVAL) croak("FATAL: Newz failed"); |
|
61
|
0 |
37 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
64
|
25 |
12 |
if (in_data_len>0) { |
|
66
|
0 |
25 |
if (rv != CRYPT_OK) croak("FATAL: ocb3_add_aad failed: %s", error_to_string(rv)); |
|
68
|
0 |
37 |
XPUSHs(ST(0)); /* return self */ |
|
79
|
1 |
2 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
81
|
0 |
2 |
if (in_data_len == 0) { |
|
85
|
0 |
2 |
if (in_data_len % 16) { |
|
93
|
0 |
2 |
if (rv != CRYPT_OK) { |
|
110
|
0 |
18 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
112
|
6 |
12 |
if (in_data_len == 0) { |
|
114
|
0 |
6 |
if (rv != CRYPT_OK) { |
|
125
|
0 |
12 |
if (rv != CRYPT_OK) { |
|
142
|
0 |
0 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
144
|
0 |
0 |
if (in_data_len == 0) { |
|
148
|
0 |
0 |
if (in_data_len % 16) { |
|
156
|
0 |
0 |
if (rv != CRYPT_OK) { |
|
173
|
0 |
18 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
175
|
6 |
12 |
if (in_data_len == 0) { |
|
177
|
0 |
6 |
if (rv != CRYPT_OK) { |
|
188
|
0 |
12 |
if (rv != CRYPT_OK) { |
|
205
|
1 |
20 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
207
|
0 |
20 |
if (rv != CRYPT_OK) croak("FATAL: ocb3_done_encrypt failed: %s", error_to_string(rv)); |
|
210
|
0 |
20 |
XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len))); |
|
224
|
0 |
18 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
226
|
0 |
18 |
if (rv != CRYPT_OK) croak("FATAL: ocb3_done_decrypt failed: %s", error_to_string(rv)); |
|
228
|
18 |
0 |
if (items == 1) { |
|
229
|
0 |
18 |
XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len))); |
|
233
|
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"); |
|
235
|
0 |
0 |
if (expected_tag_len!=tag_len) { |
|
236
|
0 |
0 |
XPUSHs(sv_2mortal(newSViv(0))); /* false */ |
|
238
|
0 |
0 |
else if (mem_neq(expected_tag, tag, tag_len)) { |
|
239
|
0 |
0 |
XPUSHs(sv_2mortal(newSViv(0))); /* false */ |
|
242
|
0 |
0 |
XPUSHs(sv_2mortal(newSViv(1))); /* true */ |
|
257
|
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"); |
|
|
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"); |
|
259
|
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"); |
|
|
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"); |
|
261
|
2 |
0 |
if (!SvPOK_spec(plaintext)) croak("FATAL: plaintext must be string/buffer scalar"); |
|
|
0 |
2 |
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"); |
|
263
|
2 |
0 |
if (header && SvOK(header)) { |
|
|
2 |
0 |
if (header && SvOK(header)) { |
|
264
|
2 |
0 |
if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar"); |
|
|
0 |
2 |
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"); |
|
270
|
0 |
2 |
if(id==-1) croak("FATAL: find_cipher failed for '%s'", cipher_name); |
|
271
|
2 |
0 |
output = NEWSV(0, pt_len > 0 ? pt_len : 1); /* avoid zero! */ |
|
274
|
2 |
0 |
if(tag_len < 4 || tag_len > 16) tag_len = 16; |
|
|
0 |
2 |
if(tag_len < 4 || tag_len > 16) tag_len = 16; |
|
280
|
0 |
2 |
if (rv != CRYPT_OK) { |
|
284
|
0 |
2 |
XPUSHs(sv_2mortal(output)); |
|
285
|
0 |
2 |
XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len))); |
|
297
|
4 |
0 |
if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar"); |
|
|
0 |
4 |
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"); |
|
299
|
4 |
0 |
if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar"); |
|
|
0 |
4 |
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"); |
|
301
|
4 |
0 |
if (!SvPOK_spec(ciphertext)) croak("FATAL: ciphertext must be string/buffer scalar"); |
|
|
0 |
4 |
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"); |
|
303
|
4 |
0 |
if (!SvPOK_spec(tagsv)) croak("FATAL: tag must be string/buffer scalar"); |
|
|
0 |
4 |
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"); |
|
305
|
4 |
0 |
if (header && SvOK(header)) { |
|
|
4 |
0 |
if (header && SvOK(header)) { |
|
306
|
4 |
0 |
if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar"); |
|
|
0 |
4 |
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"); |
|
311
|
0 |
4 |
if(id==-1) croak("FATAL: find_cipher failed for '%s'", cipher_name); |
|
312
|
4 |
0 |
output = NEWSV(0, ct_len > 0 ? ct_len : 1); /* avoid zero! */ |
|
320
|
4 |
0 |
if (rv != CRYPT_OK || stat != 1) { |
|
|
2 |
2 |
if (rv != CRYPT_OK || stat != 1) { |
|
322
|
0 |
2 |
XPUSHs(sv_2mortal(newSVpvn(NULL,0))); /* undef */ |
|
325
|
0 |
2 |
XPUSHs(sv_2mortal(output)); |