Branch Coverage

inc/CryptX_PK_Ed25519.xs.inc
Criterion Covered Total %
branch 27 118 22.8


line true false branch
11 0 2 if (!RETVAL) croak("FATAL: Newz failed");
15 0 2 if (RETVAL->pindex == -1) {
21 0 2 if (rv != CRYPT_OK) {
38 0 1 if (rv != CRYPT_OK) croak("FATAL: ed25519_make_key failed: %s", error_to_string(rv));
40 0 1 XPUSHs(ST(0)); /* return self */
54 0 0 if (rv != CRYPT_OK) croak("FATAL: ed25519_import failed: %s", error_to_string(rv));
56 0 0 XPUSHs(ST(0)); /* return self */
70 0 0 if (SvOK(passwd)) {
76 0 0 if (rv != CRYPT_OK) croak("FATAL: ed25519_import_pkcs8 failed: %s", error_to_string(rv));
78 0 0 XPUSHs(ST(0)); /* return self */
93 0 0 if (SvOK(passwd)) {
99 0 0 if (rv != CRYPT_OK) croak("FATAL: pem_decode_pkcs failed: %s", error_to_string(rv));
100 0 0 if (key_from_pem.id != LTC_PKA_ED25519) croak("FATAL: pem_decode_pkcs decoded non-Ed25519 key");
103 0 0 XPUSHs(ST(0)); /* return self */
118 1 2 if (SvOK(passwd)) {
124 0 3 if (rv != CRYPT_OK) croak("FATAL: pem_decode_openssh failed: %s", error_to_string(rv));
125 0 3 if (key_from_pem.id != LTC_PKA_ED25519) croak("FATAL: pem_decode_openssh decoded non-Ed25519 key");
128 0 3 XPUSHs(ST(0)); /* return self */
142 0 0 if (rv != CRYPT_OK) croak("FATAL: ed25519_import_x509 failed: %s", error_to_string(rv));
144 0 0 XPUSHs(ST(0)); /* return self */
155 3 0 if (SvOK(key)) {
159 2 1 if (which == 0) {
162 1 0 else if (which == 1) {
168 0 3 if (rv != CRYPT_OK) croak("FATAL: ed25519_import_raw failed: %s", error_to_string(rv));
170 0 3 XPUSHs(ST(0)); /* return self */
176 0 6 if (self->initialized == 0) XSRETURN_UNDEF;
177 4 2 RETVAL = (self->key.type == PK_PRIVATE) ? 1 : 0;
190 0 9 if (self->initialized == 0) XSRETURN_UNDEF;
193 5 4 if (self->key.type == PK_PRIVATE) {
196 0 5 if (rv != CRYPT_OK) croak("FATAL: base16_encode failed: %s", error_to_string(rv));
205 0 9 if (rv != CRYPT_OK) croak("FATAL: base16_encode failed: %s", error_to_string(rv));
223 0 0 if (strEQ(type, "private")) {
225 0 0 if (rv != CRYPT_OK) croak("FATAL: ed25519_export(PK_PRIVATE|PK_STD) failed: %s", error_to_string(rv));
228 0 0 else if (strEQ(type, "public")) {
230 0 0 if (rv != CRYPT_OK) croak("FATAL: ed25519_export(PK_PUBLIC|PK_STD) failed: %s", error_to_string(rv));
250 0 0 if (strEQ(type, "private")) {
252 0 0 if (rv != CRYPT_OK) croak("FATAL: ed25519_export(PK_PRIVATE) failed: %s", error_to_string(rv));
255 0 0 else if (strEQ(type, "public")) {
257 0 0 if (rv != CRYPT_OK) croak("FATAL: ed25519_export(PK_PUBLIC) failed: %s", error_to_string(rv));
279 0 0 if (rv != CRYPT_OK) croak("FATAL: ed25519_sign failed: %s", error_to_string(rv));
299 0 0 if (rv == CRYPT_OK && stat == 1) RETVAL = 1;
0 0 if (rv == CRYPT_OK && stat == 1) RETVAL = 1;
315 0 0 if (ctx_len > 255) croak("FATAL: context must be at most 255 bytes");
318 0 0 if (rv != CRYPT_OK) croak("FATAL: ed25519ctx_sign failed: %s", error_to_string(rv));
336 0 0 if (ctx_len > 255) croak("FATAL: context must be at most 255 bytes");
341 0 0 if (rv == CRYPT_OK && stat == 1) RETVAL = 1;
0 0 if (rv == CRYPT_OK && stat == 1) RETVAL = 1;
356 0 0 if (items > 2 && SvOK(ST(2))) {
0 0 if (items > 2 && SvOK(ST(2))) {
358 0 0 if (ctx_len > 255) croak("FATAL: context must be at most 255 bytes");
362 0 0 if (rv != CRYPT_OK) croak("FATAL: ed25519ph_sign failed: %s", error_to_string(rv));
379 0 0 if (items > 3 && SvOK(ST(3))) {
0 0 if (items > 3 && SvOK(ST(3))) {
381 0 0 if (ctx_len > 255) croak("FATAL: context must be at most 255 bytes");
387 0 0 if (rv == CRYPT_OK && stat == 1) RETVAL = 1;
0 0 if (rv == CRYPT_OK && stat == 1) RETVAL = 1;
395 2 0 if (self->pindex >= 0 && prng_is_valid(self->pindex) == CRYPT_OK && prng_descriptor[self->pindex].done) {
2 0 if (self->pindex >= 0 && prng_is_valid(self->pindex) == CRYPT_OK && prng_descriptor[self->pindex].done) {
2 0 if (self->pindex >= 0 && prng_is_valid(self->pindex) == CRYPT_OK && prng_descriptor[self->pindex].done) {