aboutsummaryrefslogtreecommitdiffstats
path: root/g10/seskey.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2024-04-09 13:49:00 +0000
committerWerner Koch <[email protected]>2024-04-10 06:48:49 +0000
commit84ddb24e30c54cc290121061ef4f93fbb306f4f1 (patch)
tree458f2199e7cede1b45d8945a4ff87e81d3f10d4a /g10/seskey.c
parentagent:kem: Externalize FIXED_INFO. (diff)
downloadgnupg-84ddb24e30c54cc290121061ef4f93fbb306f4f1.tar.gz
gnupg-84ddb24e30c54cc290121061ef4f93fbb306f4f1.zip
gpg: Make Kyber creation more flexible.
* common/openpgp-oid.c (openpgp_is_curve_supported): Allow the abbreviated curve name. * g10/pkglue.c (pk_encrypt): Add debug output. * g10/seskey.c (encode_session_key): Handle Kyber session key like ECDH. This is just a stub. * g10/keygen.c (ecckey_from_sexp): Use the modern OID for cv25519. (parse_key_parameter_part): Allow more Kyber variants. -- Test by creating an ed25519 key and using gpg --quick-add-key --batch --passphrase "" <fingerprint> <algo> to create several subkeys. Tested with ALGOs: kyber768 kyber1024 ky768_cv25519 ky768_bp256 kyber768_nistp256 ky1024_cv448 All curves capable of encryption should work. GnuPG-bug-id: 6815
Diffstat (limited to 'g10/seskey.c')
-rw-r--r--g10/seskey.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/g10/seskey.c b/g10/seskey.c
index 15c210b78..e5397080d 100644
--- a/g10/seskey.c
+++ b/g10/seskey.c
@@ -92,7 +92,9 @@ encode_session_key (int openpgp_pk_algo, DEK *dek, unsigned int nbits)
/* Shortcut for ECDH. It's padding is minimal to simply make the
output be a multiple of 8 bytes. */
- if (openpgp_pk_algo == PUBKEY_ALGO_ECDH)
+ /* FIXME: We use the ECDH also for Kyber for now. */
+ if (openpgp_pk_algo == PUBKEY_ALGO_ECDH
+ || openpgp_pk_algo == PUBKEY_ALGO_KYBER)
{
/* Pad to 8 byte granularity; the padding byte is the number of
* padded bytes.