summaryrefslogtreecommitdiff
path: root/gcm.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2013-09-09 06:24:53 +0200
committerNiels Möller <nisse@lysator.liu.se>2013-09-09 06:24:53 +0200
commita0ac85431d424ef658c373f635a861b0517eb218 (patch)
treee01a2cac637d824cb4702cad62af7127dfb51c59 /gcm.c
parentc6cce95d22bd2e4a969d4985def95fc93a86931e (diff)
downloadnettle-a0ac85431d424ef658c373f635a861b0517eb218.tar.gz
Support optional assembly files for both nettle and hogweed.
Prepare for assembly gcm_gf_mul_8.
Diffstat (limited to 'gcm.c')
-rw-r--r--gcm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcm.c b/gcm.c
index 6893d515..7b387bac 100644
--- a/gcm.c
+++ b/gcm.c
@@ -214,6 +214,12 @@ gcm_gf_mul (union gcm_block *x, const union gcm_block *table)
memcpy (x->b, Z.b, sizeof(Z));
}
# elif GCM_TABLE_BITS == 8
+# if HAVE_NATIVE_gcm_gf_mul_8
+
+#define gcm_gf_mul _nettle_gcm_gf_mul_8
+void
+gcm_gf_mul (union gcm_block *x, const union gcm_block *y);
+# else /* !HAVE_NATIVE_gcm_gf_mul_8 */
static const uint16_t
shift_table[0x100] = {
W(00,00),W(01,c2),W(03,84),W(02,46),W(07,08),W(06,ca),W(04,8c),W(05,4e),
@@ -304,7 +310,7 @@ gcm_gf_mul (union gcm_block *x, const union gcm_block *table)
gcm_gf_shift_8(&Z);
gcm_gf_add(x, &Z, &table[x->b[0]]);
}
-
+# endif /* ! HAVE_NATIVE_gcm_gf_mul_8 */
# else /* GCM_TABLE_BITS != 8 */
# error Unsupported table size.
# endif /* GCM_TABLE_BITS != 8 */