KeyMint Curve 25519 support

The overall structure of the class design is a bit awkward.

This is partly because OpenSSL deals with Ed25519/X25519 differently
than for other EC keys: EVP_PKEY does support {Ed,X}25519, but they
have different EVP_PKEY_type values than EVP_PKEY_EC, and some
entrypoints (e.g. i2d_PrivateKey()) for EVP_PKEYs don't support curve
25519 keys.

It's also partly because the existing class structure doesn't quite
accomodate different behaviour based on curve; for example:
 - key factories are selected by Tag::ALGORITHM
 - operation factories are selected by Tag::PURPOSE
neither of which allow for different factories for different curves.

So to avoid having to rework the existing class hierarchy, instead treat
the curve 25519 keys as special cases in EcKeyFactory. Curve 25519 are
also special in that only one purpose is allowed: a SIGN / ATTEST_KEY
key is Ed25519, but an AGREE_KEY key is X25519, which work differently.

Include support for importing both PKCS#8 encoded keys and raw keys.

Bug: 194358913
Test: TreeHugger, VtsAidlKeyMintTargetTest
Change-Id: Idd919b1c5d97df16afcace96cb992c47c05d637b
11 files changed