aboutsummaryrefslogtreecommitdiffstats
path: root/src/conversion.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2026-10-13 14:23:30 +0200
committerWerner Koch <[email protected]>2026-10-13 14:23:30 +0200
commita85fa492369c5f65918cb37fc6d24d473237f838 (patch)
treeaf67eaecf1e55280d3df2307d2db668e2423d813 /src/conversion.c
parentlang:js: Call atob in global scope to ensure service worker compat (diff)
downloadgpgme-a85fa492369c5f65918cb37fc6d24d473237f838.tar.gz
gpgme-a85fa492369c5f65918cb37fc6d24d473237f838.zip
Add the Kyber variant GPGME_PK_MLKEM and MLDSA from RFC9980.HEADmaster
* src/gpgme.h.in (GPGME_PK_MLKEM, GPGME_PK_MLDSA): New. * src/conversion.c (_gpgme_map_pk_algo): Map the new MLDSA, MLKEM, and RFC9580 algo variants. * src/gpgme.c (gpgme_pubkey_algo_string): Mark MLDSA and MLKEM as composite. (gpgme_pubkey_algo_name): Add re-mapping.
Diffstat (limited to 'src/conversion.c')
-rw-r--r--src/conversion.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/conversion.c b/src/conversion.c
index 11e03e9c..b36457c1 100644
--- a/src/conversion.c
+++ b/src/conversion.c
@@ -693,6 +693,24 @@ _gpgme_map_pk_algo (int algo, gpgme_protocol_t protocol)
case 19: algo = GPGME_PK_ECDSA; break;
case 20: break;
case 22: algo = GPGME_PK_EDDSA; break;
+
+ case 25: algo = GPGME_PK_ECDH; break; /* X25519 (RFC9580). */
+ case 27: algo = GPGME_PK_EDDSA; break; /* Ed25519 (RFC9580). */
+
+ case 30: /* ML-DSA-65+Ed25519 (RFC9980) */
+ case 31: /* ML-DSA-87+Ed448 (RFC9980) */
+ algo = GPGME_PK_MLDSA;
+ break;
+
+ case 35: /* ML-KEM-768+X25519 (RFC9980) */
+ case 36: /* ML-KEM-1024+X448 (RFC9980) */
+ case 37: /* ML-KEM-768+ECDH-NIST-P-384 */
+ case 38: /* ML-KEM-1024+ECDH-NIST-P-521 */
+ case 39: /* ML-KEM-768+ECDH-brainpoolP384r1 */
+ case 40: /* ML-KEM-1024+ECDH-brainpoolP512r1 */
+ algo = GPGME_PK_MLKEM;
+ break;
+
default: algo = 0; break; /* Unknown. */
}
}