Branch Coverage

inc/CryptX_PK_X25519.xs.inc
Criterion Covered Total %
branch 9 72 12.5


line true false branch
11 0 1 if (!RETVAL) croak("FATAL: Newz failed");
15 0 1 if (RETVAL->pindex == -1) {
20 0 1 if (rv != CRYPT_OK) {
36 0 1 if (rv != CRYPT_OK) croak("FATAL: x25519_make_key failed: %s", error_to_string(rv));
38 0 1 XPUSHs(ST(0)); /* return self */
52 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_import failed: %s", error_to_string(rv));
54 0 0 XPUSHs(ST(0)); /* return self */
68 0 0 if (SvOK(passwd)) {
74 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_import_pkcs8 failed: %s", error_to_string(rv));
76 0 0 XPUSHs(ST(0)); /* return self */
91 0 0 if (SvOK(passwd)) {
97 0 0 if (rv != CRYPT_OK) croak("FATAL: pem_decode_pkcs failed: %s", error_to_string(rv));
98 0 0 if (key_from_pem.id != LTC_PKA_X25519) croak("FATAL: pem_decode_pkcs decoded non-X25519 key");
101 0 0 XPUSHs(ST(0)); /* return self */
115 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_import_x509 failed: %s", error_to_string(rv));
117 0 0 XPUSHs(ST(0)); /* return self */
128 0 0 if (SvOK(key)) {
132 0 0 if (which == 0) {
135 0 0 else if (which == 1) {
141 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_import_raw failed: %s", error_to_string(rv));
143 0 0 XPUSHs(ST(0)); /* return self */
149 0 0 if (self->initialized == 0) XSRETURN_UNDEF;
150 0 0 RETVAL = (self->key.type == PK_PRIVATE) ? 1 : 0;
163 0 1 if (self->initialized == 0) XSRETURN_UNDEF;
166 1 0 if (self->key.type == PK_PRIVATE) {
169 0 1 if (rv != CRYPT_OK) croak("FATAL: base16_encode failed: %s", error_to_string(rv));
178 0 1 if (rv != CRYPT_OK) croak("FATAL: base16_encode failed: %s", error_to_string(rv));
196 0 0 if (strnEQ(type, "private", 7)) {
198 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_export(PK_PRIVATE|PK_STD) failed: %s", error_to_string(rv));
201 0 0 else if (strnEQ(type, "public", 6)) {
203 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_export(PK_PUBLIC|PK_STD) failed: %s", error_to_string(rv));
222 0 0 if (strnEQ(type, "private", 7)) {
224 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_export(PK_PRIVATE) failed: %s", error_to_string(rv));
227 0 0 else if (strnEQ(type, "public", 6)) {
229 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_export(PK_PUBLIC) failed: %s", error_to_string(rv));
248 0 0 if (rv != CRYPT_OK) croak("FATAL: x25519_shared_secret failed: %s", error_to_string(rv));