[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/Android.bp b/diced/open_dice/Android.bp
index b87be7f..745b86e 100644
--- a/diced/open_dice/Android.bp
+++ b/diced/open_dice/Android.bp
@@ -17,12 +17,16 @@
         "libopen_dice_cbor_bindgen_nostd",
         "libzeroize_nostd",
     ],
+    features: [
+        "alloc",
+    ],
     whole_static_libs: [
         "libopen_dice_cbor",
         "libcrypto_baremetal",
     ],
     visibility: [
         "//packages/modules/Virtualization:__subpackages__",
+        "//system/security/diced/sample_inputs",
     ],
 }
 
@@ -36,6 +40,7 @@
         "libzeroize",
     ],
     features: [
+        "alloc",
         "std",
     ],
     shared_libs: [
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,
diff --git a/diced/open_dice/src/retry.rs b/diced/open_dice/src/retry.rs
index 84ca5f5..a6303bd 100644
--- a/diced/open_dice/src/retry.rs
+++ b/diced/open_dice/src/retry.rs
@@ -23,6 +23,8 @@
 };
 use crate::error::{DiceError, Result};
 use crate::ops::generate_certificate;
+#[cfg(feature = "alloc")]
+use alloc::vec::Vec;
 
 /// Artifacts stores a set of dice artifacts comprising CDI_ATTEST, CDI_SEAL,
 /// and the BCC formatted attestation certificate chain.