diff options
Diffstat (limited to 'toxcore/crypto_core.c')
-rw-r--r-- | toxcore/crypto_core.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/toxcore/crypto_core.c b/toxcore/crypto_core.c index e114b44f..03150396 100644 --- a/toxcore/crypto_core.c +++ b/toxcore/crypto_core.c | |||
@@ -127,8 +127,8 @@ int32_t encrypt_data_symmetric(const uint8_t *secret_key, const uint8_t *nonce, | |||
127 | return -1; | 127 | return -1; |
128 | } | 128 | } |
129 | 129 | ||
130 | uint8_t temp_plain[length + crypto_box_ZEROBYTES]; | 130 | VLA(uint8_t, temp_plain, length + crypto_box_ZEROBYTES); |
131 | uint8_t temp_encrypted[length + crypto_box_MACBYTES + crypto_box_BOXZEROBYTES]; | 131 | VLA(uint8_t, temp_encrypted, length + crypto_box_MACBYTES + crypto_box_BOXZEROBYTES); |
132 | 132 | ||
133 | memset(temp_plain, 0, crypto_box_ZEROBYTES); | 133 | memset(temp_plain, 0, crypto_box_ZEROBYTES); |
134 | memcpy(temp_plain + crypto_box_ZEROBYTES, plain, length); // Pad the message with 32 0 bytes. | 134 | memcpy(temp_plain + crypto_box_ZEROBYTES, plain, length); // Pad the message with 32 0 bytes. |
@@ -149,8 +149,8 @@ int32_t decrypt_data_symmetric(const uint8_t *secret_key, const uint8_t *nonce, | |||
149 | return -1; | 149 | return -1; |
150 | } | 150 | } |
151 | 151 | ||
152 | uint8_t temp_plain[length + crypto_box_ZEROBYTES]; | 152 | VLA(uint8_t, temp_plain, length + crypto_box_ZEROBYTES); |
153 | uint8_t temp_encrypted[length + crypto_box_BOXZEROBYTES]; | 153 | VLA(uint8_t, temp_encrypted, length + crypto_box_BOXZEROBYTES); |
154 | 154 | ||
155 | memset(temp_encrypted, 0, crypto_box_BOXZEROBYTES); | 155 | memset(temp_encrypted, 0, crypto_box_BOXZEROBYTES); |
156 | memcpy(temp_encrypted + crypto_box_BOXZEROBYTES, encrypted, length); // Pad the message with 16 0 bytes. | 156 | memcpy(temp_encrypted + crypto_box_BOXZEROBYTES, encrypted, length); // Pad the message with 16 0 bytes. |