summaryrefslogtreecommitdiffstats
path: root/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-11-29 05:33:12 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-11-29 05:35:49 +0100
commit61349d3d273aa23935b0c413c5885005db2669db (patch)
tree9cbc05acb31476d45b48d4a51e9edca19328b8e8 /src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
parentc13fe36e4c0730037ae75d51f7f052d916486aac (diff)
downloadfastd-61349d3d273aa23935b0c413c5885005db2669db.tar
fastd-61349d3d273aa23935b0c413c5885005db2669db.zip
Compile with -std=c99 and restructure some code to ensure there is no invalid aliasing (hopefully)
Diffstat (limited to 'src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c')
-rw-r--r--src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
index 0b3b049..82887cf 100644
--- a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
+++ b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
@@ -60,7 +60,7 @@ static fastd_protocol_config_t* protocol_init(fastd_context_t *ctx) {
ecc_25519_work_t work;
ecc_25519_scalarmult_base(&work, &protocol_config->key.secret);
- ecc_25519_store_packed(&protocol_config->key.public, &work);
+ ecc_25519_store_packed(&protocol_config->key.public.int256, &work);
return protocol_config;
}
@@ -75,7 +75,7 @@ static void protocol_peer_configure(fastd_context_t *ctx, fastd_peer_config_t *p
}
aligned_int256_t key;
- if (!read_key(key.p, peer_conf->key)) {
+ if (!read_key(key.u8, peer_conf->key)) {
pr_warn(ctx, "invalid key configured for `%s', disabling peer", peer_conf->name);
return;
}
@@ -83,7 +83,7 @@ static void protocol_peer_configure(fastd_context_t *ctx, fastd_peer_config_t *p
peer_conf->protocol_config = malloc(sizeof(fastd_protocol_peer_config_t));
peer_conf->protocol_config->public_key = key;
- if (memcmp(peer_conf->protocol_config->public_key.p, ctx->conf->protocol_config->key.public.p, 32) == 0)
+ if (memcmp(&peer_conf->protocol_config->public_key, &ctx->conf->protocol_config->key.public, 32) == 0)
pr_debug(ctx, "found own key as `%s', ignoring peer", peer_conf->name);
}