mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: Changed internal data format for Kyber.
* g10/packet.h (PKT_pubkey_enc): Add field seskey_algo. (struct pubkey_enc_list): Ditto. * g10/misc.c (pubkey_get_nenc): Change value for Kyber from 4 to 3. * g10/parse-packet.c (parse_pubkeyenc): Store the Kyber algo in the new field and adjust data. Do not store the length byte in data[2]. * g10/build-packet.c (do_pubkey_enc): Take the session algo for Kyber from the new field. * g10/encrypt.c (write_pubkey_enc): Ses the seskey_algo. * g10/mainproc.c (proc_pubkey_enc): Copy it. * g10/pubkey-enc.c (get_it): Support Kyber decryption. * g10/seskey.c (encode_session_key): Handle Kyber different from ECDH. -- Having always the single byte in the packet data than to store and retrieve it from an MPI is much easier. Thus this patch changes the original internal format. With this chnages decryption of the slighly modified test data works now. See the bug tracker for test data. GnuPG-bug-id: 6815
This commit is contained in:
parent
61717fb0a7
commit
813f8d1b8e
8 changed files with 104 additions and 42 deletions
|
@ -137,6 +137,8 @@ typedef struct {
|
|||
byte version;
|
||||
/* The algorithm used for the public key encryption scheme. */
|
||||
byte pubkey_algo;
|
||||
/* The session key algorithm used by some pubkey algos. */
|
||||
byte seskey_algo;
|
||||
/* Whether to hide the key id. This value is not directly
|
||||
serialized. */
|
||||
byte throw_keyid;
|
||||
|
@ -151,6 +153,7 @@ struct pubkey_enc_list
|
|||
struct pubkey_enc_list *next;
|
||||
u32 keyid[2];
|
||||
int pubkey_algo;
|
||||
int seskey_algo;
|
||||
int result;
|
||||
gcry_mpi_t data[PUBKEY_MAX_NENC];
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue