]> tinc-vpn.org Git - tinc/blobdiff - src/ed25519/ecdh.c
Add link to building docs to the top of README.md
[tinc] / src / ed25519 / ecdh.c
index d0cd7e0aae80168b03940a13c880513f9599ef89..469f502e18c1a4938d9c74dba2f096a1f5f9890b 100644 (file)
 */
 
 #include "../system.h"
+#include "../random.h"
 
 #include "ed25519.h"
 
-#define __TINC_ECDH_INTERNAL__
+#define TINC_ECDH_INTERNAL
 typedef struct ecdh_t {
        uint8_t private[64];
 } ecdh_t;
 
-#include "../crypto.h"
 #include "../ecdh.h"
 #include "../xalloc.h"
 
 ecdh_t *ecdh_generate_public(void *pubkey) {
-       ecdh_t *ecdh = xzalloc(sizeof *ecdh);
+       ecdh_t *ecdh = xzalloc(sizeof(*ecdh));
 
        uint8_t seed[32];
-       randomize(seed, sizeof seed);
+       randomize(seed, sizeof(seed));
        ed25519_create_keypair(pubkey, ecdh->private, seed);
 
        return ecdh;