diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-12-19 02:47:42 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-12-22 10:26:59 +0000 |
commit | ce29c8e7ec91d95167b2dea3aee9fd1ae1aac254 (patch) | |
tree | a288df55c44e8edf816e6abbde19a70faef73394 /other/DHT_bootstrap.c | |
parent | 7122d2e862e028a730478d88cd61557fbed16ebf (diff) |
Wrap all sodium/nacl functions in crypto_core.c.
Diffstat (limited to 'other/DHT_bootstrap.c')
-rw-r--r-- | other/DHT_bootstrap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/other/DHT_bootstrap.c b/other/DHT_bootstrap.c index 7a2f7d13..e056de41 100644 --- a/other/DHT_bootstrap.c +++ b/other/DHT_bootstrap.c | |||
@@ -61,7 +61,7 @@ | |||
61 | 61 | ||
62 | static void manage_keys(DHT *dht) | 62 | static void manage_keys(DHT *dht) |
63 | { | 63 | { |
64 | enum { KEYS_SIZE = crypto_box_PUBLICKEYBYTES + crypto_box_SECRETKEYBYTES }; | 64 | enum { KEYS_SIZE = CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_SECRET_KEY_SIZE }; |
65 | uint8_t keys[KEYS_SIZE]; | 65 | uint8_t keys[KEYS_SIZE]; |
66 | 66 | ||
67 | FILE *keys_file = fopen("key", "r"); | 67 | FILE *keys_file = fopen("key", "r"); |
@@ -76,12 +76,12 @@ static void manage_keys(DHT *dht) | |||
76 | exit(1); | 76 | exit(1); |
77 | } | 77 | } |
78 | 78 | ||
79 | memcpy(dht->self_public_key, keys, crypto_box_PUBLICKEYBYTES); | 79 | memcpy(dht->self_public_key, keys, CRYPTO_PUBLIC_KEY_SIZE); |
80 | memcpy(dht->self_secret_key, keys + crypto_box_PUBLICKEYBYTES, crypto_box_SECRETKEYBYTES); | 80 | memcpy(dht->self_secret_key, keys + CRYPTO_PUBLIC_KEY_SIZE, CRYPTO_SECRET_KEY_SIZE); |
81 | printf("Keys loaded successfully.\n"); | 81 | printf("Keys loaded successfully.\n"); |
82 | } else { | 82 | } else { |
83 | memcpy(keys, dht->self_public_key, crypto_box_PUBLICKEYBYTES); | 83 | memcpy(keys, dht->self_public_key, CRYPTO_PUBLIC_KEY_SIZE); |
84 | memcpy(keys + crypto_box_PUBLICKEYBYTES, dht->self_secret_key, crypto_box_SECRETKEYBYTES); | 84 | memcpy(keys + CRYPTO_PUBLIC_KEY_SIZE, dht->self_secret_key, CRYPTO_SECRET_KEY_SIZE); |
85 | keys_file = fopen("key", "w"); | 85 | keys_file = fopen("key", "w"); |
86 | 86 | ||
87 | if (keys_file == NULL) { | 87 | if (keys_file == NULL) { |