GCM: move Intel PCLMUL accelerated implementation to separate file
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Sat, 6 Dec 2014 08:38:36 +0000 (10:38 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Fri, 12 Dec 2014 21:49:52 +0000 (23:49 +0200)
commit4a0795af021305f9240f23626a3796157db46bd7
tree6444ff3279c9b014bc5b765c75878e4a6d29346f
parentcbf4c8cb6bbda15eea61885279f2a6f1d4bcedfd
GCM: move Intel PCLMUL accelerated implementation to separate file

* cipher/Makefile.am: Add 'cipher-gcm-intel-pclmul.c'.
* cipher/cipher-gcm-intel-pclmul.c: New.
* cipher/cipher-gcm.c [GCM_USE_INTEL_PCLMUL]
(_gcry_ghash_setup_intel_pclmul, _gcry_ghash_intel_pclmul): New
prototypes.
[GCM_USE_INTEL_PCLMUL] (gfmul_pclmul, gfmul_pclmul_aggr4): Move
to 'cipher-gcm-intel-pclmul.c'.
(ghash): Rename to...
(ghash_internal): ...this and move GCM_USE_INTEL_PCLMUL part to new
function in 'cipher-gcm-intel-pclmul.c'.
(setupM): Move GCM_USE_INTEL_PCLMUL part to new function in
'cipher-gcm-intel-pclmul.c'; Add selection of ghash function based
on available HW acceleration.
(do_ghash_buf): Change use of 'ghash' to 'c->u_mode.gcm.ghash_fn'.
* cipher/internal.h (ghash_fn_t): New.
(gcry_cipher_handle): Remove 'use_intel_pclmul'; Add 'ghash_fn'.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/Makefile.am
cipher/cipher-gcm-intel-pclmul.c [new file with mode: 0644]
cipher/cipher-gcm.c
cipher/cipher-internal.h