summaryrefslogtreecommitdiff
path: root/third_party
diff options
context:
space:
mode:
authorCraig Hesling <hesling@chromium.org>2019-06-07 10:37:04 -0700
committerCommit Bot <commit-bot@chromium.org>2019-06-14 02:08:31 +0000
commitdaaab800a7d844bb776811e5db0e3f4a43946b7e (patch)
treec1f1a2224084f840446438d1c724eeeb31e345f1 /third_party
parentb30ae71143782737f739690ea200ddd1516a14c4 (diff)
downloadchrome-ec-daaab800a7d844bb776811e5db0e3f4a43946b7e.tar.gz
aes-gcm: Fix undefined ref gcm_gmult_v8 gcm_ghash_v8
This fixes the undefined reference to gcm_init_v8 and gcm_ghash_v8 when compiling with low optimization levels. make BOARD=nocturne_fp V=1 CFLAGS_DEBUG_CHIP="-ggdb -Og" This builds on the adaption work in crrev.com/c/1238976. It mirrors what was done to fix gcm_gmult_neon/gcm_ghash_neon and pulls ideas from the following upstream boringssl files: https://boringssl.googlesource.com/boringssl/+/refs/heads/master/crypto/fipsmodule/modes/internal.h#317 https://boringssl.googlesource.com/boringssl/+/refs/heads/master/crypto/fipsmodule/modes/gcm.c#330 BRANCH=none BUG=chromium:972148 TEST=make buildall TEST=make run-aes -j Change-Id: Id85eb808d546f30c6d4f02263a985d91d7387d5f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1650124 Tested-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org>
Diffstat (limited to 'third_party')
-rw-r--r--third_party/boringssl/common/aes-gcm.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/third_party/boringssl/common/aes-gcm.c b/third_party/boringssl/common/aes-gcm.c
index c9fa359aac..5647a22995 100644
--- a/third_party/boringssl/common/aes-gcm.c
+++ b/third_party/boringssl/common/aes-gcm.c
@@ -304,14 +304,30 @@ void gcm_ghash_4bit_mmx(uint64_t Xi[2], const u128 Htable[16], const uint8_t *in
#define GHASH_ASM_ARM
#define GCM_FUNCREF_4BIT
+#if defined(OPENSSL_ARM_PMULL)
static int pmull_capable(void) {
- return 0;
+ return CRYPTO_is_ARMv8_PMULL_capable();
}
void gcm_init_v8(u128 Htable[16], const uint64_t Xi[2]);
void gcm_gmult_v8(uint64_t Xi[2], const u128 Htable[16]);
void gcm_ghash_v8(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp,
size_t len);
+#else
+static int pmull_capable(void) {
+ return 0;
+}
+static void gcm_init_v8(u128 Htable[16], const uint64_t Xi[2]) {
+
+}
+static void gcm_gmult_v8(uint64_t Xi[2], const u128 Htable[16]) {
+
+}
+static void gcm_ghash_v8(uint64_t Xi[2], const u128 Htable[16],
+ const uint8_t *inp, size_t len) {
+
+}
+#endif
#if defined(OPENSSL_ARM_NEON)
// 32-bit ARM also has support for doing GCM with NEON instructions.