aboutsummaryrefslogtreecommitdiffstats
path: root/common/openpgpdefs.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-11-13 15:10:05 +0000
committerWerner Koch <[email protected]>2023-11-13 15:13:30 +0000
commit6fab7b075adfa2931e2c0bbccf3038b3d916f37c (patch)
tree65804a031e0a56da04346d996259ca10996442f7 /common/openpgpdefs.h
parentgpg,sm: Set confidential in assuan communication for password. (diff)
downloadgnupg-6fab7b075adfa2931e2c0bbccf3038b3d916f37c.tar.gz
gnupg-6fab7b075adfa2931e2c0bbccf3038b3d916f37c.zip
gpg: Implement a parser for Kyber encrypted packets.
* g10/misc.c (pubkey_get_nenc): Add ky768 and ky1024 values. * g10/parse-packet.c (read_octet_string): New. (read_size_body): Rename to ... (read_sized_octet_string): this and change args to update-able PKTLEN. (parse_pubkeyenc): Split general parsing loop for easier reading. Implement parser for the Kyber algorithms. -- Take care: this has not been tested at all, it merely passes the regression test for the other algos. Kyber is also known as ML-KEM in FIPS-203. The list mode is slighly changed: In case of a parsing error no data is printed - before that already parsed data was printed. GnuPG-bug-id: 6815
Diffstat (limited to 'common/openpgpdefs.h')
-rw-r--r--common/openpgpdefs.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/openpgpdefs.h b/common/openpgpdefs.h
index 8553a889f..c97995568 100644
--- a/common/openpgpdefs.h
+++ b/common/openpgpdefs.h
@@ -169,11 +169,11 @@ typedef enum
PUBKEY_ALGO_ELGAMAL = 20, /* Elgamal encrypt+sign (legacy). */
/* 21 reserved by OpenPGP. */
PUBKEY_ALGO_EDDSA = 22, /* EdDSA. */
- PUBKEY_ALGO_KY768_25519 = 29, /* Kyber768 + X25519 */
- PUBKEY_ALGO_KY1024_448 = 30, /* Kyber1024 + X448 */
- PUBKEY_ALGO_DIL3_25519 = 35, /* Dilithium3 + Ed25519 */
- PUBKEY_ALGO_DIL5_448 = 36, /* Dilithium5 + Ed448 */
- PUBKEY_ALGO_SPHINX_SHA2 = 41, /* SPHINX+-simple-SHA2 */
+ PUBKEY_ALGO_KY768_25519 = 29, /* Kyber768 + X25519 (aka ML-KEM-768) */
+ PUBKEY_ALGO_KY1024_448 = 30, /* Kyber1024 + X448 (aka ML-KEM-1024) */
+ PUBKEY_ALGO_DIL3_25519 = 35, /* Dilithium3 + Ed25519 (aka ML-DSA-65) */
+ PUBKEY_ALGO_DIL5_448 = 36, /* Dilithium5 + Ed448 (aka ML-DSA-87) */
+ PUBKEY_ALGO_SPHINX_SHA2 = 41, /* SPHINX+-simple-SHA2 (aka SLH-DSA-SHA2) */
PUBKEY_ALGO_PRIVATE10 = 110
}
pubkey_algo_t;
@@ -208,7 +208,7 @@ compress_algo_t;
#define OPENPGP_MAX_NPKEY 5 /* Maximum number of public key parameters. */
#define OPENPGP_MAX_NSKEY 7 /* Maximum number of secret key parameters. */
#define OPENPGP_MAX_NSIG 2 /* Maximum number of signature parameters. */
-#define OPENPGP_MAX_NENC 2 /* Maximum number of encryption parameters. */
+#define OPENPGP_MAX_NENC 4 /* Maximum number of encryption parameters. */
/* Decode an rfc4880 encoded S2K count. */