Only match on exactly GCM mode

In Conscrypt, we're adding AES/GCM-SIV/NoPadding as a cipher, which is
a different cipher than AES/GCM/NoPadding.  Bouncy Castle previously
treated any mode that started with "GCM" as being GCM, which now means
it will supply the (incorrectly functioning) GCM mode when GCM-SIV is
requested.  Make the match more strict to keep that from happening.

Bug: 148517383
Test: atest CtsLibcoreTestCases

Cherry pick of aosp/1094130

Change-Id: I52dbd3b82ce527df7e4905c1fbe0f66f4d67f86d
2 files changed