diff --git a/cbits/aes/gf.c b/cbits/aes/gf.c index 7dcc12c..3d872ae 100644 --- a/cbits/aes/gf.c +++ b/cbits/aes/gf.c @@ -39,7 +39,7 @@ * to speed up the multiplication. * TODO: optimise with tables */ -void cryptonite_aes_generic_gf_mul(block128 *a, block128 *b) +void cryptonite_aes_generic_gf_mul(block128 *a, const block128 *b) { uint64_t a0, a1, v0, v1; int i, j; diff --git a/cbits/aes/gf.h b/cbits/aes/gf.h index 21b542c..4a65edb 100644 --- a/cbits/aes/gf.h +++ b/cbits/aes/gf.h @@ -32,7 +32,7 @@ #include "aes/block128.h" -void cryptonite_aes_generic_gf_mul(block128 *a, block128 *b); +void cryptonite_aes_generic_gf_mul(block128 *a, const block128 *b); void cryptonite_aes_generic_gf_mulx(block128 *a); #endif diff --git a/cbits/aes/x86ni.c b/cbits/aes/x86ni.c index bc3af2d..7049fd1 100644 --- a/cbits/aes/x86ni.c +++ b/cbits/aes/x86ni.c @@ -231,7 +231,7 @@ static __m128i gfmul_pclmuldq(__m128i a, __m128i b) return _mm_shuffle_epi8(tmp6, bswap_mask); } -void cryptonite_aesni_gf_mul(block128 *a, block128 *b) +void cryptonite_aesni_gf_mul(block128 *a, const block128 *b) { __m128i _a, _b, _c; _a = _mm_loadu_si128((__m128i *) a); @@ -240,7 +240,7 @@ void cryptonite_aesni_gf_mul(block128 *a, block128 *b) _mm_storeu_si128((__m128i *) a, _c); } -void cryptonite_aesni_init_pclmul() +void cryptonite_aesni_init_pclmul(void) { gfmul_branch_ptr = gfmul_pclmuldq; } diff --git a/cbits/aes/x86ni.h b/cbits/aes/x86ni.h index b9a568a..9e2898e 100644 --- a/cbits/aes/x86ni.h +++ b/cbits/aes/x86ni.h @@ -73,8 +73,8 @@ void cryptonite_aesni_gcm_encrypt128(uint8_t *out, aes_gcm *gcm, aes_key *key, u void cryptonite_aesni_gcm_encrypt256(uint8_t *out, aes_gcm *gcm, aes_key *key, uint8_t *in, uint32_t length); #ifdef WITH_PCLMUL -void cryptonite_aesni_init_pclmul(); -void cryptonite_aesni_gf_mul(block128 *a, block128 *b); +void cryptonite_aesni_init_pclmul(void); +void cryptonite_aesni_gf_mul(block128 *a, const block128 *b); #endif #endif diff --git a/cbits/cryptonite_aes.c b/cbits/cryptonite_aes.c index b5ce004..f04fbc7 100644 --- a/cbits/cryptonite_aes.c +++ b/cbits/cryptonite_aes.c @@ -156,7 +156,7 @@ typedef void (*gcm_crypt_f)(uint8_t *output, aes_gcm *gcm, aes_key *key, uint8_t typedef void (*ocb_crypt_f)(uint8_t *output, aes_ocb *ocb, aes_key *key, uint8_t *input, uint32_t length); typedef void (*ccm_crypt_f)(uint8_t *output, aes_ccm *ccm, aes_key *key, uint8_t *input, uint32_t length); typedef void (*block_f)(aes_block *output, aes_key *key, aes_block *input); -typedef void (*gf_mul_f)(aes_block *a, aes_block *b); +typedef void (*gf_mul_f)(aes_block *a, const aes_block *b); #ifdef WITH_AESNI #define GET_INIT(strength) \