[dice] Add nostd version of libdiced_sample_inputs
This cl adds a version of libdiced_sample_inputs
that is compatible with the nostd environment.
This allows the sample inputs to be used as DICE
chain in the non-protected rialto later for testing
purposes.
Test: atest libdiced_sample_inputs.integration_test \
libdiced_sample_inputs_nostd.integration_test
Bug: 287233786
Change-Id: I6e96e051a8ba0b232521b259d5473520ac767383
diff --git a/diced/open_dice/src/lib.rs b/diced/open_dice/src/lib.rs
index 6d082b8..83ae07f 100644
--- a/diced/open_dice/src/lib.rs
+++ b/diced/open_dice/src/lib.rs
@@ -17,6 +17,9 @@
#![cfg_attr(not(feature = "std"), no_std)]
+#[cfg(feature = "alloc")]
+extern crate alloc;
+
#[cfg(not(feature = "std"))]
extern crate core as std;
@@ -24,7 +27,7 @@
mod dice;
mod error;
mod ops;
-#[cfg(feature = "std")]
+#[cfg(feature = "alloc")]
mod retry;
pub use bcc::{
@@ -38,7 +41,7 @@
};
pub use error::{DiceError, Result};
pub use ops::{generate_certificate, hash, kdf, keypair_from_seed, sign, verify};
-#[cfg(feature = "std")]
+#[cfg(feature = "alloc")]
pub use retry::{
retry_bcc_format_config_descriptor, retry_bcc_main_flow, retry_dice_main_flow,
retry_generate_certificate, OwnedDiceArtifacts,