Merge "Key{Mint,Master} VTS: fix incremental AES tags" am: e5c2bf01fc
am: 523b300da7
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2020421 Change-Id: I7925574830ff84e4d19666769fdf8285966e283e
This commit is contained in:
commit
a219992eef
2 changed files with 18 additions and 12 deletions
|
@ -445,12 +445,15 @@ string KeymasterHidlTest::MacMessage(const string& message, Digest digest, size_
|
|||
|
||||
void KeymasterHidlTest::CheckAesIncrementalEncryptOperation(BlockMode block_mode,
|
||||
int message_size) {
|
||||
ASSERT_EQ(ErrorCode::OK, GenerateKey(AuthorizationSetBuilder()
|
||||
.Authorization(TAG_NO_AUTH_REQUIRED)
|
||||
.AesEncryptionKey(128)
|
||||
.BlockMode(block_mode)
|
||||
.Padding(PaddingMode::NONE)
|
||||
.Authorization(TAG_MIN_MAC_LENGTH, 128)));
|
||||
auto builder = AuthorizationSetBuilder()
|
||||
.Authorization(TAG_NO_AUTH_REQUIRED)
|
||||
.AesEncryptionKey(128)
|
||||
.BlockMode(block_mode)
|
||||
.Padding(PaddingMode::NONE);
|
||||
if (block_mode == BlockMode::GCM) {
|
||||
builder.Authorization(TAG_MIN_MAC_LENGTH, 128);
|
||||
}
|
||||
ASSERT_EQ(ErrorCode::OK, GenerateKey(builder));
|
||||
|
||||
for (int increment = 1; increment <= message_size; ++increment) {
|
||||
string message(message_size, 'a');
|
||||
|
|
|
@ -667,12 +667,15 @@ string KeyMintAidlTestBase::MacMessage(const string& message, Digest digest, siz
|
|||
|
||||
void KeyMintAidlTestBase::CheckAesIncrementalEncryptOperation(BlockMode block_mode,
|
||||
int message_size) {
|
||||
ASSERT_EQ(ErrorCode::OK, GenerateKey(AuthorizationSetBuilder()
|
||||
.Authorization(TAG_NO_AUTH_REQUIRED)
|
||||
.AesEncryptionKey(128)
|
||||
.BlockMode(block_mode)
|
||||
.Padding(PaddingMode::NONE)
|
||||
.Authorization(TAG_MIN_MAC_LENGTH, 128)));
|
||||
auto builder = AuthorizationSetBuilder()
|
||||
.Authorization(TAG_NO_AUTH_REQUIRED)
|
||||
.AesEncryptionKey(128)
|
||||
.BlockMode(block_mode)
|
||||
.Padding(PaddingMode::NONE);
|
||||
if (block_mode == BlockMode::GCM) {
|
||||
builder.Authorization(TAG_MIN_MAC_LENGTH, 128);
|
||||
}
|
||||
ASSERT_EQ(ErrorCode::OK, GenerateKey(builder));
|
||||
|
||||
for (int increment = 1; increment <= message_size; ++increment) {
|
||||
string message(message_size, 'a');
|
||||
|
|
Loading…
Reference in a new issue