• Nicolai Stange's avatar
    crypto: kpp - provide support for KPP spawns · 46ed5269
    Nicolai Stange authored
    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.
    
    The primitves needed for providing kpp_alg services from template instances
    have been introduced with the previous patch. Continue this work now and
    implement everything needed for enabling template instances to make use
    of inner KPP algorithms like "dh".
    
    More specifically, define a struct crypto_kpp_spawn in close analogy to
    crypto_skcipher_spawn, crypto_shash_spawn and alike. Implement a
    crypto_grab_kpp() and crypto_drop_kpp() pair for binding such a spawn to
    some inner kpp_alg and for releasing it respectively. Template
    implementations can instantiate transforms from the underlying kpp_alg by
    means of the new crypto_spawn_kpp(). Finally, provide the
    crypto_spawn_kpp_alg() helper for accessing a spawn's underlying kpp_alg
    during template instantiation.
    
    Annotate everything with proper kernel-doc comments, even though
    include/crypto/internal/kpp.h is not considered for the generated docs.
    Signed-off-by: default avatarNicolai Stange <nstange@suse.de>
    Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    46ed5269
kpp.c 3.41 KB