#
2c985943 |
| 03-Oct-2023 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: skcipher - Remove obsolete skcipher_alg helpers
As skcipher spawn users can no longer assume the spawn is of type struct skcipher_alg, these helpers are no longer used. Remove them.
Signed
crypto: skcipher - Remove obsolete skcipher_alg helpers
As skcipher spawn users can no longer assume the spawn is of type struct skcipher_alg, these helpers are no longer used. Remove them.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
ab6223dc |
| 03-Oct-2023 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: skcipher - Add crypto_spawn_skcipher_alg_common
As skcipher spawns can be of two different types (skcipher vs. lskcipher), only the common fields can be accessed. Add a helper to return the
crypto: skcipher - Add crypto_spawn_skcipher_alg_common
As skcipher spawns can be of two different types (skcipher vs. lskcipher), only the common fields can be accessed. Add a helper to return the common algorithm object.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
31865c4c |
| 14-Sep-2023 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: skcipher - Add lskcipher
Add a new API type lskcipher designed for taking straight kernel pointers instead of SG lists. Its relationship to skcipher will be analogous to that between shash
crypto: skcipher - Add lskcipher
Add a new API type lskcipher designed for taking straight kernel pointers instead of SG lists. Its relationship to skcipher will be analogous to that between shash and ahash.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
d5770679 |
| 31-Jan-2023 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: skcipher - 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>
|
#
12658ac5 |
| 25-Nov-2022 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: skcipher - Add ctx helpers with DMA alignment
This patch adds helpers to access the skcipher context structure and request context structure with an added alignment for DMA access.
Signed-o
crypto: skcipher - Add ctx helpers with DMA alignment
This patch adds helpers to access the skcipher context structure and request context structure with an added alignment for DMA access.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
e6cb02bd |
| 11-Nov-2022 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: skcipher - Allow sync algorithms with large request contexts
Some sync algorithms may require a large amount of temporary space during its operations. There is no reason why they should be
crypto: skcipher - Allow sync algorithms with large request contexts
Some sync algorithms may require a large amount of temporary space during its operations. There is no reason why they should be limited just because some legacy users want to place all temporary data on the stack.
Such algorithms can now set a flag to indicate that they need extra request context, which will cause them to be invisible to users that go through the sync_skcipher interface.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
64ca771c |
| 05-Jan-2021 |
Ard Biesheuvel <ardb@kernel.org> |
crypto: x86 - remove glue helper module
All dependencies on the x86 glue helper module have been replaced by local instantiations of the new ECB/CBC preprocessor helper macros, so the glue helper mo
crypto: x86 - remove glue helper module
All dependencies on the x86 glue helper module have been replaced by local instantiations of the new ECB/CBC preprocessor helper macros, so the glue helper module can be retired.
Acked-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
0eb76ba2 |
| 11-Dec-2020 |
Ard Biesheuvel <ardb@kernel.org> |
crypto: remove cipher routines from public crypto API
The cipher routines in the crypto API are mostly intended for templates implementing skcipher modes generically in software, and shouldn't be us
crypto: remove cipher routines from public crypto API
The cipher routines in the crypto API are mostly intended for templates implementing skcipher modes generically in software, and shouldn't be used outside of the crypto subsystem. So move the prototypes and all related definitions to a new header file under include/crypto/internal. Also, let's use the new module namespace feature to move the symbol exports into a new namespace CRYPTO_INTERNAL.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
aacd5b4c |
| 03-Jan-2020 |
Eric Biggers <ebiggers@google.com> |
crypto: skcipher - use crypto_grab_cipher() and simplify error paths
Make skcipher_alloc_instance_simple() use the new function crypto_grab_cipher() to initialize its cipher spawn.
This is needed t
crypto: skcipher - use crypto_grab_cipher() and simplify error paths
Make skcipher_alloc_instance_simple() use the new function crypto_grab_cipher() to initialize its cipher spawn.
This is needed to make all spawns be initialized in a consistent way.
Also simplify the error handling by taking advantage of crypto_drop_*() now accepting (as a no-op) spawns that haven't been initialized yet, and by taking advantage of crypto_grab_*() now handling ERR_PTR() names.
Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
b9f76ddd |
| 03-Jan-2020 |
Eric Biggers <ebiggers@google.com> |
crypto: skcipher - pass instance to crypto_grab_skcipher()
Initializing a crypto_skcipher_spawn currently requires:
1. Set spawn->base.inst to point to the instance. 2. Call crypto_grab_skcipher().
crypto: skcipher - pass instance to crypto_grab_skcipher()
Initializing a crypto_skcipher_spawn currently requires:
1. Set spawn->base.inst to point to the instance. 2. Call crypto_grab_skcipher().
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_skcipher() 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>
show more ...
|
#
70ffa8fd |
| 30-Dec-2019 |
Eric Biggers <ebiggers@google.com> |
crypto: skcipher - remove skcipher_walk_aead()
skcipher_walk_aead() is unused and is identical to skcipher_walk_aead_encrypt(), so remove it.
Signed-off-by: Eric Biggers <ebiggers@google.com> Signe
crypto: skcipher - remove skcipher_walk_aead()
skcipher_walk_aead() is unused and is identical to skcipher_walk_aead_encrypt(), so remove it.
Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
b3c16bfc |
| 20-Dec-2019 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: skcipher - Add skcipher_ialg_simple helper
This patch introduces the skcipher_ialg_simple helper which fetches the crypto_alg structure from a simple skcipher instance's spawn.
This allows
crypto: skcipher - Add skcipher_ialg_simple helper
This patch introduces the skcipher_ialg_simple helper which fetches the crypto_alg structure from a simple skcipher instance's spawn.
This allows us to remove the third argument from the function skcipher_alloc_instance_simple.
In doing so the reference count to the algorithm is now maintained by the Crypto API and the caller no longer needs to drop the alg refcount.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
d63007eb |
| 09-Nov-2019 |
Ard Biesheuvel <ardb@kernel.org> |
crypto: ablkcipher - remove deprecated and unused ablkcipher support
Now that all users of the deprecated ablkcipher interface have been moved to the skcipher interface, ablkcipher is no longer used
crypto: ablkcipher - remove deprecated and unused ablkcipher support
Now that all users of the deprecated ablkcipher interface have been moved to the skcipher interface, ablkcipher is no longer used and can be removed.
Reviewed-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
c65058b7 |
| 25-Oct-2019 |
Eric Biggers <ebiggers@google.com> |
crypto: skcipher - remove the "blkcipher" algorithm type
Now that all "blkcipher" algorithms have been converted to "skcipher", remove the blkcipher algorithm type.
The skcipher (symmetric key ciph
crypto: skcipher - remove the "blkcipher" algorithm type
Now that all "blkcipher" algorithms have been converted to "skcipher", remove the blkcipher algorithm type.
The skcipher (symmetric key cipher) algorithm type was introduced a few years ago to replace both blkcipher and ablkcipher (synchronous and asynchronous block cipher). The advantages of skcipher include:
- A much less confusing name, since none of these algorithm types have ever actually been for raw block ciphers, but rather for all length-preserving encryption modes including block cipher modes of operation, stream ciphers, and other length-preserving modes.
- It unified blkcipher and ablkcipher into a single algorithm type which supports both synchronous and asynchronous implementations. Note, blkcipher already operated only on scatterlists, so the fact that skcipher does too isn't a regression in functionality.
- Better type safety by using struct skcipher_alg, struct crypto_skcipher, etc. instead of crypto_alg, crypto_tfm, etc.
- It sometimes simplifies the implementations of algorithms.
Also, the blkcipher API was no longer being tested.
Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
5b0fe955 |
| 10-Sep-2019 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: algif_skcipher - Use chunksize instead of blocksize
When algif_skcipher does a partial operation it always process data that is a multiple of blocksize. However, for algorithms such as CTR
crypto: algif_skcipher - Use chunksize instead of blocksize
When algif_skcipher does a partial operation it always process data that is a multiple of blocksize. However, for algorithms such as CTR this is wrong because even though it can process any number of bytes overall, the partial block must come at the very end and not in the middle.
This is exactly what chunksize is meant to describe so this patch changes blocksize to chunksize.
Fixes: 8ff590903d5f ("crypto: algif_skcipher - User-space...") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
6017826b |
| 03-Sep-2019 |
Ard Biesheuvel <ard.biesheuvel@linaro.org> |
crypto: skcipher - add the ability to abort a skcipher walk
After starting a skcipher walk, the only way to ensure that all resources it has tied up are released is to complete it. In some cases, it
crypto: skcipher - add the ability to abort a skcipher walk
After starting a skcipher walk, the only way to ensure that all resources it has tied up are released is to complete it. In some cases, it will be useful to be able to abort a walk cleanly after it has started, so add this ability to the skcipher walk API.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
314d0f0e |
| 03-Jun-2019 |
Eric Biggers <ebiggers@google.com> |
crypto: skcipher - make chunksize and walksize accessors internal
The 'chunksize' and 'walksize' properties of skcipher algorithms are implementation details that users of the skcipher API should no
crypto: skcipher - make chunksize and walksize accessors internal
The 'chunksize' and 'walksize' properties of skcipher algorithms are implementation details that users of the skcipher API should not be looking at. So move their accessor functions from <crypto/skcipher.h> to <crypto/internal/skcipher.h>.
Signed-off-by: Eric Biggers <ebiggers@google.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
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 th
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>
show more ...
|
#
0872da16 |
| 04-Jan-2019 |
Eric Biggers <ebiggers@google.com> |
crypto: skcipher - add helper for simple block cipher modes
The majority of skcipher templates (including both the existing ones and the ones remaining to be converted from the "blkcipher" API) just
crypto: skcipher - add helper for simple block cipher modes
The majority of skcipher templates (including both the existing ones and the ones remaining to be converted from the "blkcipher" API) just wrap a single block cipher algorithm. This includes cbc, cfb, ctr, ecb, kw, ofb, and pcbc. Add a helper function skcipher_alloc_instance_simple() that handles allocating an skcipher instance for this common case.
Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
c79b411e |
| 16-Dec-2018 |
Eric Biggers <ebiggers@google.com> |
crypto: skcipher - remove remnants of internal IV generators
Remove dead code related to internal IV generators, which are no longer used since they've been replaced with the "seqiv" and "echainiv"
crypto: skcipher - remove remnants of internal IV generators
Remove dead code related to internal IV generators, which are no longer used since they've been replaced with the "seqiv" and "echainiv" templates. The removed code includes:
- The "givcipher" (GIVCIPHER) algorithm type. No algorithms are registered with this type anymore, so it's unneeded.
- The "const char *geniv" member of aead_alg, ablkcipher_alg, and blkcipher_alg. A few algorithms still set this, but it isn't used anymore except to show via /proc/crypto and CRYPTO_MSG_GETALG. Just hardcode "<default>" or "<none>" in those cases.
- The 'skcipher_givcrypt_request' structure, which is never used.
Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
c821f6ab |
| 29-Dec-2016 |
Ard Biesheuvel <ard.biesheuvel@linaro.org> |
crypto: skcipher - introduce walksize attribute for SIMD algos
In some cases, SIMD algorithms can only perform optimally when allowed to operate on multiple input blocks in parallel. This is especia
crypto: skcipher - introduce walksize attribute for SIMD algos
In some cases, SIMD algorithms can only perform optimally when allowed to operate on multiple input blocks in parallel. This is especially true for bit slicing algorithms, which typically take the same amount of time processing a single block or 8 blocks in parallel. However, other SIMD algorithms may benefit as well from bigger strides.
So add a walksize attribute to the skcipher algorithm definition, and wire it up to the skcipher walk API. To avoid confusion between the skcipher and AEAD attributes, rename the skcipher_walk chunksize attribute to 'stride', and set it from the walksize (in the skcipher case) or from the chunksize (in the AEAD case).
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
34bc085c |
| 30-Nov-2016 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: skcipher - Add separate walker for AEAD decryption
The AEAD decrypt interface includes the authentication tag in req->cryptlen. Therefore we need to exlucde that when doing a walk over it.
crypto: skcipher - Add separate walker for AEAD decryption
The AEAD decrypt interface includes the authentication tag in req->cryptlen. Therefore we need to exlucde that when doing a walk over it.
This patch adds separate walker functions for AEAD encryption and decryption.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
show more ...
|
#
b286d8b1 |
| 22-Nov-2016 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: skcipher - Add skcipher walk interface
This patch adds the skcipher walk interface which replaces both blkcipher walk and ablkcipher walk. Just like blkcipher walk it can also be used for A
crypto: skcipher - Add skcipher walk interface
This patch adds the skcipher walk interface which replaces both blkcipher walk and ablkcipher walk. Just like blkcipher walk it can also be used for AEAD algorithms.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
60425a8b |
| 28-Oct-2016 |
Eric Biggers <ebiggers@google.com> |
crypto: skcipher - Get rid of crypto_spawn_skcipher2()
Since commit 3a01d0ee2b99 ("crypto: skcipher - Remove top-level givcipher interface"), crypto_spawn_skcipher2() and crypto_spawn_skcipher() are
crypto: skcipher - Get rid of crypto_spawn_skcipher2()
Since commit 3a01d0ee2b99 ("crypto: skcipher - Remove top-level givcipher interface"), crypto_spawn_skcipher2() and crypto_spawn_skcipher() are equivalent. So switch callers of crypto_spawn_skcipher2() to crypto_spawn_skcipher() and remove it.
Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
#
a35528ec |
| 28-Oct-2016 |
Eric Biggers <ebiggers@google.com> |
crypto: skcipher - Get rid of crypto_grab_skcipher2()
Since commit 3a01d0ee2b99 ("crypto: skcipher - Remove top-level givcipher interface"), crypto_grab_skcipher2() and crypto_grab_skcipher() are eq
crypto: skcipher - Get rid of crypto_grab_skcipher2()
Since commit 3a01d0ee2b99 ("crypto: skcipher - Remove top-level givcipher interface"), crypto_grab_skcipher2() and crypto_grab_skcipher() are equivalent. So switch callers of crypto_grab_skcipher2() to crypto_grab_skcipher() and remove it.
Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|