diff options
-rw-r--r-- | core/net_crypto.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/net_crypto.c b/core/net_crypto.c index 07c43c40..0d8ad4c7 100644 --- a/core/net_crypto.c +++ b/core/net_crypto.c | |||
@@ -81,7 +81,7 @@ int encrypt_data(uint8_t *public_key, uint8_t *secret_key, uint8_t *nonce, | |||
81 | if (length + crypto_box_MACBYTES > MAX_DATA_SIZE || length == 0) | 81 | if (length + crypto_box_MACBYTES > MAX_DATA_SIZE || length == 0) |
82 | return -1; | 82 | return -1; |
83 | 83 | ||
84 | uint8_t temp_plain[MAX_DATA_SIZE + crypto_box_BOXZEROBYTES] = {0}; | 84 | uint8_t temp_plain[MAX_DATA_SIZE + crypto_box_ZEROBYTES] = {0}; |
85 | uint8_t temp_encrypted[MAX_DATA_SIZE + crypto_box_BOXZEROBYTES]; | 85 | uint8_t temp_encrypted[MAX_DATA_SIZE + crypto_box_BOXZEROBYTES]; |
86 | 86 | ||
87 | memcpy(temp_plain + crypto_box_ZEROBYTES, plain, length); /* pad the message with 32 0 bytes. */ | 87 | memcpy(temp_plain + crypto_box_ZEROBYTES, plain, length); /* pad the message with 32 0 bytes. */ |
@@ -114,7 +114,7 @@ int encrypt_data_fast(uint8_t *enc_key, uint8_t *nonce, | |||
114 | if (length + crypto_box_MACBYTES > MAX_DATA_SIZE || length == 0) | 114 | if (length + crypto_box_MACBYTES > MAX_DATA_SIZE || length == 0) |
115 | return -1; | 115 | return -1; |
116 | 116 | ||
117 | uint8_t temp_plain[MAX_DATA_SIZE + crypto_box_BOXZEROBYTES] = {0}; | 117 | uint8_t temp_plain[MAX_DATA_SIZE + crypto_box_ZEROBYTES] = {0}; |
118 | uint8_t temp_encrypted[MAX_DATA_SIZE + crypto_box_BOXZEROBYTES]; | 118 | uint8_t temp_encrypted[MAX_DATA_SIZE + crypto_box_BOXZEROBYTES]; |
119 | 119 | ||
120 | memcpy(temp_plain + crypto_box_ZEROBYTES, plain, length); /* pad the message with 32 0 bytes. */ | 120 | memcpy(temp_plain + crypto_box_ZEROBYTES, plain, length); /* pad the message with 32 0 bytes. */ |