tests: Use libopen_dice_clear_memory

Stop re-implementing DiceClearMemory() wherever needed and use the
standalone implementation provided by upstream open-dice in our tests.

Note that the following tests:

- libservice_vm_requests.test
- libdiced_open_dice_nostd.integration_test

ues libdiced_open_dice_nostd but don't seem to require a definition of
DiceClearMemory(), which _could_ mean that one of their dependencies is
providing it e.g. libopen_dice_cbor or libopen_dice_cbor_p384.

Bug: 357008987
Test: m libpvmfw.dice.test
Test: m libdiced_sample_inputs_nostd.integration_test
Change-Id: I4b4ef61705ced42747fe5ddf3ebad13d91122554
diff --git a/libs/dice/sample_inputs/Android.bp b/libs/dice/sample_inputs/Android.bp
index 36fe8c7..c1c4566 100644
--- a/libs/dice/sample_inputs/Android.bp
+++ b/libs/dice/sample_inputs/Android.bp
@@ -78,4 +78,5 @@
         "libdiced_open_dice_nostd",
         "libdiced_sample_inputs_nostd",
     ],
+    static_libs: ["libopen_dice_clear_memory"],
 }
diff --git a/libs/dice/sample_inputs/tests/api_test.rs b/libs/dice/sample_inputs/tests/api_test.rs
index d713168..c627824 100644
--- a/libs/dice/sample_inputs/tests/api_test.rs
+++ b/libs/dice/sample_inputs/tests/api_test.rs
@@ -146,21 +146,3 @@
     let public_key = chain.leaf().subject_public_key();
     public_key.verify(&signature, MESSAGE)
 }
-
-/// Flushes data caches over the provided address range in open-dice.
-///
-/// # Safety
-///
-/// The provided address and size must be to an address range that is valid for read and write
-/// (typically on the stack, .bss, .data, or provided BCC) from a single allocation
-/// (e.g. stack array).
-#[cfg(not(feature = "std"))]
-#[no_mangle]
-unsafe extern "C" fn DiceClearMemory(
-    _ctx: *mut core::ffi::c_void,
-    size: usize,
-    addr: *mut core::ffi::c_void,
-) {
-    // SAFETY: The caller ensures that the address and size are valid for write.
-    unsafe { core::ptr::write_bytes(addr as *mut u8, 0, size) };
-}