Fix C++20 build am: 693745f801 am: 813b3f8eb4

Original change: https://android-review.googlesource.com/c/platform/system/keymaster/+/2858029

Change-Id: Ib420511567dfd762f2e3ccd6c5caf63721804dd4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/include/keymaster/keymaster_tags.h b/include/keymaster/keymaster_tags.h
index 29eae7c..dbd195c 100644
--- a/include/keymaster/keymaster_tags.h
+++ b/include/keymaster/keymaster_tags.h
@@ -102,7 +102,7 @@
         // Ensure that it's impossible to create a TypedTag instance whose 'tag' doesn't have type
         // 'tag_type'.  Attempting to instantiate a tag with the wrong type will result in a compile
         // error (no match for template specialization StaticAssert<false>), with no run-time cost.
-        StaticAssert<(tag & tag_type) == tag_type>::check();
+        StaticAssert<(static_cast<keymaster_tag_type_t>(tag) & tag_type) == tag_type>::check();
         StaticAssert<(tag_type != KM_ENUM) && (tag_type != KM_ENUM_REP)>::check();
     }
     // NOLINTNEXTLINE(google-explicit-constructor)
@@ -120,7 +120,7 @@
         // Ensure that it's impossible to create a TypedTag instance whose 'tag' doesn't have type
         // 'tag_type'.  Attempting to instantiate a tag with the wrong type will result in a compile
         // error (no match for template specialization StaticAssert<false>), with no run-time cost.
-        StaticAssert<(tag & tag_type) == tag_type>::check();
+        StaticAssert<(static_cast<keymaster_tag_type_t>(tag) & tag_type) == tag_type>::check();
         StaticAssert<(tag_type == KM_ENUM) || (tag_type == KM_ENUM_REP)>::check();
     }
     // NOLINTNEXTLINE(google-explicit-constructor)