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.

We could consider doing the same for other modes that aren't defined
to take a block size suffix, like CCM and CTR, but for now we might as
well avoid too much diff from upstream.

Test: cts -m CtsLibcoreTestCases
Change-Id: I1430fd7678679b1ed23d9c511bc8a1211a7f8c91
2 files changed