Refactor OEMCrypto_SetDecryptHash

The current implementation of OEMCrypto_SetDecryptHash gives developers
flexibility to use different types of hashes. However, all the
implementations we have seen thus far use crc32. Because of this, crc32
should be sufficient and we can refactor OEMCrypto_SetDecryptHash to
only use the crc32 hash.

Bug: 287706586
Change-Id: I4aaa253b2656dfd9c984f77dfb08fe160b23b47c
This commit is contained in:
Vicky Min
2023-08-01 17:29:41 +00:00
committed by Robert Shih
parent c26d6d3c97
commit 18369730b9
8 changed files with 51 additions and 43 deletions

View File

@@ -386,11 +386,9 @@ class OEMCryptoSessionTestsDecryptTests
if (verify_crc_) {
const TestSample& sample = samples_[0];
uint32_t hash =
uint32_t crc32 =
util::wvcrc32(sample.truth_buffer.data(), sample.truth_buffer.size());
OEMCrypto_SetDecryptHash(session_.session_id(), 1,
reinterpret_cast<const uint8_t*>(&hash),
sizeof(hash));
OEMCrypto_SetDecryptHash(session_.session_id(), 1, crc32);
}
// Build an array of just the sample descriptions.