summaryrefslogtreecommitdiff
path: root/chip/g
diff options
context:
space:
mode:
authorAllen Webb <allenwebb@google.com>2018-08-17 17:45:26 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-09-07 18:36:33 -0700
commit5c5555a49d89154f14efa0c68c99938ef1313b73 (patch)
treeff53547f53396b590e39630c30c862908fdcacd0 /chip/g
parent6a9a3a62732ff31e247a9eb61a5f4e7c53154ee5 (diff)
downloadchrome-ec-5c5555a49d89154f14efa0c68c99938ef1313b73.tar.gz
host: Add dcrypto definitions that can be used by fuzzing targets.
These definitions provide the necessary dcrypto functionality for fuzzing pinweaver. They can be built out as needed to support further fuzzing. BRANCH=none BUG=chromium:876582 TEST=make -j buildfuzztests && ./build/host/cr50_fuzz/cr50_fuzz.exe (with the cr50_fuzz CL) Change-Id: I36ce874efab5dbc59825d126f6079b7b6d0da9ef Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/1180573 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip/g')
-rw-r--r--chip/g/dcrypto/dcrypto.h3
-rw-r--r--chip/g/dcrypto/internal.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/chip/g/dcrypto/dcrypto.h b/chip/g/dcrypto/dcrypto.h
index 5210710b72..93763b1f26 100644
--- a/chip/g/dcrypto/dcrypto.h
+++ b/chip/g/dcrypto/dcrypto.h
@@ -293,6 +293,9 @@ enum dcrypto_appid {
};
struct APPKEY_CTX {
+#ifdef TEST_FUZZ
+ uint8_t unused_for_cxx_compatibility;
+#endif
};
int DCRYPTO_ladder_compute_frk2(size_t major_fw_version, uint8_t *frk2);
diff --git a/chip/g/dcrypto/internal.h b/chip/g/dcrypto/internal.h
index 4baf175760..3e546e90a2 100644
--- a/chip/g/dcrypto/internal.h
+++ b/chip/g/dcrypto/internal.h
@@ -169,12 +169,14 @@ uint32_t dcrypto_dmem_load(size_t offset, const void *words, size_t n_words);
/*
* Key ladder.
*/
+#ifndef __cplusplus
enum dcrypto_appid; /* Forward declaration. */
int dcrypto_ladder_compute_usr(enum dcrypto_appid id,
const uint32_t usr_salt[8]);
int dcrypto_ladder_derive(enum dcrypto_appid appid, const uint32_t salt[8],
const uint32_t input[8], uint32_t output[8]);
+#endif
#endif /* ! __EC_CHIP_G_DCRYPTO_INTERNAL_H */