Merge "Key{Mint,Master} VTS: fix incremental AES tags" am: e5c2bf01fc
am: 523b300da7
am: a219992eef
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2020421 Change-Id: I771b72b5f4f439c8b6eea264010b90f0efa876a8
This commit is contained in:
commit
79972e7645
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