diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-29 23:18:21 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-30 00:42:35 +0100 |
commit | 1111dc8e5e9e78254c1a7a891d961713e1be9db0 (patch) | |
tree | 3490dad7d1c43d32a9c5d362d6f03bb17cb5408a /src/crypto/cipher/salsa20/nacl/salsa20_nacl.c | |
parent | a09d04a02231964fa5a8f0113e9909cfb140fe4e (diff) | |
download | fastd-1111dc8e5e9e78254c1a7a891d961713e1be9db0.tar fastd-1111dc8e5e9e78254c1a7a891d961713e1be9db0.zip |
Remove cipher and MAC contexts
Not a single implementation was using them...
Diffstat (limited to 'src/crypto/cipher/salsa20/nacl/salsa20_nacl.c')
-rw-r--r-- | src/crypto/cipher/salsa20/nacl/salsa20_nacl.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/crypto/cipher/salsa20/nacl/salsa20_nacl.c b/src/crypto/cipher/salsa20/nacl/salsa20_nacl.c index 457e39c..ed14c3c 100644 --- a/src/crypto/cipher/salsa20/nacl/salsa20_nacl.c +++ b/src/crypto/cipher/salsa20/nacl/salsa20_nacl.c @@ -33,11 +33,7 @@ struct __attribute__((aligned(16))) fastd_cipher_state { }; -static fastd_cipher_context_t* salsa20_initialize(fastd_context_t *ctx UNUSED) { - return NULL; -} - -static fastd_cipher_state_t* salsa20_init_state(fastd_context_t *ctx UNUSED, const fastd_cipher_context_t *cctx UNUSED, const uint8_t *key) { +static fastd_cipher_state_t* salsa20_init(fastd_context_t *ctx UNUSED, const uint8_t *key) { fastd_cipher_state_t *state = malloc(sizeof(fastd_cipher_state_t)); memcpy(state->key, key, crypto_stream_salsa20_KEYBYTES); @@ -49,24 +45,17 @@ static bool salsa20_crypt(fastd_context_t *ctx UNUSED, const fastd_cipher_state_ return true; } -static void salsa20_free_state(fastd_context_t *ctx UNUSED, fastd_cipher_state_t *state) { +static void salsa20_free(fastd_context_t *ctx UNUSED, fastd_cipher_state_t *state) { if (state) { secure_memzero(state, sizeof(*state)); free(state); } } -static void salsa20_free(fastd_context_t *ctx UNUSED, fastd_cipher_context_t *cctx UNUSED) { -} - const fastd_cipher_t fastd_cipher_salsa20_nacl = { .available = fastd_true, - .initialize = salsa20_initialize, - .init_state = salsa20_init_state, - + .init = salsa20_init, .crypt = salsa20_crypt, - - .free_state = salsa20_free_state, .free = salsa20_free, }; |