mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 03:50:57 +01:00
added PBP public key import/export compatibility mode (-b --pbpcompat)
This commit is contained in:
10
libpcp/key.c
10
libpcp/key.c
@@ -93,6 +93,16 @@ char *pcp_getkeyid(pcp_key_t *k) {
|
||||
return id;
|
||||
}
|
||||
|
||||
// same as above but for imported pbp keys
|
||||
char *pcp_getpubkeyid(pcp_pubkey_t *k) {
|
||||
uint32_t s, p;
|
||||
p = jen_hash(k->pub, 32, JEN_PSALT);
|
||||
s = jen_hash(k->edpub, 32, JEN_SSALT);
|
||||
char *id = ucmalloc(17);
|
||||
snprintf(id, 17, "%08X%08X", p, s);
|
||||
return id;
|
||||
}
|
||||
|
||||
void pcp_keypairs(byte *csk, byte *cpk, byte *esk, byte *epk) {
|
||||
// generate ed25519 + curve25519 keypair from random seed
|
||||
byte *seed = urmalloc(32);
|
||||
|
||||
Reference in New Issue
Block a user