diff options
Diffstat (limited to 'src/crypto')
-rw-r--r-- | src/crypto/cipher/aes128_ctr/nacl/cipher_aes128_ctr_nacl.c | 4 | ||||
-rw-r--r-- | src/crypto/cipher/aes128_ctr/openssl/aes128_ctr_openssl.c | 8 | ||||
-rw-r--r-- | src/crypto/cipher/ciphers.c.in | 4 | ||||
-rw-r--r-- | src/crypto/cipher/null/memcpy/null_memcpy.c | 2 | ||||
-rw-r--r-- | src/crypto/cipher/salsa20/nacl/salsa20_nacl.c | 2 | ||||
-rw-r--r-- | src/crypto/cipher/salsa20/xmm/salsa20_xmm.c | 2 | ||||
-rw-r--r-- | src/crypto/cipher/salsa2012/nacl/salsa2012_nacl.c | 2 | ||||
-rw-r--r-- | src/crypto/cipher/salsa2012/xmm/salsa2012_xmm.c | 2 | ||||
-rw-r--r-- | src/crypto/mac/ghash/builtin/ghash_builtin.c | 4 | ||||
-rw-r--r-- | src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq.h | 2 | ||||
-rw-r--r-- | src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq_impl.c | 4 | ||||
-rw-r--r-- | src/crypto/mac/macs.c.in | 4 |
12 files changed, 20 insertions, 20 deletions
diff --git a/src/crypto/cipher/aes128_ctr/nacl/cipher_aes128_ctr_nacl.c b/src/crypto/cipher/aes128_ctr/nacl/cipher_aes128_ctr_nacl.c index 797572c..c9adfcd 100644 --- a/src/crypto/cipher/aes128_ctr/nacl/cipher_aes128_ctr_nacl.c +++ b/src/crypto/cipher/aes128_ctr/nacl/cipher_aes128_ctr_nacl.c @@ -42,12 +42,12 @@ struct __attribute__((aligned(16))) fastd_cipher_state { /** Initializes the cipher state */ -static fastd_cipher_state_t* aes128_ctr_init(const uint8_t *key) { +static fastd_cipher_state_t * aes128_ctr_init(const uint8_t *key) { fastd_block128_t k; memcpy(k.b, key, sizeof(fastd_block128_t)); fastd_cipher_state_t *state; - if (posix_memalign((void**)&state, 16, sizeof(fastd_cipher_state_t))) + if (posix_memalign((void **)&state, 16, sizeof(fastd_cipher_state_t))) abort(); crypto_stream_aes128ctr_beforenm(state->d, k.b); diff --git a/src/crypto/cipher/aes128_ctr/openssl/aes128_ctr_openssl.c b/src/crypto/cipher/aes128_ctr/openssl/aes128_ctr_openssl.c index cbf1ed5..cfb824d 100644 --- a/src/crypto/cipher/aes128_ctr/openssl/aes128_ctr_openssl.c +++ b/src/crypto/cipher/aes128_ctr/openssl/aes128_ctr_openssl.c @@ -43,11 +43,11 @@ struct fastd_cipher_state { /** Initializes the cipher state */ -static fastd_cipher_state_t* aes128_ctr_init(const uint8_t *key) { +static fastd_cipher_state_t * aes128_ctr_init(const uint8_t *key) { fastd_cipher_state_t *state = fastd_new(fastd_cipher_state_t); state->aes = EVP_CIPHER_CTX_new(); - EVP_EncryptInit(state->aes, EVP_aes_128_ctr(), (const unsigned char*)key, NULL); + EVP_EncryptInit(state->aes, EVP_aes_128_ctr(), (const unsigned char *)key, NULL); return state; } @@ -59,10 +59,10 @@ static bool aes128_ctr_crypt(const fastd_cipher_state_t *state, fastd_block128_t if (!EVP_EncryptInit(state->aes, NULL, NULL, iv)) return false; - if (!EVP_EncryptUpdate(state->aes, (unsigned char*)out, &clen, (const unsigned char*)in, len)) + if (!EVP_EncryptUpdate(state->aes, (unsigned char *)out, &clen, (const unsigned char *)in, len)) return false; - if (!EVP_EncryptFinal(state->aes, ((unsigned char*)out) + clen, &clen2)) + if (!EVP_EncryptFinal(state->aes, ((unsigned char *)out) + clen, &clen2)) return false; if ((size_t)(clen+clen2) != len) diff --git a/src/crypto/cipher/ciphers.c.in b/src/crypto/cipher/ciphers.c.in index 7816bca..6822efc 100644 --- a/src/crypto/cipher/ciphers.c.in +++ b/src/crypto/cipher/ciphers.c.in @@ -101,7 +101,7 @@ bool fastd_cipher_config(const char *name, const char *impl) { } /** Returns information about the cipher with the specified name if there is an implementation available */ -const fastd_cipher_info_t* fastd_cipher_info_get_by_name(const char *name) { +const fastd_cipher_info_t * fastd_cipher_info_get_by_name(const char *name) { size_t i; for (i = 0; i < array_size(ciphers); i++) { if (strcmp(ciphers[i].name, name)) @@ -117,7 +117,7 @@ const fastd_cipher_info_t* fastd_cipher_info_get_by_name(const char *name) { } /** Returns the chosen cipher implementation for a given cipher */ -const fastd_cipher_t* fastd_cipher_get(const fastd_cipher_info_t *info) { +const fastd_cipher_t * fastd_cipher_get(const fastd_cipher_info_t *info) { size_t i; for (i = 0; i < array_size(ciphers); i++) { if (ciphers[i].info == info) diff --git a/src/crypto/cipher/null/memcpy/null_memcpy.c b/src/crypto/cipher/null/memcpy/null_memcpy.c index 089817f..1ad5784 100644 --- a/src/crypto/cipher/null/memcpy/null_memcpy.c +++ b/src/crypto/cipher/null/memcpy/null_memcpy.c @@ -34,7 +34,7 @@ /** Doesn't do anything as the null cipher doesn't use any state */ -static fastd_cipher_state_t* null_init(const uint8_t *key UNUSED) { +static fastd_cipher_state_t * null_init(const uint8_t *key UNUSED) { return NULL; } diff --git a/src/crypto/cipher/salsa20/nacl/salsa20_nacl.c b/src/crypto/cipher/salsa20/nacl/salsa20_nacl.c index b9c2175..6960ead 100644 --- a/src/crypto/cipher/salsa20/nacl/salsa20_nacl.c +++ b/src/crypto/cipher/salsa20/nacl/salsa20_nacl.c @@ -43,7 +43,7 @@ struct fastd_cipher_state { /** Initializes the cipher state */ -static fastd_cipher_state_t* salsa20_init(const uint8_t *key) { +static fastd_cipher_state_t * salsa20_init(const uint8_t *key) { fastd_cipher_state_t *state = fastd_new(fastd_cipher_state_t); memcpy(state->key, key, crypto_stream_salsa20_KEYBYTES); diff --git a/src/crypto/cipher/salsa20/xmm/salsa20_xmm.c b/src/crypto/cipher/salsa20/xmm/salsa20_xmm.c index abf717f..54fe428 100644 --- a/src/crypto/cipher/salsa20/xmm/salsa20_xmm.c +++ b/src/crypto/cipher/salsa20/xmm/salsa20_xmm.c @@ -67,7 +67,7 @@ static bool salsa20_available(void) { } /** Initializes the cipher state */ -static fastd_cipher_state_t* salsa20_init(const uint8_t *key) { +static fastd_cipher_state_t * salsa20_init(const uint8_t *key) { fastd_cipher_state_t *state = fastd_new(fastd_cipher_state_t); memcpy(state->key, key, KEYBYTES); diff --git a/src/crypto/cipher/salsa2012/nacl/salsa2012_nacl.c b/src/crypto/cipher/salsa2012/nacl/salsa2012_nacl.c index 24450dc..2f601fc 100644 --- a/src/crypto/cipher/salsa2012/nacl/salsa2012_nacl.c +++ b/src/crypto/cipher/salsa2012/nacl/salsa2012_nacl.c @@ -43,7 +43,7 @@ struct fastd_cipher_state { /** Initializes the cipher state */ -static fastd_cipher_state_t* salsa2012_init(const uint8_t *key) { +static fastd_cipher_state_t * salsa2012_init(const uint8_t *key) { fastd_cipher_state_t *state = fastd_new(fastd_cipher_state_t); memcpy(state->key, key, crypto_stream_salsa2012_KEYBYTES); diff --git a/src/crypto/cipher/salsa2012/xmm/salsa2012_xmm.c b/src/crypto/cipher/salsa2012/xmm/salsa2012_xmm.c index 6180702..004d502 100644 --- a/src/crypto/cipher/salsa2012/xmm/salsa2012_xmm.c +++ b/src/crypto/cipher/salsa2012/xmm/salsa2012_xmm.c @@ -67,7 +67,7 @@ static bool salsa2012_available(void) { } /** Initializes the cipher state */ -static fastd_cipher_state_t* salsa2012_init(const uint8_t *key) { +static fastd_cipher_state_t * salsa2012_init(const uint8_t *key) { fastd_cipher_state_t *state = fastd_new(fastd_cipher_state_t); memcpy(state->key, key, KEYBYTES); diff --git a/src/crypto/mac/ghash/builtin/ghash_builtin.c b/src/crypto/mac/ghash/builtin/ghash_builtin.c index 0b957a4..981b588 100644 --- a/src/crypto/mac/ghash/builtin/ghash_builtin.c +++ b/src/crypto/mac/ghash/builtin/ghash_builtin.c @@ -72,9 +72,9 @@ static inline void mulH_a(fastd_block128_t *x, const fastd_mac_state_t *cstate) /** Initializes the MAC state with the unpacked key data */ -static fastd_mac_state_t* ghash_init(const uint8_t *key) { +static fastd_mac_state_t * ghash_init(const uint8_t *key) { fastd_mac_state_t *state; - if (posix_memalign((void**)&state, 16, sizeof(fastd_mac_state_t))) + if (posix_memalign((void **)&state, 16, sizeof(fastd_mac_state_t))) abort(); fastd_block128_t Hbase[4]; diff --git a/src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq.h b/src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq.h index 51ef5da..bd10de4 100644 --- a/src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq.h +++ b/src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq.h @@ -35,6 +35,6 @@ #include "../../../../crypto.h" -fastd_mac_state_t* fastd_ghash_pclmulqdq_init(const uint8_t *key); +fastd_mac_state_t * fastd_ghash_pclmulqdq_init(const uint8_t *key); bool fastd_ghash_pclmulqdq_hash(const fastd_mac_state_t *state, fastd_block128_t *out, const fastd_block128_t *in, size_t n_blocks); void fastd_ghash_pclmulqdq_free(fastd_mac_state_t *state); diff --git a/src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq_impl.c b/src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq_impl.c index 49c036a..17e7aa2 100644 --- a/src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq_impl.c +++ b/src/crypto/mac/ghash/pclmulqdq/ghash_pclmulqdq_impl.c @@ -76,9 +76,9 @@ static inline __m128i byteswap(__m128i v) { /** Initializes the state used by this GHASH implementation */ -fastd_mac_state_t* fastd_ghash_pclmulqdq_init(const uint8_t *key) { +fastd_mac_state_t * fastd_ghash_pclmulqdq_init(const uint8_t *key) { fastd_mac_state_t *state; - if (posix_memalign((void**)&state, 16, sizeof(fastd_mac_state_t))) + if (posix_memalign((void **)&state, 16, sizeof(fastd_mac_state_t))) abort(); memcpy(&state->H, key, sizeof(__m128i)); diff --git a/src/crypto/mac/macs.c.in b/src/crypto/mac/macs.c.in index cf29e8d..c4cbecc 100644 --- a/src/crypto/mac/macs.c.in +++ b/src/crypto/mac/macs.c.in @@ -101,7 +101,7 @@ bool fastd_mac_config(const char *name, const char *impl) { } /** Returns information about the MAC with the specified name if there is an implementation available */ -const fastd_mac_info_t* fastd_mac_info_get_by_name(const char *name) { +const fastd_mac_info_t * fastd_mac_info_get_by_name(const char *name) { size_t i; for (i = 0; i < array_size(macs); i++) { if (strcmp(macs[i].name, name)) @@ -117,7 +117,7 @@ const fastd_mac_info_t* fastd_mac_info_get_by_name(const char *name) { } /** Returns the chosen MAC implementation for a given cipher */ -const fastd_mac_t* fastd_mac_get(const fastd_mac_info_t *info) { +const fastd_mac_t * fastd_mac_get(const fastd_mac_info_t *info) { size_t i; for (i = 0; i < array_size(macs); i++) { if (macs[i].info == info) |