Branch Coverage

inc/CryptX_PK_X25519.xs.inc
Criterion Covered Total %
branch 17 78 21.7


line true false branch
11 0 3 if (!RETVAL) croak("FATAL: Newz failed");
15 0 3 if (RETVAL->pindex == -1) {
21 0 3 if (rv != CRYPT_OK) {
38 0 2 if (rv != CRYPT_OK) croak("FATAL: x25519_make_key failed: %s", error_to_string(rv));
40 0 2 XPUSHs(ST(0)); /* return self */
54 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_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: x25519_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_X25519) croak("FATAL: pem_decode_pkcs decoded non-X25519 key");
103 0 0 XPUSHs(ST(0)); /* return self */
117 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_import_x509 failed: %s", error_to_string(rv));
119 0 0 XPUSHs(ST(0)); /* return self */
130 1 0 if (SvOK(key)) {
134 1 0 if (which == 0) {
137 0 0 else if (which == 1) {
143 0 1 if (rv != CRYPT_OK) croak("FATAL: x25519_import_raw failed: %s", error_to_string(rv));
145 0 1 XPUSHs(ST(0)); /* return self */
151 0 0 if (self->initialized == 0) XSRETURN_UNDEF;
152 0 0 RETVAL = (self->key.type == PK_PRIVATE) ? 1 : 0;
165 0 1 if (self->initialized == 0) XSRETURN_UNDEF;
168 1 0 if (self->key.type == PK_PRIVATE) {
171 0 1 if (rv != CRYPT_OK) croak("FATAL: base16_encode failed: %s", error_to_string(rv));
180 0 1 if (rv != CRYPT_OK) croak("FATAL: base16_encode failed: %s", error_to_string(rv));
198 0 0 if (strEQ(type, "private")) {
200 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_export(PK_PRIVATE|PK_STD) failed: %s", error_to_string(rv));
203 0 0 else if (strEQ(type, "public")) {
205 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_export(PK_PUBLIC|PK_STD) failed: %s", error_to_string(rv));
225 0 0 if (strEQ(type, "private")) {
227 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_export(PK_PRIVATE) failed: %s", error_to_string(rv));
230 0 0 else if (strEQ(type, "public")) {
232 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_export(PK_PUBLIC) failed: %s", error_to_string(rv));
252 1 0 if (rv != CRYPT_OK) croak("FATAL: x25519_shared_secret failed: %s", error_to_string(rv));
262 3 0 if (self->pindex >= 0 && prng_is_valid(self->pindex) == CRYPT_OK && prng_descriptor[self->pindex].done) {
3 0 if (self->pindex >= 0 && prng_is_valid(self->pindex) == CRYPT_OK && prng_descriptor[self->pindex].done) {
3 0 if (self->pindex >= 0 && prng_is_valid(self->pindex) == CRYPT_OK && prng_descriptor[self->pindex].done) {