summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorNamyoon Woo <namyoon@chromium.org>2020-02-28 09:44:46 -0800
committerCommit Bot <commit-bot@chromium.org>2020-03-09 21:48:18 +0000
commit5ccb5c7cc9c448b66c6f8e0abbb2dd785da0efb7 (patch)
tree84f6021a658d5b8b11c7612dafac86ede442b27a /chip
parent97c73303cf9d5f6c8b6e871ddebd01a8e4ce4206 (diff)
downloadchrome-ec-5ccb5c7cc9c448b66c6f8e0abbb2dd785da0efb7.tar.gz
remove cr50 related files
BUG=b:149350081 BRANCH=none TEST=build all, and emerged ec related packages for host and octopus. $ make buildall -j $ cros_workon --host list chromeos-base/chromeos-cr50-dev chromeos-base/chromeos-ec chromeos-base/chromeos-ec-headers chromeos-base/ec-devutils chromeos-base/ec-utils chromeos-base/ec-utils-test dev-util/hdctools $ sudo emerge chromeos-cr50-dev -j $ sudo emerge chromeos-ec -j $ sudo emerge chromeos-ec-headers -j $ sudo emerge ec-devutils -j $ sudo emerge ec-utils -j $ sudo emerge ec-utils-test -j $ sudo emerge hdctools -j $ cros_workon-octopus list chromeos-base/chromeos-ec chromeos-base/chromeos-ec-headers chromeos-base/ec-devutils chromeos-base/ec-utils chromeos-base/ec-utils-test dev-util/hdctools $ sudo emerge-octopus chromeos-ec -j $ sudo emerge-octopus chromeos-ec-headers -j $ sudo emerge-octopus ec-devutils -j $ sudo emerge-octopus ec-utils -j $ sudo emerge-octopus ec-utils-test -j $ sudo emerge-octopus hdctools -j Signed-off-by: Namyoon Woo <namyoon@chromium.org> Change-Id: If751b26b0635b0021c077338e96eaa8e8dcf17a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2080631 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/host/build.mk12
-rw-r--r--chip/host/dcrypto/README.md13
-rw-r--r--chip/host/dcrypto/aes.c37
-rw-r--r--chip/host/dcrypto/app_cipher.c48
-rw-r--r--chip/host/dcrypto/app_key.c31
-rw-r--r--chip/host/dcrypto/sha256.c18
6 files changed, 0 insertions, 159 deletions
diff --git a/chip/host/build.mk b/chip/host/build.mk
index 9d77937776..8d2d69f3c3 100644
--- a/chip/host/build.mk
+++ b/chip/host/build.mk
@@ -16,18 +16,6 @@ chip-$(HAS_TASK_KEYSCAN)+=keyboard_raw.o
endif
chip-$(CONFIG_USB_PD_TCPC)+=usb_pd_phy.o
-ifeq ($(CONFIG_DCRYPTO),y)
-CPPFLAGS += -I$(abspath ./chip/g)
-dirs-y += chip/g/dcrypto
-endif
dirs-y += chip/host/dcrypto
chip-$(CONFIG_I2C)+= i2c.o
-
-chip-$(CONFIG_DCRYPTO)+= dcrypto/aes.o
-chip-$(CONFIG_DCRYPTO)+= dcrypto/app_cipher.o
-chip-$(CONFIG_DCRYPTO)+= dcrypto/app_key.o
-chip-$(CONFIG_DCRYPTO)+= dcrypto/sha256.o
-
-# Object files that can be shared with the Cr50 dcrypto implementation
-chip-$(CONFIG_DCRYPTO)+= ../g/dcrypto/hmac.o
diff --git a/chip/host/dcrypto/README.md b/chip/host/dcrypto/README.md
deleted file mode 100644
index 6812dde311..0000000000
--- a/chip/host/dcrypto/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Rough Dcrypto Implementation on Host for Fuzzing Targets.
-
-This implementation of the dcrypto API is not complete, but provides the needed
-function definitions to fuzz Cr50 code.
-The the following should be noted:
-* A complete implementation of dcrypto does not add any extra coverage since the
- dcrypto code here doesn't match the Cr50 implementation that depends on
- a specific hardware accelerator.
-* The input data comes from a fuzzer so storage encryption isn't necessary—no
- user data is handled.
-* For fuzzing fully implementing the crypto functionality isn't useful for the
- purpose of finding bugs--it makes the fuzzer take longer to execute without
- providing any benefit for the extra cycles.
diff --git a/chip/host/dcrypto/aes.c b/chip/host/dcrypto/aes.c
deleted file mode 100644
index cc57168cbb..0000000000
--- a/chip/host/dcrypto/aes.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright 2018 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 <openssl/evp.h>
-
-#define HIDE_EC_STDLIB
-
-#include "dcrypto.h"
-#include "registers.h"
-
-int DCRYPTO_aes_ctr(uint8_t *out, const uint8_t *key, uint32_t key_bits,
- const uint8_t *iv, const uint8_t *in, size_t in_len)
-{
- EVP_CIPHER_CTX *ctx;
- int ret = 0;
- int out_len = 0;
-
- ctx = EVP_CIPHER_CTX_new();
- if (!ctx)
- return 0;
-
- if (EVP_EncryptInit_ex(ctx, EVP_aes_256_ctr(), NULL, key, iv) != 1)
- goto cleanup;
-
- if (EVP_EncryptUpdate(ctx, out, &out_len, in, in_len) != 1)
- goto cleanup;
-
- if (EVP_EncryptFinal(ctx, out + out_len, &out_len) != 1)
- goto cleanup;
- ret = 1;
-
-cleanup:
- EVP_CIPHER_CTX_free(ctx);
- return ret;
-}
diff --git a/chip/host/dcrypto/app_cipher.c b/chip/host/dcrypto/app_cipher.c
deleted file mode 100644
index ab52484753..0000000000
--- a/chip/host/dcrypto/app_cipher.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright 2018 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 "dcrypto.h"
-#include "util.h"
-
-void app_compute_hash(uint8_t *p_buf, size_t num_bytes,
- uint8_t *p_hash, size_t hash_len)
-{
- uint8_t digest[SHA256_DIGEST_SIZE];
-
- /*
- * Use the built in dcrypto engine to generate the sha1 hash of the
- * buffer.
- */
- DCRYPTO_SHA256_hash((uint8_t *)p_buf, num_bytes, digest);
-
- memcpy(p_hash, digest, MIN(hash_len, sizeof(digest)));
-
- if (hash_len > sizeof(digest))
- memset(p_hash + sizeof(digest), 0,
- hash_len - sizeof(digest));
-}
-
-int app_cipher(const void *salt_p, void *out_p, const void *in_p, size_t size)
-{
- /* See README.md for why this is not a real encryption.. */
- size_t i;
- const uint8_t *src;
- const uint8_t *salt;
- uint8_t *dst;
-
- src = in_p;
- salt = salt_p;
- dst = out_p;
-
- for (i = 0; i < size; i++)
- dst[i] = src[i] ^ salt[i & 7];
-
- return 1;
-}
-
-int crypto_enabled(void)
-{
- return 1;
-}
diff --git a/chip/host/dcrypto/app_key.c b/chip/host/dcrypto/app_key.c
deleted file mode 100644
index 58066c84ba..0000000000
--- a/chip/host/dcrypto/app_key.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright 2018 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 "dcrypto.h"
-
-static int dcrypto_appkey_init_flag_ = -1;
-
-int DCRYPTO_appkey_init(enum dcrypto_appid appid, struct APPKEY_CTX *ctx)
-{
- if (dcrypto_appkey_init_flag_ != -1)
- return 0;
-
- dcrypto_appkey_init_flag_ = appid;
- return 1;
-}
-
-void DCRYPTO_appkey_finish(struct APPKEY_CTX *ctx)
-{
- memset(ctx, 0, sizeof(struct APPKEY_CTX));
- dcrypto_appkey_init_flag_ = -1;
-}
-
-int DCRYPTO_appkey_derive(enum dcrypto_appid appid, const uint32_t input[8],
- uint32_t output[8])
-{
- /* See README.md for while this is a passthrough. */
- memcpy(output, input, SHA256_DIGEST_SIZE);
- return 1;
-}
diff --git a/chip/host/dcrypto/sha256.c b/chip/host/dcrypto/sha256.c
deleted file mode 100644
index 429588c8ac..0000000000
--- a/chip/host/dcrypto/sha256.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Copyright 2018 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 "dcrypto.h"
-
-void DCRYPTO_SHA256_init(LITE_SHA256_CTX *ctx, uint32_t sw_required)
-{
- SHA256_init(ctx);
-}
-
-const uint8_t *DCRYPTO_SHA256_hash(const void *data, uint32_t n,
- uint8_t *digest)
-{
- SHA256_hash(data, n, digest);
- return digest;
-}