-bool ecdh_generate_public(ecdh_t *ecdh, void *pubkey) {
- *ecdh = EC_KEY_new_by_curve_name(NID_secp521r1);
- if(!EC_KEY_generate_key(*ecdh)) {
- logger(LOG_ERR, "Generating EC key failed: %s", ERR_error_string(ERR_get_error(), NULL));
+#include "../ecdh.h"
+#include "../logger.h"
+#include "../utils.h"
+#include "../xalloc.h"
+
+ecdh_t *ecdh_generate_public(void *pubkey) {
+ ecdh_t *ecdh = EC_KEY_new_by_curve_name(NID_secp521r1);
+ if(!ecdh) {
+ logger(DEBUG_ALWAYS, LOG_ERR, "Generating EC key_by_curve_name failed: %s", ERR_error_string(ERR_get_error(), NULL));