-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Remove include dependency on underlying crypto libraries #2310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, I'd recommend:
- Using C++ rather than C-style casts.
- Seeing if static_asserts can be reduced by including them only in an initialization context. In addition, they are compile- rather than run-time, so I don't think they provide much value scattered about as they are.
- Would recommend using the more portable static assertions from nlassert.h if there is nothing else about this module that has explicit C++11 dependencies.
Thanks @gerickson , all these should be addressed now. |
@@ -454,7 +454,6 @@ | |||
"CHIP_DEVICE_LAYER_TARGET_LINUX=0", | |||
"CHIP_DEVICE_LAYER_TARGET_NRF5=0", | |||
"CHIP_DEVICE_LAYER_TARGET_EFR32=0", | |||
CHIP_CRYPTO_MBEDTLS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sooo pretty!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgt 6DAF m, little nits
Size increase report for "nrfconnect-example-build"
Full report output
|
Size increase report for "esp32-example-build"
Full report output
|
Size increase report for "gn_nrf-example-build"
Full report output
|
Size increase report for "gn_linux-example-build"
Full report output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
@woody-apple needs a button pusher |
@saurabhst, @jelderton, @BroderickCarlin, any comments? |
…p#2310) * Remove include dependency on underlying crypto libraries * Restyled by clang-format * Use nlassert, cpp style cast * Restyled by clang-format * use inline methods to cleanup the code * Restyled by clang-format Co-authored-by: Restyled.io <commits@restyled.io>
* WIP: Demonstration of action()-based binary flashing. Strawman for one method of building flashable binaries and a consistent method of flashing them, for parity with some existing `make flash` commands and ultimately for automated testing. This is temporarily wholly inside examples/lock-app/nrf5 in order to experiment with minimal disruption but is intended to become generic. issue #1520 GN build parity - flashing * Remove include dependency on underlying crypto libraries (#2310) * Remove include dependency on underlying crypto libraries * Restyled by clang-format * Use nlassert, cpp style cast * Restyled by clang-format * use inline methods to cleanup the code * Restyled by clang-format Co-authored-by: Restyled.io <commits@restyled.io> * [shell] add missing inttypes.h header (#2357) * Address feedback and generalize. * WIP: Demonstration of action()-based binary flashing. Strawman for one method of building flashable binaries and a consistent method of flashing them, for parity with some existing `make flash` commands and ultimately for automated testing. This is temporarily wholly inside examples/lock-app/nrf5 in order to experiment with minimal disruption but is intended to become generic. issue #1520 GN build parity - flashing * Address feedback and generalize. * Add missing (ignored) symbolic link for `build`. * Remove unused import from gn_run_binary.py * Fix paths in flashing rules * Remove the build symlinks On second thought, we need to wait for automake removal for this. * Revised flashing script generation and execution. * Streamlined scripts and BUILD.gn files. * Script/generator cleanup and description. * Restyled by gn Co-authored-by: Pankaj Garg <pgarg2@apple.com> Co-authored-by: Restyled.io <commits@restyled.io> Co-authored-by: Jiacheng Guo <gjc@google.com> Co-authored-by: Michael Spang <spang@google.com>
Problem
CHIPCryptoPal.h includes headers from underlying implementations (OpenSSL, mbedTLS). This requires the code at upper layers to be aware of which crypto implementation is being used, and requires it to specify include paths (e.g. iOS framework project file has to point to mbedTLS header file location).
Summary of Changes
Move implementation specific code to individual implementation source code. The interface has opaque types for the context, and the size of context is checked via
static_assert
in each implementation file.fixes #2284