1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00
Werner Koch 97f5159495
gpg: Initial support for generating Kyber subkeys.
* common/openpgpdefs.h (PUBKEY_ALGO_KY768_25519): Remove.
(PUBKEY_ALGO_KY1024_448): Remove.
(PUBKEY_ALGO_KYBER): New.  Use them everywhere instead of the removed.

* g10/build-packet.c (gpg_mpi_write_nohdr): Rename to
(gpg_mpi_write_opaque_nohdr): this.  Change callers.
(gpg_mpi_write_opaque_32): New.
(do_key): Support Kyber keys using the revised format.
* g10/gpg.h (MAX_EXTERN_KEYPARM_BITS): New.
* g10/parse-packet.c (read_octet_string): Add arg nbytes so support
reading with a length prefix.  Adjust callers.
(parse_key): Parse Kyber public keys.
* g10/misc.c (pubkey_get_npkey): Support Kyber.
(pubkey_get_nskey): Ditto.

* g10/keyid.c (pubkey_string): Support dual algorithms.
(do_hash_public_key): Support Kyber.
(nbits_from_pk): Ditto.
(keygrip_from_pk): Return the Kyber part for the ECC+Kyber dual algo.

* g10/keygen.c (struct common_gen_cb_parm_s): Add genkey_result2.
Note that this callback is not yet used.
(ecckey_from_sexp): Add optional arg sexp2 and use it for Kyber.
Change callers.
(ecckey_from_sexp): Do not leak LIST in case of an error.
(common_gen): Add arg keyparms2, change callers, and support Kyber.
(gen_kyber): New.
(get_keysize_range): Support Kyber.
(fixup_keysize): Simplify and support Kyber.
(do_create): Handle Kyber.
(parse_key_parameter_part): Remove algo strings "ky768" and "ky1024"
and add a generic "kyber" with default parameters.
--

This uses a revised format which is more aligned with the usual
OpenPGP structure.  A lot of things are still missing.  For example
support for handling two keygrips and checking both of them in a -K
listing.  There is also only ky768_bp384 as fixed algorithm for now.
No passphrase for the Kyber part of the dual algorithm is on purpose.

A test was done using

  gpg --quick-gen-key pqc1 nistp256

and then running

  gpg -v --quick-add-key <fingerprint> kyber

which creates a v5 subkey on a v4 primary key.  A second test using

  gpg --quick-gen-key pqc2 Ed448

followed by a --quick-add-key created a v5 key with a v5 subkey.

GnuPG-bug-id: 6815
2024-04-03 18:01:11 +02:00
..
2018-10-25 16:53:05 -04:00
2015-10-28 10:20:17 +01:00
2021-10-06 10:35:51 +02:00
2020-02-18 18:07:46 -05:00
2015-11-17 12:50:22 +01:00
2024-02-15 14:40:33 +09:00
2024-03-29 15:26:42 +09:00
2021-12-20 19:34:34 +01:00
2021-12-20 19:34:34 +01:00
2018-10-25 16:53:05 -04:00
2018-10-25 16:53:05 -04:00
2019-04-16 13:24:10 +09:00
2019-07-12 12:11:26 +09:00
2020-02-18 18:07:46 -05:00
2016-03-02 14:27:30 +01:00
2018-10-25 16:53:05 -04:00
2023-05-01 11:38:20 +09:00
2018-10-24 15:56:18 -04:00
2024-02-10 14:26:55 +01:00
2019-10-01 10:32:31 +02:00
2020-02-18 18:07:46 -05:00
2020-02-18 18:07:46 -05:00
2020-02-18 18:07:46 -05:00
2022-09-14 15:42:03 +09:00
2022-04-06 13:28:15 +09:00
2022-08-02 14:35:38 +02:00
2022-08-02 14:35:38 +02:00
2022-08-02 14:35:38 +02:00
2017-02-21 13:11:46 -05:00

Common functionality used by all modules of GnuPG.