Expect x25519 data as SubjectPublicKeyInfo

Expect that the data for an X25519 key agreement operations should
arrive in the form of a SubjectPublicKeyInfo ASN1 structure rather than
just a raw key. This is more convenient and more consistent with the
expectations for other EC keys (using NIST curves).

Now that x25519 public keys are arriving in a SubjectPublicKeyInfo
envelope, make sure the correct error code is emitted when they
trigger a failure when erroneously attempting to perform key agreement
against a NIST curve private key.

Test: VtsAidlKeyMintTargetTest
Bug: 231959070
Change-Id: I0d515a7d3b7124288d36cbd219e3679fa5137f0c
Merged-In: I0d515a7d3b7124288d36cbd219e3679fa5137f0c
Ignore-AOSP-First: already in aosp/master
1 file changed