diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-30 05:34:49 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-30 05:35:18 +0100 |
commit | aa1d894e102e23d162b8e2bccd4b3bf1700de2f2 (patch) | |
tree | 3027bc84e829650a798071ad9e13f4391260328b /src/crypto/cipher/blowfish_ctr/builtin | |
parent | 5f7258ade2dd8bad076d17d3a85fb04d9bf71bda (diff) | |
download | fastd-aa1d894e102e23d162b8e2bccd4b3bf1700de2f2.tar fastd-aa1d894e102e23d162b8e2bccd4b3bf1700de2f2.zip |
Make the crypto implementations independent of fastd.h (and fix more minor bugs)
Diffstat (limited to 'src/crypto/cipher/blowfish_ctr/builtin')
-rw-r--r-- | src/crypto/cipher/blowfish_ctr/builtin/blowfish_ctr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/crypto/cipher/blowfish_ctr/builtin/blowfish_ctr.c b/src/crypto/cipher/blowfish_ctr/builtin/blowfish_ctr.c index 3e82e38..feb1406 100644 --- a/src/crypto/cipher/blowfish_ctr/builtin/blowfish_ctr.c +++ b/src/crypto/cipher/blowfish_ctr/builtin/blowfish_ctr.c @@ -26,6 +26,8 @@ #include "../../../../crypto.h" +#include <arpa/inet.h> + typedef union bf_block { fastd_block128_t b; @@ -209,7 +211,7 @@ static inline uint32_t bf_f(const fastd_cipher_state_t *state, uint32_t x) { BF_SWAP(L, R); \ }) -static fastd_cipher_state_t* blowfish_ctr_init(fastd_context_t *ctx UNUSED, const uint8_t *key) { +static fastd_cipher_state_t* blowfish_ctr_init(const uint8_t *key) { uint32_t key32[14]; memcpy(key32, key, 56); bf_ntohl(key32, 14); @@ -241,7 +243,7 @@ static fastd_cipher_state_t* blowfish_ctr_init(fastd_context_t *ctx UNUSED, cons return state; } -static bool blowfish_ctr_crypt(fastd_context_t *ctx UNUSED, const fastd_cipher_state_t *state, fastd_block128_t *out, const fastd_block128_t *in, size_t len, const uint8_t *iv) { +static bool blowfish_ctr_crypt(const fastd_cipher_state_t *state, fastd_block128_t *out, const fastd_block128_t *in, size_t len, const uint8_t *iv) { register bf_block_t block; register uint32_t ctr[2]; @@ -271,7 +273,7 @@ static bool blowfish_ctr_crypt(fastd_context_t *ctx UNUSED, const fastd_cipher_s return true; } -static void blowfish_ctr_free(fastd_context_t *ctx UNUSED, fastd_cipher_state_t *state) { +static void blowfish_ctr_free(fastd_cipher_state_t *state) { if (state) { secure_memzero(state, sizeof(*state)); free(state); |