cipher-aes128 0.6.3 → 0.6.4
raw patch · 5 files changed
+14/−14 lines, 5 files
Files
- cbits/aes.c +8/−8
- cbits/aes_x86ni.c +1/−1
- cbits/gf.c +2/−2
- cbits/gf.h +2/−2
- cipher-aes128.cabal +1/−1
cbits/aes.c view
@@ -319,7 +319,7 @@ static void gcm_ghash_add(const aes_gcm *gcm, aes_ctx *ctx, const block128 *b) { block128_xor(&ctx->tag, b);- gf_mul(&ctx->tag, &gcm->h);+ tmd_gf_mul(&ctx->tag, &gcm->h); } void tmd_aes_gcm_init(aes_gcm *gcm, const aes_key *key)@@ -345,15 +345,15 @@ int i; for (; len >= 16; len -= 16, iv += 16) { block128_xor(&ctx->iv, (block128 *) iv);- gf_mul(&ctx->iv, &gcm->h);+ tmd_gf_mul(&ctx->iv, &gcm->h); } if (len > 0) { block128_xor_bytes(&ctx->iv, iv, len);- gf_mul(&ctx->iv, &gcm->h);+ tmd_gf_mul(&ctx->iv, &gcm->h); } for (i = 15; origlen; --i, origlen >>= 8) ctx->iv.b[i] ^= (uint8_t) origlen;- gf_mul(&ctx->iv, &gcm->h);+ tmd_gf_mul(&ctx->iv, &gcm->h); } block128_copy(&ctx->civ, &ctx->iv);@@ -496,9 +496,9 @@ /* TO OPTIMISE: this is really inefficient way to do that */ while (spoint-- > 0)- gf_mulx(&tweak);+ tmd_gf_mulx(&tweak); - for ( ; nb_blocks-- > 0; input++, output++, gf_mulx(&tweak)) {+ for ( ; nb_blocks-- > 0; input++, output++, tmd_gf_mulx(&tweak)) { block128_vxor(&block, input, &tweak); aes_encrypt_block(&block, k1, &block); block128_vxor(output, &block, &tweak);@@ -516,9 +516,9 @@ /* TO OPTIMISE: this is really inefficient way to do that */ while (spoint-- > 0)- gf_mulx(&tweak);+ tmd_gf_mulx(&tweak); - for ( ; nb_blocks-- > 0; input++, output++, gf_mulx(&tweak)) {+ for ( ; nb_blocks-- > 0; input++, output++, tmd_gf_mulx(&tweak)) { block128_vxor(&block, input, &tweak); aes_decrypt_block(&block, k1, &block); block128_vxor(output, &block, &tweak);
cbits/aes_x86ni.c view
@@ -143,7 +143,7 @@ /* TO OPTIMISE: use pcmulqdq... or some faster code. * this is the lamest way of doing it, but i'm out of time.- * this is basically a copy of gf_mulx in gf.c */+ * this is basically a copy of tmd_gf_mulx in gf.c */ static __m128i gfmulx(__m128i v) { uint64_t v_[2] ALIGNMENT(16);
cbits/gf.c view
@@ -39,7 +39,7 @@ * to speed up the multiplication. * TODO: optimise with tables */-void gf_mul(block128 *a, const block128 *b)+void tmd_gf_mul(block128 *a, const block128 *b) { uint64_t a0, a1, v0, v1; int i, j;@@ -62,7 +62,7 @@ } /* inplace GFMUL for xts mode */-void gf_mulx(block128 *a)+void tmd_gf_mulx(block128 *a) { const uint64_t gf_mask = cpu_to_le64(0x8000000000000000ULL); uint64_t r = ((a->q[1] & gf_mask) ? cpu_to_le64(0x87) : 0);
cbits/gf.h view
@@ -32,7 +32,7 @@ #include "block128.h" -void gf_mul(block128 *a, const block128 *b); -void gf_mulx(block128 *a); +void tmd_gf_mul(block128 *a, const block128 *b); +void tmd_gf_mulx(block128 *a); #endif
cipher-aes128.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: cipher-aes128-version: 0.6.3+version: 0.6.4 synopsis: AES and common modes using AES-NI when available. description: Cipher-aes128 is an implementation of AES and common modes of operation. It borrows Hanquez's C AES code (see 'cipher-aes') but is unique due to including compile-time detection of