[dice] Move DiceSign/Verify nostd/std versions to diced_open_dice
As a step of merging the existing diced_open_dice_cbor library into
the new open-dice wrapper diced_open_dice.
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: I1f8baecd92a516bc724741ffbe322b913f89db5b
diff --git a/diced/src/hal_node.rs b/diced/src/hal_node.rs
index ca470e5..7a397ec 100644
--- a/diced/src/hal_node.rs
+++ b/diced/src/hal_node.rs
@@ -220,7 +220,7 @@
)
})?)
.context("In ResidentHal::sign: Failed to derive keypair from seed.")?;
- dice.sign(
+ let signature = dice::sign(
message,
private_key[..].try_into().with_context(|| {
format!(
@@ -229,7 +229,8 @@
)
})?,
)
- .context("In ResidentHal::sign: Failed to sign.")
+ .context("In ResidentHal::sign: Failed to sign.")?;
+ Ok(signature.to_vec())
})
.context("In ResidentHal::sign:")?;
Ok(Signature { data: signature })
diff --git a/diced/src/utils.rs b/diced/src/utils.rs
index c249366..2b47dac 100644
--- a/diced/src/utils.rs
+++ b/diced/src/utils.rs
@@ -19,7 +19,7 @@
Mode::Mode as BinderMode,
};
use anyhow::{Context, Result};
-use diced_open_dice_cbor as dice;
+use diced_open_dice as dice;
use keystore2_crypto::ZVec;
use std::convert::TryInto;