[dice] Add trait DiceArtifacts to access BCC and CDI values

The added DiceArtifacts is implemented for both BccHandover and
OwnedDiceArtifacts. This allows us to access the dice artifacts in
an easy and uniform way.

[u8; CDI_SIZE] is used instead of the alias Cdi to facilitate a
future conversion from Cdi alias to Cdi type so that we can have
more controle over the memory security of CDI. More context in
b/268587826.

Bug: 267575445
Test: atest diced_utils_test diced_sample_inputs_test \
diced_vendor_test diced_open_dice_cbor_test \
libdiced_open_dice_nostd.integration_test \
libdiced_open_dice.integration_test diced_open_dice_cbor_test

Change-Id: Iabb87ad18f2f4a4d46283da045eb21a5776ad4b4
diff --git a/diced/src/sample_inputs.rs b/diced/src/sample_inputs.rs
index 802a6d3..824ee9e 100644
--- a/diced/src/sample_inputs.rs
+++ b/diced/src/sample_inputs.rs
@@ -18,11 +18,11 @@
 use android_hardware_security_dice::aidl::android::hardware::security::dice::{
     Config::Config as BinderConfig, InputValues::InputValues as BinderInputValues, Mode::Mode,
 };
-use anyhow::{Context, Result};
+use anyhow::{anyhow, Context, Result};
 use dice::ContextImpl;
+use diced_open_dice::DiceArtifacts;
 use diced_open_dice_cbor as dice;
 use diced_utils::{cbor, to_dice_input_values};
-use std::convert::TryInto;
 use std::ffi::CStr;
 use std::io::Write;
 
@@ -100,9 +100,9 @@
     )
     .context("In make_sample_bcc_and_cdis: Trying to run first bcc main flow.")?;
     dice::retry_bcc_main_flow(
-        &dice_artifacts.cdi_values.cdi_attest,
-        &dice_artifacts.cdi_values.cdi_seal,
-        &dice_artifacts.bcc,
+        dice_artifacts.cdi_attest(),
+        dice_artifacts.cdi_seal(),
+        dice_artifacts.bcc().ok_or_else(|| anyhow!("bcc is none"))?,
         &to_dice_input_values(&input_values_vector[2]),
     )
     .context("In make_sample_bcc_and_cdis: Trying to run second bcc main flow.")