I have a Cv25519 subkey that is used both on its own _and_ as the ECC part of a dual Kyber/ECC key. The Cv25519 key is on a Gnuk token. (I briefly described this setup in T7648).
With GnuPG 2.5.7, trying to decrypt a message encrypted to the Kyber/ECC key works as expected (confirming that T7648 seems fixed). But now, trying to decrypt a message encrypted to the Cv25519 key _only_ fails:
$ gpg -d test.asc gpg: encrypted with cv25519 key, ID BF74EFBEBF46197E, created 2018-06-05 "Damien Goutte-Gattat <dgouttegattat@incenp.org>" gpg: public key decryption failed: Invalid data gpg: decryption failed: Invalid data
I also replicated the issue on a separate GNUPGHOME with no Kyber key at all, just the token-based Cv25519.
Relevant fragment from the agent’s log:
gpg-agent[22145] DBG: chan_12 <- SETKEYDESC Please+enter+the+passphrase+to+unlock+the+OpenPGP+secret+key:%0A%22Damien+Goutte-Gattat+<dgouttegattat@incenp.org>%22%0A> gpg-agent[22145] DBG: chan_12 -> OK gpg-agent[22145] DBG: chan_12 <- PKDECRYPT --kem=PGP gpg-agent[22145] DBG: chan_12 -> S INQUIRE_MAXLEN 4096 gpg-agent[22145] DBG: chan_12 -> INQUIRE CIPHERTEXT gpg-agent[22145] DBG: chan_12 <- [ 44 20 28 37 3a 65 6e 63 2d 76 61 6c 28 33 3a 65 ...(198 byte(s) skipped) ] gpg-agent[22145] DBG: chan_12 <- END gpg-agent[22145] DBG: chan_13 -> SERIALNO --all gpg-agent[22145] DBG: chan_13 <- S SERIALNO D2760001240100000006121575690000 gpg-agent[22145] DBG: chan_13 <- OK gpg-agent[22145] DBG: chan_13 -> KEYINFO B5940B7C7D54876AC1538D222EC85F1E8BAA76CF gpg-agent[22145] SIGUSR2 received - updating card event counter gpg-agent[22145] DBG: chan_13 <- S KEYINFO B5940B7C7D54876AC1538D222EC85F1E8BAA76CF T D2760001240100000006121575690000 OPENPGP.2 e gpg-agent[22145] DBG: chan_13 <- OK gpg-agent[22145] ecc_pgp_kem_decap: ECC cipher text length invalid (32 != 33) gpg-agent[22145] command 'PKDECRYPT' failed: Invalid data gpg-agent[22145] DBG: chan_12 -> ERR 67108943 Invalid data <GPG Agent>