Conversation
…ha2, utils cargo manifests
…e, now bc-core builds and tests for no_std
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Link
resolves #134
Summary
Updates core and core-test-framework crates to build with no_std, and configures workspace and other packages to support no_std
Description
What did you do?
This PR incrementally enables no_std support for bouncycastle-core and bouncycastle-core-test-framework. The most consequential changes are:
allocfeature to a number of crates in the dependency graph of bouncycastle-core in tests mode (hkdf, hmac, rng, sha2)#![cfg_attr(not(feature = "alloc"), no_std)]tocrypto/core/src/lib.rsto force no_std when alloc is not enabled for bouncycastle-corecrypto/core/src/traits.rsto feature-gate any std/alloc dependent functions in the core bc-rust traitstraits.rsin the crate dependency graph_array()functions intraits.rsfor convenient alternatives to_out()functions when in no_std modeWhy did you choose this approach?
What alternatives did you consider?
// todo: may require no_std equivalentin the code. I believe it will be more efficient to manage adding back parallel tests in their own PR because it will take me some effort to understand and replicateall of them correctly.
Did you add or update any tests to account for these changes?
No tests added - many tests feature-gated for no_std builds, see reasoning above.
Is there anything else the reviewer should keep in mind?
alloc, for any package other than sha2 or sha3 (including when building --workspace), is currently an unsupported configuration.Scope and Risk
Which packages are impacted?
allocfeature is not enabled, so default builds usingallocshould ideally see no change.What runtime behaviors could be impacted?
It's unlikely that any changes in this PR will impact runtime behaviours - I would expect to see breaks at compile time rather than at runtime.
How likely is it that there could be unexpected regressions?
What could go wrong in the worst-possible scenario?
There are two major areas of risk I've identified:
allocfeature in many packages, and to ensure that dependencies only inheritallocwhen needed. There could be unexpected dependency breakages when bulding packages if the dependencies have been misconfigured.Validation
AI Usage Statement
Did you use AI in creating this pull request:
If submitted code changes were generated by AI, fill in the following declaration:
Assisted-by: ClaudeCode:Sonnet5