History log of /linux-master/include/crypto/internal/aead.h
Revision Date Author Comments
# 372e6b80 31-Jan-2023 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Use crypto_request_complete

Use the crypto_request_complete helper instead of calling the
completion function directly.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# f8e4d1d0 24-Nov-2022 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Add ctx helpers with DMA alignment

This patch adds helpers to access the aead context structure and
request context structure with an added alignment for DMA access.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# d126edd7 23-Sep-2022 Gaosheng Cui <cuigaosheng1@huawei.com>

crypto: aead - Remove unused inline functions from aead

The aead_enqueue_request, aead_dequeue_request and aead_get_backlog
are no longer used since commit 04a4616e6a21 ("crypto: omap-aes-gcm
- convert to use crypto engine"), their functinoality has been
replaced by crypto engine, so remove them.

Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# cd900f0c 02-Jan-2020 Eric Biggers <ebiggers@google.com>

crypto: aead - pass instance to crypto_grab_aead()

Initializing a crypto_aead_spawn currently requires:

1. Set spawn->base.inst to point to the instance.
2. Call crypto_grab_aead().

But there's no reason for these steps to be separate, and in fact this
unneeded complication has caused at least one bug, the one fixed by
commit 6db43410179b ("crypto: adiantum - initialize crypto_spawn::inst")

So just make crypto_grab_aead() take the instance as an argument.

To keep the function calls from getting too unwieldy due to this extra
argument, also introduce a 'mask' variable into the affected places
which weren't already using one.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 095be695 01-Dec-2019 Eric Biggers <ebiggers@google.com>

crypto: aead - move crypto_aead_maxauthsize() to <crypto/aead.h>

Move crypto_aead_maxauthsize() to <crypto/aead.h> so that it's available
to users of the API, not just AEAD implementations.

This will be used by the self-tests.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 2874c5fd 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 3029 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7a530aa9 11-Jul-2016 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Add chunk size

This patch adds a chunk size parameter to aead algorithms, just
like the chunk size for skcipher algorithms.

However, unlike skcipher we do not currently export this to AEAD
users. It is only meant to be used by AEAD implementors for now.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 53a0bd71 01-Feb-2016 Tadeusz Struk <tadeusz.struk@intel.com>

crypto: aead - move aead_request_cast helper to aead.h

Move the helper function to common header for everybody to use.

changes in v2:
- move the helper to crypto/internal/aead.h
instead of crypto/aead.h

Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# b0d955ba 14-Aug-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Remove old AEAD interfaces

Now that the AEAD conversion is complete we can rip out the old
AEAD interafce and associated code.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 149a3971 13-Aug-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Add type-safe geniv init/exit helpers

This patch adds the helpers aead_init_geniv and aead_exit_geniv
which are type-safe and intended the replace the existing geniv
init/exit helpers.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# ba75e15f 08-Jul-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Add type-safe function for freeing instances

This patch adds a type-safe function for freeing AEAD instances
to struct aead_instance. This replaces the existing free function
in struct crypto_template which does not know the type of the
instance that it's freeing.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 2c11a3f9 07-Jul-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Add aead_queue interface

This patch adds a type-safe queueing interface for AEAD.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# f5d8660a 18-Jun-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Fix aead_instance struct size

The struct aead_instance is meant to extend struct crypto_instance
by incorporating the extra members of struct aead_alg. However,
the current layout which is copied from shash/ahash does not specify
the struct fully. In particular only aead_alg is present.

For shash/ahash this works because users there add extra headroom
to sizeof(struct crypto_instance) when allocating the instance.
Unfortunately for aead, this bit was lost when the new aead_instance
was added.

Rather than fixing it like shash/ahash, this patch simply expands
struct aead_instance to contain what is supposed to be there, i.e.,
adding struct crypto_instance.

In order to not break existing AEAD users, this is done through an
anonymous union.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# caab9461 28-May-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Add multiple algorithm registration interface

This patch adds the helpers that allow the registration and removal
of multiple algorithms.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 43615369 28-May-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Ignore return value from crypto_unregister_alg

No new code should be using the return value of crypto_unregister_alg
as it will become void soon.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 5c98d620 28-May-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Add aead_alg_instance

Now that type-safe init/exit functions exist, they often need
to access the underlying aead_instance. So this patch adds the
helper aead_alg_instance to access aead_instance from a crypto_aead
object.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 30e4c010 22-May-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Add crypto_aead_alg_ivsize/maxauthsize

AEAD algorithm implementors need to figure out a given algorithm's
IV size and maximum authentication size. During the transition
this is difficult to do as an algorithm could be new style or old
style.

This patch creates two helpers to make this easier.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 856e3f40 21-May-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: seqiv - Add support for new AEAD interface

This patch converts the seqiv IV generator to work with the new
AEAD interface where IV generators are just normal AEAD algorithms.

Full backwards compatibility is paramount at this point since
no users have yet switched over to the new interface. Nor can
they switch to the new interface until IV generation is fully
supported by it.

So this means we are adding two versions of seqiv alongside the
existing one. The first one is the one that will be used when
the underlying AEAD algorithm has switched over to the new AEAD
interface. The second one handles the current case where the
underlying AEAD algorithm still uses the old interface.

Both versions export themselves through the new AEAD interface.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 63293c61 21-May-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Add support for new AEAD implementations

This patch adds the basic structure of the new AEAD type. Unlike
the current version, there is no longer any concept of geniv. IV
generation will still be carried out by wrappers but they will be
normal AEAD algorithms that simply take the IPsec sequence number
as the IV.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# f5695259 21-May-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Add crypto_aead_maxauthsize

This patch adds the helper crypto_aead_maxauthsize to remove the
need to directly dereference aead_alg internals by AEAD implementors.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 2d0f230f 21-May-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Rename aead_alg to old_aead_alg

This patch is the first step in the introduction of a new AEAD
alg type. Unlike normal conversions this patch only renames the
existing aead_alg structure because there are external references
to it.

Those references will be removed after this patch.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 5d1d65f8 11-May-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Convert top level interface to new style

This patch converts the top-level aead interface to the new style.
All user-level AEAD interface code have been moved into crypto/aead.h.

The allocation/free functions have switched over to the new way of
allocating tfms.

This patch also removes the double indrection on setkey so the
indirection now exists only at the alg level.

Apart from these there are no user-visible changes.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 21b70134 11-May-2015 Herbert Xu <herbert@gondor.apana.org.au>

crypto: aead - Add crypto_aead_set_reqsize helper

This patch adds the helper crypto_aead_set_reqsize so that people
don't have to directly access the aead internals to set the reqsize.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 1e122994 29-Mar-2012 Steffen Klassert <steffen.klassert@secunet.com>

crypto: user - Fix lookup of algorithms with IV generator

We lookup algorithms with crypto_alg_mod_lookup() when instantiating via
crypto_add_alg(). However, algorithms that are wrapped by an IV genearator
(e.g. aead or genicv type algorithms) need special care. The userspace
process hangs until it gets a timeout when we use crypto_alg_mod_lookup()
to lookup these algorithms. So export the lookup functions for these
algorithms and use them in crypto_add_alg().

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# d29ce988 12-Dec-2007 Herbert Xu <herbert@gondor.apana.org.au>

[CRYPTO] aead: Create default givcipher instances

This patch makes crypto_alloc_aead always return algorithms that is
capable of generating their own IVs through givencrypt and givdecrypt.
All existing AEAD algorithms already do. New ones must either supply
their own or specify a generic IV generator with the geniv field.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


# 5b6d2d7f 12-Dec-2007 Herbert Xu <herbert@gondor.apana.org.au>

[CRYPTO] aead: Add aead_geniv_alloc/aead_geniv_free

This patch creates the infrastructure to help the construction of IV
generator templates that wrap around AEAD algorithms by adding an IV
generator to them. This is useful for AEAD algorithms with no built-in
IV generator or to replace their built-in generator.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>