spdm: Make Crypto trait unsafe

The Crypto trait implementations need to uphold the invariant that Out
params should be initialized after successful (returns Ok) method calls,
so it should be marked as unsafe. Add some guarantees for helper
functions that have the same requirements as well.

BUG=b:284394614
TEST=spdm unittests

Change-Id: If03f917bc40708567c3aaa9590df73774dfc1f9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/spdm/+/5568549
Reviewed-by: Vadim Sukhomlinov <sukhomlinov@google.com>
Commit-Queue: Howard Yang <hcyang@google.com>
Tested-by: Howard Yang <hcyang@google.com>
6 files changed