| line |
true |
false |
branch |
|
17
|
4 |
0 |
if (tag_len < 1 || tag_len > MAXBLOCKSIZE) croak("FATAL: invalid tag_len %d", tag_len); |
|
|
0 |
4 |
if (tag_len < 1 || tag_len > MAXBLOCKSIZE) croak("FATAL: invalid tag_len %d", tag_len); |
|
18
|
0 |
4 |
if (pt_len < 0) croak("FATAL: invalid pt_len"); |
|
19
|
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"); |
|
21
|
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"); |
|
23
|
4 |
0 |
if (!SvPOK_spec(adata)) croak("FATAL: adata must be string/buffer scalar"); |
|
|
0 |
4 |
if (!SvPOK_spec(adata)) croak("FATAL: adata must be string/buffer scalar"); |
|
|
0 |
0 |
if (!SvPOK_spec(adata)) croak("FATAL: adata must be string/buffer scalar"); |
|
|
0 |
0 |
if (!SvPOK_spec(adata)) croak("FATAL: adata must be string/buffer scalar"); |
|
|
0 |
0 |
if (!SvPOK_spec(adata)) croak("FATAL: adata must be string/buffer scalar"); |
|
27
|
0 |
4 |
if (id == -1) croak("FATAL: find_cipher failed for '%s'", cipher_name); |
|
30
|
0 |
4 |
if (!RETVAL) croak("FATAL: Newz failed"); |
|
33
|
0 |
4 |
if (rv != CRYPT_OK) { |
|
39
|
0 |
4 |
if (rv != CRYPT_OK) { |
|
45
|
0 |
4 |
if (rv != CRYPT_OK) { |
|
57
|
5 |
0 |
if (self) { |
|
66
|
0 |
1 |
if (!RETVAL) croak("FATAL: Newz failed"); |
|
79
|
1 |
3 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
81
|
0 |
3 |
if (in_data_len == 0) { |
|
90
|
0 |
3 |
if (rv != CRYPT_OK) { |
|
107
|
0 |
21 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
109
|
0 |
21 |
if (in_data_len == 0) { |
|
118
|
0 |
21 |
if (rv != CRYPT_OK) { |
|
135
|
1 |
3 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
137
|
0 |
3 |
if (rv != CRYPT_OK) croak("FATAL: ccm_done failed: %s", error_to_string(rv)); |
|
139
|
0 |
3 |
XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len))); |
|
153
|
0 |
2 |
if (self->finalized) croak("FATAL: AEAD object already finalized"); |
|
155
|
0 |
2 |
if (rv != CRYPT_OK) croak("FATAL: ccm_done failed: %s", error_to_string(rv)); |
|
157
|
2 |
0 |
if (items == 1) { |
|
158
|
0 |
2 |
XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len))); |
|
162
|
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"); |
|
164
|
0 |
0 |
if (expected_tag_len!=tag_len) { |
|
165
|
0 |
0 |
XPUSHs(sv_2mortal(newSViv(0))); /* false */ |
|
167
|
0 |
0 |
else if (mem_neq(expected_tag, tag, tag_len)) { |
|
168
|
0 |
0 |
XPUSHs(sv_2mortal(newSViv(0))); /* false */ |
|
171
|
0 |
0 |
XPUSHs(sv_2mortal(newSViv(1))); /* true */ |
|
186
|
9 |
0 |
if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar"); |
|
|
0 |
9 |
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"); |
|
188
|
9 |
0 |
if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar"); |
|
|
0 |
9 |
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"); |
|
190
|
9 |
0 |
if (!SvPOK_spec(plaintext)) croak("FATAL: plaintext must be string/buffer scalar"); |
|
|
0 |
9 |
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"); |
|
192
|
9 |
0 |
if (header && SvOK(header)) { |
|
|
6 |
3 |
if (header && SvOK(header)) { |
|
193
|
6 |
0 |
if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar"); |
|
|
0 |
6 |
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"); |
|
199
|
0 |
9 |
if(id==-1) croak("FATAL: find_cipher failed for '%s'", cipher_name); |
|
200
|
9 |
0 |
output = NEWSV(0, pt_len > 0 ? pt_len : 1); /* avoid zero! */ |
|
203
|
9 |
0 |
if(tag_len < 4 || tag_len > 16) tag_len = 16; |
|
|
0 |
9 |
if(tag_len < 4 || tag_len > 16) tag_len = 16; |
|
208
|
0 |
9 |
if (rv != CRYPT_OK) { |
|
212
|
0 |
9 |
XPUSHs(sv_2mortal(output)); |
|
213
|
0 |
9 |
XPUSHs(sv_2mortal(newSVpvn((char*)tag, tag_len))); |
|
227
|
14 |
0 |
if (!SvPOK_spec(key)) croak("FATAL: key must be string/buffer scalar"); |
|
|
0 |
14 |
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"); |
|
229
|
14 |
0 |
if (!SvPOK_spec(nonce)) croak("FATAL: nonce must be string/buffer scalar"); |
|
|
0 |
14 |
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"); |
|
231
|
14 |
0 |
if (!SvPOK_spec(ciphertext)) croak("FATAL: ciphertext must be string/buffer scalar"); |
|
|
0 |
14 |
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"); |
|
233
|
14 |
0 |
if (!SvPOK_spec(tagsv)) croak("FATAL: tag must be string/buffer scalar"); |
|
|
0 |
14 |
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"); |
|
235
|
14 |
0 |
if (header && SvOK(header)) { |
|
|
14 |
0 |
if (header && SvOK(header)) { |
|
236
|
14 |
0 |
if (!SvPOK_spec(header)) croak("FATAL: header must be string/buffer scalar"); |
|
|
0 |
14 |
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"); |
|
242
|
0 |
14 |
if(id==-1) croak("FATAL: find_cipher failed for '%s'", cipher_name); |
|
243
|
14 |
0 |
output = NEWSV(0, ct_len > 0 ? ct_len : 1); /* avoid zero! */ |
|
248
|
14 |
0 |
if (tag_len > 0) { |
|
255
|
8 |
6 |
if (rv != CRYPT_OK) { |
|
257
|
0 |
8 |
XPUSHs(sv_2mortal(newSVpvn(NULL,0))); /* undef */ |
|
260
|
0 |
6 |
XPUSHs(sv_2mortal(output)); |