linux/include/crypto/internal
Nicolai Stange 1038fd78a1 crypto: kpp - provide support for KPP template instances
The upcoming support for the RFC 7919 ffdhe group parameters will be
made available in the form of templates like "ffdhe2048(dh)",
"ffdhe3072(dh)" and so on. Template instantiations thereof would wrap the
inner "dh" kpp_alg and also provide kpp_alg services to the outside again.
Furthermore, it might be perhaps be desirable to provide KDF templates in
the future, which would similarly wrap an inner kpp_alg and present
themselves to the outside as another kpp_alg, transforming the shared
secret on its way out.

Introduce the bits needed for supporting KPP template instances. Everything
related to inner kpp_alg spawns potentially being held by such template
instances will be deferred to a subsequent patch in order to facilitate
review.

Define struct struct kpp_instance in close analogy to the already existing
skcipher_instance, shash_instance and alike, but wrapping a struct kpp_alg.
Implement the new kpp_register_instance() template instance registration
primitive. Provide some helper functions for
- going back and forth between a generic struct crypto_instance and the new
  struct kpp_instance,
- obtaining the instantiating kpp_instance from a crypto_kpp transform and
- for accessing a given kpp_instance's implementation specific context
  data.

Annotate everything with proper kernel-doc comments, even though
include/crypto/internal/kpp.h is not considered for the generated docs.

Signed-off-by: Nicolai Stange <nstange@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2022-03-03 10:47:49 +12:00
..
acompress.h mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
aead.h crypto: aead - pass instance to crypto_grab_aead() 2020-01-09 11:30:54 +08:00
akcipher.h crypto: akcipher - pass instance to crypto_grab_akcipher() 2020-01-09 11:30:54 +08:00
blake2b.h crypto: blake2b - sync with blake2s implementation 2021-01-03 08:41:39 +11:00
blake2s.h lib/crypto: blake2s: include as built-in 2022-01-07 00:25:25 +01:00
chacha.h crypto: chacha - fix warning message in header file 2019-12-11 16:48:38 +08:00
cipher.h crypto: remove cipher routines from public crypto API 2021-01-03 08:41:35 +11:00
cryptouser.h crypto: user - fix potential warnings in cryptouser.h 2019-08-02 14:44:31 +10:00
des.h crypto: remove CRYPTO_TFM_RES_WEAK_KEY 2020-01-09 11:30:53 +08:00
ecc.h crypto: ecc - Export additional helper functions 2021-10-29 21:04:03 +08:00
geniv.h crypto: geniv - remove unneeded arguments from aead_geniv_alloc() 2020-07-16 21:49:07 +10:00
hash.h crypto: shash - avoid comparing pointers to exported functions under CFI 2021-06-17 15:07:31 +08:00
kdf_selftest.h crypto: kdf - Add key derivation self-test support code 2021-11-26 16:25:17 +11:00
kpp.h crypto: kpp - provide support for KPP template instances 2022-03-03 10:47:49 +12:00
poly1305.h crypto: poly1305 - fix poly1305_core_setkey() declaration 2021-04-02 18:28:12 +11:00
rng.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
rsa.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
scompress.h crypto: algapi - make unregistration functions return void 2019-12-20 14:58:35 +08:00
simd.h crypto: simd,testmgr - introduce crypto_simd_usable() 2019-03-22 20:57:27 +08:00
skcipher.h crypto: x86 - remove glue helper module 2021-01-14 17:10:29 +11:00