Implementation of PQC Algorithms in libgcrypt

Falko Strenzke falko.strenzke at mtg.de
Mon Apr 3 05:59:10 CEST 2023


Hi Werner,

the only API change is the addition of the following interface function:

gcry_err_code_t
_gcry_pk_encap(gcry_sexp_t *r_ciph, gcry_sexp_t* r_shared_key, 
gcry_sexp_t s_pkey)

This also means that the public key spec needs to contain this 
additional function. For Kyber our public key spec currently looks as 
follows:

gcry_pk_spec_t _gcry_pubkey_spec_kyber = {
   GCRY_PK_KYBER, {0, 1},
   (GCRY_PK_USAGE_ENCAP),        // TODOMTG: can the key usage 
"encryption" remain or do we need new KU "encap"?
   "Kyber", kyber_names,
   "p", "s", "a", "", "p",       // elements of pub-key, sec-key, 
ciphertext, signature, key-grip
   kyber_generate,
   kyber_check_secret_key,
   NULL,                         // encrypt
   kyber_encap,
   kyber_decrypt,
   NULL,                         // sign,
   NULL,                         // verify,
   kyber_get_nbits,
   run_selftests,
   compute_keygrip
};

For the PKEs the encapsulation function would of course be NULL. 
Regarding the TODO on the key usage marked in the code above, this so 
far doesn't seem to have any implications for us so the decision isn't 
urgent from my point of view.

- Falko

Am 30.03.23 um 15:43 schrieb Werner Koch:
> On Wed, 29 Mar 2023 10:09, Falko Strenzke said:
>
>> While the integration of the signature algorithms is straightforward, the KEM
>> requires a new interface function, as the KEM encapsulation cannot be modelled
>> by a public-key encryption.
> It would be good if we can discuss a proposed API early enough, so that
> we can see how it fits into the design of Libgcrypt.  Can you already
> roughly describes the needs?
>
>
> Salam-Shalom,
>
>     Werner
>
-- 

*MTG AG*
Dr. Falko Strenzke
Executive System Architect

Phone: +49 6151 8000 24
E-Mail: falko.strenzke at mtg.de
Web: mtg.de <https://www.mtg.de>


*MTG Exhibitions – See you in 2023*

------------------------------------------------------------------------
<https://community.e-world-essen.com/institutions/allExhibitors?query=true&keywords=mtg> 
<https://www.itsa365.de/de-de/companies/m/mtg-ag>

MTG AG - Dolivostr. 11 - 64293 Darmstadt, Germany
Commercial register: HRB 8901
Register Court: Amtsgericht Darmstadt
Management Board: Jürgen Ruf (CEO), Tamer Kemeröz
Chairman of the Supervisory Board: Dr. Thomas Milde

This email may contain confidential and/or privileged information. If 
you are not the correct recipient or have received this email in error,
please inform the sender immediately and delete this email. Unauthorised 
copying or distribution of this email is not permitted.

Data protection information: Privacy policy 
<https://www.mtg.de/en/privacy-policy>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gcrypt-devel/attachments/20230403/cd5859b4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0aW07JZqU4dNOv5z.png
Type: image/png
Size: 5256 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gcrypt-devel/attachments/20230403/cd5859b4/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: XhbY9a0ASjTIxu1R.png
Type: image/png
Size: 4906 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gcrypt-devel/attachments/20230403/cd5859b4/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4764 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.gnupg.org/pipermail/gcrypt-devel/attachments/20230403/cd5859b4/attachment-0001.bin>


More information about the Gcrypt-devel mailing list