summaryrefslogtreecommitdiff
path: root/board/cr50/tpm2/hash_data.c
diff options
context:
space:
mode:
authornagendra modadugu <ngm@google.com>2015-11-19 16:15:35 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-11-25 11:17:13 -0800
commitae89bb6f49f30186e300e0b60c6384b37da8c72f (patch)
treefccdd5ba91b0481f06f68b81a26c7fd33ce1f76b /board/cr50/tpm2/hash_data.c
parentf01d71eb5b0ee8f15e2c85e9302c24bc5fe3ebcd (diff)
downloadchrome-ec-ae89bb6f49f30186e300e0b60c6384b37da8c72f.tar.gz
cr50: SHA1 and SHA256 implementation with hardware support
This change includes hardware and software support for SHA1/256 on CR50. When running in the RO image, only hardware sha256 support is included. When running in the RW image, the code auto-selects between the software and hardware implementation. Software implementation path is taken if the hardware is currently in use by some other context. Refactor the CR50 loader to use this abstraction. The existing software implementation for SHA1 and SHA256 is used for the software path. CQ-DEPEND=CL:*239385 BRANCH=none TEST=EC shell boots fine (implies that SHA256 works) BUG=chrome-os-partner:43025 Change-Id: I7bcefc12fcef869dac2e48793bd0cb5ce8e80d5b Signed-off-by: nagendra modadugu <ngm@google.com> Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/313011
Diffstat (limited to 'board/cr50/tpm2/hash_data.c')
-rw-r--r--board/cr50/tpm2/hash_data.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/board/cr50/tpm2/hash_data.c b/board/cr50/tpm2/hash_data.c
new file mode 100644
index 0000000000..6e6ad8aa4d
--- /dev/null
+++ b/board/cr50/tpm2/hash_data.c
@@ -0,0 +1,11 @@
+/* Copyright 2015 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#include "CryptoEngine.h"
+
+/*
+ * This is unfortunate, but this is the only way to bring in necessary data
+ * from the TPM2 library, as this file is not compiled in embedded mode.
+ */
+#include "CpriHashData.c"