summaryrefslogtreecommitdiffstats
path: root/src/crypto/cipher/salsa2012/nacl/salsa2012_nacl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/cipher/salsa2012/nacl/salsa2012_nacl.c')
-rw-r--r--src/crypto/cipher/salsa2012/nacl/salsa2012_nacl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/crypto/cipher/salsa2012/nacl/salsa2012_nacl.c b/src/crypto/cipher/salsa2012/nacl/salsa2012_nacl.c
index 18ec502..24450dc 100644
--- a/src/crypto/cipher/salsa2012/nacl/salsa2012_nacl.c
+++ b/src/crypto/cipher/salsa2012/nacl/salsa2012_nacl.c
@@ -30,6 +30,7 @@
*/
+#include "../../../../alloc.h"
#include "../../../../crypto.h"
#include <crypto_stream_salsa2012.h>
@@ -43,7 +44,7 @@ struct fastd_cipher_state {
/** Initializes the cipher state */
static fastd_cipher_state_t* salsa2012_init(const uint8_t *key) {
- fastd_cipher_state_t *state = malloc(sizeof(fastd_cipher_state_t));
+ fastd_cipher_state_t *state = fastd_new(fastd_cipher_state_t);
memcpy(state->key, key, crypto_stream_salsa2012_KEYBYTES);
return state;