XS cosmetics related to ed25519/x25519
Karel Miko
4 years ago
28 | 28 |
PPCODE:
|
29 | 29 |
{
|
30 | 30 |
int rv;
|
31 | |
/* gen the key */
|
|
31 |
self->initialized = 0;
|
32 | 32 |
rv = ed25519_make_key(&self->pstate, self->pindex, &self->key);
|
33 | 33 |
if (rv != CRYPT_OK) croak("FATAL: ed25519_make_key failed: %s", error_to_string(rv));
|
34 | 34 |
self->initialized = 1;
|
|
97 | 97 |
if (SvOK(key)) {
|
98 | 98 |
key_data = (unsigned char *)SvPVbyte(key, key_len);
|
99 | 99 |
}
|
|
100 |
self->initialized = 0;
|
100 | 101 |
if (which == 0) {
|
101 | 102 |
rv = ed25519_import_raw(key_data, (unsigned long)key_len, PK_PUBLIC, &self->key);
|
102 | 103 |
}
|
|
138 | 139 |
not_used = hv_store(rv_hash, "priv", 4, newSVpv(buf, blen), 0);
|
139 | 140 |
}
|
140 | 141 |
else {
|
141 | |
not_used = hv_store(rv_hash, "priv", 4, &PL_sv_undef, 0);
|
|
142 |
not_used = hv_store(rv_hash, "priv", 4, newSVpvn(NULL, 0), 0); /* undef */
|
142 | 143 |
}
|
143 | 144 |
/* pub */
|
144 | 145 |
blen = sizeof(buf);
|
28 | 28 |
PPCODE:
|
29 | 29 |
{
|
30 | 30 |
int rv;
|
31 | |
/* gen the key */
|
|
31 |
self->initialized = 0;
|
32 | 32 |
rv = x25519_make_key(&self->pstate, self->pindex, &self->key);
|
33 | 33 |
if (rv != CRYPT_OK) croak("FATAL: x25519_make_key failed: %s", error_to_string(rv));
|
34 | 34 |
self->initialized = 1;
|
|
97 | 97 |
if (SvOK(key)) {
|
98 | 98 |
key_data = (unsigned char *)SvPVbyte(key, key_len);
|
99 | 99 |
}
|
|
100 |
self->initialized = 0;
|
100 | 101 |
if (which == 0) {
|
101 | 102 |
rv = x25519_import_raw(key_data, (unsigned long)key_len, PK_PUBLIC, &self->key);
|
102 | 103 |
}
|
|
138 | 139 |
not_used = hv_store(rv_hash, "priv", 4, newSVpv(buf, blen), 0);
|
139 | 140 |
}
|
140 | 141 |
else {
|
141 | |
not_used = hv_store(rv_hash, "priv", 4, &PL_sv_undef, 0);
|
|
142 |
not_used = hv_store(rv_hash, "priv", 4, newSVpvn(NULL, 0), 0); /* undef */
|
142 | 143 |
}
|
143 | 144 |
/* pub */
|
144 | 145 |
blen = sizeof(buf);
|