summaryrefslogtreecommitdiff
path: root/include/compile_time_macros.h
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2017-06-13 10:29:06 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-06-15 07:07:40 -0700
commit77e7913b696e16b7fae72e5210f940f8213ff1b5 (patch)
tree318738eb321302dd2a0e04a51c279729cbc4badd /include/compile_time_macros.h
parent7bfbedc2662dcab49d072db9885304df483de37c (diff)
downloadchrome-ec-77e7913b696e16b7fae72e5210f940f8213ff1b5.tar.gz
usb_update: Add handler for pairing challenge command
Handle UPDATE_EXTRA_CMD_PAIR_CHALLENGE command, where the lid sends a random x25519 public key, and nonce, and the base replies with its own (stable) x25519 public key, and computes a shared secret using its private key to verify its identity. BRANCH=none BUG=b:38486828 TEST=Flash hammer, ./usb_updater2 -c always reports the same device public key, and authenticator is correct. Change-Id: Ida60ffa7476794ee92669951c740dbe35950fb9c Reviewed-on: https://chromium-review.googlesource.com/532475 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/compile_time_macros.h')
-rw-r--r--include/compile_time_macros.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/compile_time_macros.h b/include/compile_time_macros.h
index f25ffd8407..b1e627d617 100644
--- a/include/compile_time_macros.h
+++ b/include/compile_time_macros.h
@@ -27,6 +27,8 @@
#define offsetof(type, member) __builtin_offsetof(type, member)
#endif
+#define member_size(type, member) sizeof(((type *)0)->member)
+
#define __visible __attribute__((externally_visible))
#endif /* __CROS_EC_COMPILE_TIME_MACROS_H */