- mpz_init_set_str(pk, his_pubkey, 16);
- mpz_get_str(tmp, 16, pk);
- len = str_hex_to_bin(key, tmp);
- out = xmalloc(strlen(cl->pp) + 3);
-
- cipher_set_key(&bf_key, len, key);
- low_crypt_key(cl->pp, out, &bf_key, strlen(cl->pp), BF_DECRYPT);
+ mpz_init_set_str(pk, his_pubkey, 36);
+ tmp = mpz_get_str(NULL, 16, pk);
+ keylen = str_hex_to_bin(key, tmp);
+ out = xmalloc((cl->pp->len >> 1) + 3);
+ pplen = str_hex_to_bin(phrase, cl->pp->phrase);
+
+ cipher_set_key(&bf_key, keylen, key);
+ low_crypt_key(phrase, out, &bf_key, pplen, BF_DECRYPT);