Port android CipherSpi selection algorithm to openJdk

Algorithm adopted from the sgiro@ CipherHelper class from
https://android-review.googlesource.com/#/c/186240/

Bug: 25873823
Bug: 26023788
Bug: 26024300
Change-Id: I2d067f071bf8125640fdc01e04240df8ce206bb6
2 files changed