From: Iuliana Prodan
Remove CRYPTO_ALG_ALLOCATES_MEMORY flag and allocate the memory
needed by the driver, to fulfil a request, within the crypto
request object.
The extra size needed for base extended descriptor, hw
descriptor commands and link tables is computed in frontend
driver (caamalg_qi2
From: Iuliana Prodan
Remove CRYPTO_ALG_ALLOCATES_MEMORY flag and allocate the memory
needed by the driver, to fulfil a request, within the crypto
request object.
The extra size needed for base extended descriptor, hw
descriptor commands and link tables is computed in frontend
driver (caamalg_qi
From: Iuliana Prodan
Remove CRYPTO_ALG_ALLOCATES_MEMORY flag and allocate the memory
needed by the driver, to fulfil a request, within the crypto
request object.
The extra size needed for base extended descriptor and link tables
is computed in frontend driver (caamhash) initialization and saved
From: Iuliana Prodan
Remove CRYPTO_ALG_ALLOCATES_MEMORY flag and allocate the memory
needed by the driver, to fulfil a request, within the crypto
request object.
The extra size needed for base extended descriptor, hw
descriptor commands and link tables is computed in frontend
driver (caamalg
From: Iuliana Prodan
Remove CRYPTO_ALG_ALLOCATES_MEMORY flag and allocate the memory
needed by the driver, to fulfil a request, within the crypto
request object.
The extra size needed for base extended descriptor and hw
descriptor commands, link tables, IV is computed in frontend
driver (caamalg
From: Iuliana Prodan
This series removes CRYPTO_ALG_ALLOCATES_MEMORY flag and
allocates the memory needed by the driver, to fulfil a
request, within the crypto request object.
The extra size needed for base extended descriptor, hw
descriptor commands and link tables is added to the reqsize
field
On 11/26/2020 7:12 PM, Ard Biesheuvel wrote:
On Thu, 26 Nov 2020 at 17:00, Iuliana Prodan wrote:
On 11/26/2020 9:09 AM, Ard Biesheuvel wrote:
On Wed, 25 Nov 2020 at 22:39, Iuliana Prodan wrote:
On 11/25/2020 11:16 PM, Ard Biesheuvel wrote:
On Wed, 25 Nov 2020 at 22:14, Iuliana Prodan
On 11/26/2020 9:09 AM, Ard Biesheuvel wrote:
On Wed, 25 Nov 2020 at 22:39, Iuliana Prodan wrote:
On 11/25/2020 11:16 PM, Ard Biesheuvel wrote:
On Wed, 25 Nov 2020 at 22:14, Iuliana Prodan (OSS)
wrote:
From: Iuliana Prodan
Add the option to allocate the crypto request object plus any
On 11/25/2020 11:16 PM, Ard Biesheuvel wrote:
On Wed, 25 Nov 2020 at 22:14, Iuliana Prodan (OSS)
wrote:
From: Iuliana Prodan
Add the option to allocate the crypto request object plus any extra space
needed by the driver into a DMA-able memory.
Add CRYPTO_TFM_REQ_DMA flag to be used by
From: Iuliana Prodan
Remove CRYPTO_ALG_ALLOCATES_MEMORY flag and allocate the memory
needed by the driver, to fulfil a request, within the crypto
request object.
The extra size needed for base extended descriptor, hw
descriptor commands and link tables is computed in frontend
driver (caamalg
From: Iuliana Prodan
Remove CRYPTO_ALG_ALLOCATES_MEMORY flag and allocate the memory
needed by the driver, to fulfil a request, within the crypto
request object.
The extra size needed for base extended descriptor and hw
descriptor commands, link tables, IV is computed in frontend
driver (caamalg
From: Iuliana Prodan
Some crypto backends might require the requests' private contexts
to be allocated in DMA-able memory.
Signed-off-by: Horia Geanta
---
net/ipv4/esp4.c | 7 ++-
net/ipv6/esp6.c | 7 ++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/e
From: Iuliana Prodan
The CRYPTO_TFM_REQ_DMA flag can be used by backend implementations to
indicate to crypto API the need to allocate GFP_DMA memory
for private contexts of the crypto requests.
For public key encryption add the needed functions to
set/get/clear flags.
Signed-off-by: Horia
From: Iuliana Prodan
Add the option to allocate the crypto request object plus any extra space
needed by the driver into a DMA-able memory.
Add CRYPTO_TFM_REQ_DMA flag to be used by backend implementations to
indicate to crypto API the need to allocate GFP_DMA memory
for private contexts of the
Hi Herbert,
On 7/22/2020 10:29 AM, Herbert Xu wrote:
On Fri, Jul 17, 2020 at 05:42:43PM +0300, Horia Geantă wrote:
Looks like there's no mention of a limit on src, dst scatterlists size
that crypto implementations could use when pre-allocating memory
and crypto users needing CRYPTO_ALG_ALLOC
han 8B
IV")
Signed-off-by: Horia Geantă
Reviewed-by: Iuliana Prodan
---
drivers/crypto/caam/caamalg.c | 4 ++--
drivers/crypto/caam/caamalg_qi.c | 4 ++--
drivers/crypto/caam/caamalg_qi2.c | 3 ++-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/crypto/caam/ca
-engine).
The callback for do_batch_requests is NULL, since CAAM
doesn't support linked requests.
Signed-off-by: Iuliana Prodan
---
Changes since v1:
- add comment for THRESHOLD define;
- update max size for crypto-engine queue.
drivers/crypto/caam/intern.h | 8
drivers/crypto/caam
On 10/26/2020 5:36 PM, Horia Geantă wrote:
On 10/21/2020 11:07 PM, Iuliana Prodan wrote:
Use the new crypto_engine_alloc_init_and_set() function to
initialize crypto-engine and enable retry mechanism.
Set the maximum size for crypto-engine software queue based on
Job Ring size (JOBR_DEPTH) and
-engine).
The callback for do_batch_requests is NULL, since CAAM
doesn't support linked requests.
Signed-off-by: Iuliana Prodan
---
drivers/crypto/caam/intern.h | 3 +++
drivers/crypto/caam/jr.c | 6 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/caam/int
e: 'struct caam_hash_ctx'
drivers/crypto/caam/ctrl.c:449: warning: Function parameter or member 'ctrl'
not described in 'caam_get_era'
Signed-off-by: Krzysztof Kozlowski
Reviewed-by: Iuliana Prodan
---
Changes since v1:
1. Fix more warnings
---
drivers/crypto/caa
On 9/2/2020 6:05 PM, Krzysztof Kozlowski wrote:
Fix kerneldoc warnings:
drivers/crypto/caam/caamalg_qi2.c:73: warning: cannot understand function
prototype: 'struct caam_ctx '
drivers/crypto/caam/caamalg_qi2.c:2962: warning: cannot understand function
prototype: 'struct caam_hash_ctx '
On 9/2/2020 6:05 PM, Krzysztof Kozlowski wrote:
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and the error value gets printed.
Signed-off-by: Krzysztof Kozlowski
Reviewed-by: Iuliana Prodan
---
drivers/crypto/caam/caamalg_qi2.c | 3 +--
1
On 8/31/2020 10:58 AM, Andy Shevchenko wrote:
Use traditional error check pattern
ret = ...;
if (ret)
return ret;
...
instead of checking error code to be 0.
Signed-off-by: Andy Shevchenko
Reviewed-by: Iuliana Prodan
---
drivers/crypto/caam
, e.g. using dmsetup:
dmsetup -v create encrypted --table "0 $(blockdev --getsz /dev/mmcblk2p10)
crypt capi:tk(cbc(aes))-plain :32:logon:seckey 0 /dev/mmcblk2p10 0 1
sector_size:512".
Signed-off-by: Franck LENORMAND
Signed-off-by: Iuliana Prodan
---
drivers/cr
ations will know how to handle tagged keys, by loading the
proper settings for KEY command.
Iuliana Prodan (2):
crypto: caam - add tag object functionality
crypto: caam - support tagged keys for skcipher algorithms
drivers/crypto/caam/Kconfig| 9 +++
drivers/crypto/caam/Makefile
configuration or tag object data.
This API expects that the object (the actual data) from a tag object
to be a buffer (defined by address and size).
Signed-off-by: Franck LENORMAND
Signed-off-by: Iuliana Prodan
---
drivers/crypto/caam/Kconfig | 9 +++
drivers/crypto/caam/Makefile
On 6/12/2020 9:00 AM, Herbert Xu wrote:
The function handle_imx6_err005766 needs to take an __iomem argument
as otherwise sparse will generate two warnings.
Fixes: 33d69455e402 ("crypto: caam - limit AXI pipeline to a...")
Signed-off-by: Herbert Xu
Reviewed-by: Iuliana Proda
st be pass back and forth between
crypto-engine and hardware.
Fixes: 6a89f492f8e5 ("crypto: engine - support for parallel requests based on
retry mechanism")
Signed-off-by: Iuliana Prodan
---
crypto/crypto_engine.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff
o-engine is used).
- added a new patch with support for batch requests.
Changes since V0 (RFC):
- removed max_no_req and no_req, as the number of request that can be
processed in parallel;
- added a new callback, can_enqueue_more, to check whether the hardware
can process a new request.
Iulian
multiple request.
Signed-off-by: Iuliana Prodan
---
crypto/crypto_engine.c | 27 ++-
include/crypto/engine.h | 5 +
2 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/crypto/crypto_engine.c b/crypto/crypto_engine.c
index ee19273..412149e 100644
--- a
e freed, since it will be enqueued back
into crypto-engine's queue.
When all drivers, that use crypto-engine now, will be updated for
retry mechanism, the retry_support variable can be removed.
Signed-off-by: Iuliana Prodan
---
crypto/crypto_engine.c | 146 +++
Add crypto_enqueue_request_head function that enqueues a
request in front of queue.
This will be used in crypto-engine, on error path. In case a request
was not executed by hardware, enqueue it back in front of queue (to
keep the order of requests).
Signed-off-by: Iuliana Prodan
---
crypto
On 4/28/2020 8:14 AM, Zhenzhong Duan wrote:
> In both aead_crypt_done and skcipher_crypt_done, edesc->bklog is
> referenced after the structure pointed by edesc is freed.
>
> Fix them by moving kfree(edesc) to the end of function call.
>
> Signed-off-by: Zhenzhong Duan
These issues were already
The mapped_{src,dst}_nents _returned_ from the dma_map_sg
call (which could be less than src/dst_nents) have to be
used to generate the job descriptors.
Signed-off-by: Iuliana Prodan
---
Changes since v1:
- updated, with mapped_{src,dst}_nents, the set_rsa_pub_pdb,
set_rsa_priv_f{1,2,3}_pdb
On 9/26/2019 10:17 AM, Horia Geanta wrote:
> On 9/25/2019 4:04 PM, Iuliana Prodan wrote:
>> @@ -428,17 +433,18 @@ static int set_rsa_priv_f1_pdb(struct akcipher_request
>> *req,
>> return -ENOMEM;
>> }
>>
>> -if (edesc->src_nents
The mapped_{src,dst}_nents _returned_ from the dma_map_sg
call (which could be less than src/dst_nents) have to be
used to generate the job descriptors.
Signed-off-by: Iuliana Prodan
---
drivers/crypto/caam/caampkc.c | 54 ---
drivers/crypto/caam
On 8/30/2019 4:16 PM, Herbert Xu wrote:
> On Fri, Aug 30, 2019 at 09:15:12AM +0000, Iuliana Prodan wrote:
>>
>> Can you, please, add, also, the device tree patch ("arm64: dts: imx8mq:
>> Add CAAM node") in cryptodev tree?
>> Unfortunately Shawn Guo wasn
On 8/30/2019 11:23 AM, Herbert Xu wrote:
> Andrey Smirnov wrote:
>> Everyone:
>>
>> Picking up where Chris left off (I chatted with him privately
>> beforehead), this series adds support for i.MX8MQ to CAAM driver. Just
>> like [v1], this series is i.MX8MQ only.
>>
>> Feedback is welcome!
>> Thank
Thanks,
> Andrey Smirnov
>
For the series:
Reviewed-by: Iuliana Prodan
Thanks,
Iulia
Use print_hex_dump_debug function to print debug messages, instead of
print_hex_dump inside #ifdef DEBUG.
Fixes: 6e005503199b ("crypto: caam - print debug messages at debug level")
Signed-off-by: Iuliana Prodan
---
drivers/crypto/caam/caamalg_qi.c | 9 -
1 file changed, 4
uld be restricted to 16 or 20
bytes, as for rfc4106.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
Changes since v4:
- alignment.
---
crypto/gcm.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/crypto/gcm.c b/crypto/gcm.c
index 2f3b50f..7388420 100644
--
Check zero-length input, for skcipher algorithm, to solve the extra
tests. This is a valid operation, therefore the API will return no error.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caamalg.c | 6 ++
drivers/crypto/caam/caamalg_qi.c | 3
d.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caamhash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index ed1931f..8a07edb 100644
--- a/drivers/crypto/caam/caamhash.c
+++
Update share descriptor for rfc4106 to skip instructions in case
cryptlen is zero. If no instructions are jumped the DECO hangs and a
timeout error is thrown.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caamalg_desc.c | 47
From: Horia Geantă
skcipher encryption might fail and in some cases, like (invalid) input
length smaller then block size, updating the IV would lead to a useless
IV copy in case hardware issued an error.
Signed-off-by: Horia Geantă
Signed-off-by: Iuliana Prodan
---
drivers/crypto/caam
: Horia Geantă
Reviewed-by: Iuliana Prodan
---
drivers/crypto/caam/caamhash.c | 37 +
drivers/crypto/caam/caamhash_desc.c | 5 ++---
drivers/crypto/caam/caamhash_desc.h | 2 +-
drivers/crypto/caam/desc_constr.h | 10 --
4 files changed, 24
Note: in most error cases caam/qi and caam/qi2 returned -EIO; align all
caam drivers to return -EINVAL.
While here, ratelimit prints triggered by fuzz testing, such that
console is not flooded.
Signed-off-by: Horia Geantă
Signed-off-by: Iuliana Prodan
---
drivers/crypto/caam/caamalg.
aries")
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caampkc.c | 49 ++-
1 file changed, 30 insertions(+), 19 deletions(-)
diff --git a/drivers/crypto/caam/caampkc.c b/drivers/crypto/caam/caampkc.c
index e00a470..5b12
Check key length to solve the extra tests that expect -EINVAL to be
returned when the key size is not valid.
Validated AES keylen for skcipher, ahash and aead.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
Changes since v4:
- use, newly renamed, helper aes function, to validate
Check the return value of the hardware registration for caam_rng and free
resources in case of failure.
Fixes: e24f7c9e87d4 ("crypto: caam - hwrng support")
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caamrng.c | 5 -
1 file changed, 4 insert
e (|user key| > |derived key|) fails when DKP
is not available.
Make sure gen_split_key() dma maps max(|user key|, |derived key|),
since this is an in-place (bidirectional) operation.
Signed-off-by: Horia Geantă
Reviewed-by: Iuliana Prodan
---
drivers/crypto/caam/caa
rt top level drivers to libraries")
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caampkc.c | 11 +++
drivers/crypto/caam/caamrng.c | 14 +-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/caam/caampk
and dma key addresses
crypto: caam - fix MDHA key derivation for certain user key lengths
Iuliana Prodan (9):
crypto: caam - check key length
crypto: caam - check authsize
crypto: caam - check assoclen
crypto: caam - check zero-length input
crypto: caam - update rfc4106 sh desc to
, extended seq_no) and IV len. This can be 16 or 20
bytes.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caamalg.c | 10 ++
drivers/crypto/caam/caamalg_qi.c | 12
drivers/crypto/caam/caamalg_qi2.c | 10 ++
3 files changed, 8
Check authsize to solve the extra tests that expect -EINVAL to be
returned when the authentication tag size is not valid.
Validated authsize for GCM, RFC4106 and RFC4543.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caamalg.c | 13 +
drivers
ovides details about the cause of
failure
Cc: # v5.1+
Fixes: 67c2315def06 ("crypto: caam - add Queue Interface (QI) backend support")
Signed-off-by: Horia Geantă
Reviewed-by: Iuliana Prodan
---
drivers/crypto/caam/error.c | 1 +
drivers/crypto/caam/qi.c| 5 -
drivers/cryp
without crypto_ prefix;
- change include for gcm.h.
Iuliana Prodan (2):
crypto: gcm - helper functions for assoclen/authsize check
crypto: aes - helper function to validate key length for AES
algorithms
crypto/gcm.c | 41 ++-
include/crypto/aes.h
Add inline helper function to check key length for AES algorithms.
The key can be 128, 192 or 256 bits size.
This function is used in the generic aes implementation.
Signed-off-by: Iuliana Prodan
---
include/crypto/aes.h | 17 +
lib/crypto/aes.c | 8
2 files
Added inline helper functions to check authsize and assoclen for
gcm, rfc4106 and rfc4543.
These are used in the generic implementation of gcm, rfc4106 and
rfc4543.
Signed-off-by: Iuliana Prodan
---
crypto/gcm.c | 41 ++-
include/crypto/gcm.h | 55
On 7/31/2019 8:33 AM, Ard Biesheuvel wrote:
> On Tue, 30 Jul 2019 at 13:33, Iuliana Prodan wrote:
>>
>> Add inline helper function to check key length for AES algorithms.
>> The key can be 128, 192 or 256 bits size.
>> This function is used in the generic aes implemen
uld be restricted to 16 or 20
bytes, as for rfc4106.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
Changes since v3:
- use ternary operator for return.
Patch depends on series:
https://patchwork.kernel.org/project/linux-crypto/list/?series=152649
---
crypto/gcm.c | 6 --
1 f
On 7/30/2019 2:06 PM, Iuliana Prodan wrote:
> From: Horia Geantă
>
> Fuzz testing uncovered an issue when |user key| > |derived key|.
> Derived key generation has to be fixed in two cases:
>
> 1. Era >= 6 (DKP is available)
> DKP cannot be used with immediate input k
On 7/30/2019 2:06 PM, Iuliana Prodan wrote:
> From: Horia Geantă
>
> Update alginfo struct to keep both virtual and dma key addresses,
> so that descriptors have them at hand.
> One example where this is needed is in the xcbc(aes) shared descriptors,
> which are update
On 7/30/2019 2:06 PM, Iuliana Prodan wrote:
> From: Horia Geantă
>
> ERN handler calls the caam/qi frontend "done" callback with a status
> of -EIO. This is incorrect, since the callback expects a status value
> meaningful for the crypto engine - hence the cryptic mess
Check authsize to solve the extra tests that expect -EINVAL to be
returned when the authentication tag size is not valid.
Validated authsize for GCM, RFC4106 and RFC4543.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caamalg.c | 13 +
drivers
Check zero-length input, for skcipher algorithm, to solve the extra
tests. This is a valid operation, therefore the API will return no error.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caamalg.c | 6 ++
drivers/crypto/caam/caamalg_qi.c | 3
From: Horia Geantă
Fuzz testing uncovered an issue when |user key| > |derived key|.
Derived key generation has to be fixed in two cases:
1. Era >= 6 (DKP is available)
DKP cannot be used with immediate input key if |user key| > |derived key|,
since the resulting descriptor (after DKP execution)
Check the return value of the hardware registration for caam_rng and free
resources in case of failure.
Fixes: e24f7c9e87d4 ("crypto: caam - hwrng support")
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
Changes since v3:
- update Fixes tag with 12 characters o
d.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caamhash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index 2ce5a79..262be3a 100644
--- a/drivers/crypto/caam/caamhash.c
+++
Note: in most error cases caam/qi and caam/qi2 returned -EIO; align all
caam drivers to return -EINVAL.
While here, ratelimit prints triggered by fuzz testing, such that
console is not flooded.
Signed-off-by: Horia Geantă
Signed-off-by: Iuliana Prodan
---
drivers/crypto/caam/caamalg.
From: Horia Geantă
Update alginfo struct to keep both virtual and dma key addresses,
so that descriptors have them at hand.
One example where this is needed is in the xcbc(aes) shared descriptors,
which are updated in current patch.
Another example is the upcoming fix for DKP.
Signed-off-by: Hor
From: Horia Geantă
ERN handler calls the caam/qi frontend "done" callback with a status
of -EIO. This is incorrect, since the callback expects a status value
meaningful for the crypto engine - hence the cryptic messages
like the one below:
platform caam_qi: 15: unknown error source
Fix this by p
Update share descriptor for rfc4106 to skip instructions in case
cryptlen is zero. If no instructions are jumped the DECO hangs and a
timeout error is thrown.
Signed-off-by: Iuliana Prodan
---
Changes since v3:
- move the erratum workaround to reduce the chances of DECO stalling.
---
drivers
, extended seq_no) and IV len. This can be 16 or 20
bytes.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caamalg.c | 10 ++
drivers/crypto/caam/caamalg_qi.c | 12
drivers/crypto/caam/caamalg_qi2.c | 10 ++
3 files changed, 8
aries")
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caampkc.c | 49 ++-
1 file changed, 30 insertions(+), 19 deletions(-)
diff --git a/drivers/crypto/caam/caampkc.c b/drivers/crypto/caam/caampkc.c
index e00a470..5b12
: caam - update IV only when crypto operation succeeds
crypto: caam - keep both virtual and dma key addresses
crypto: caam - fix MDHA key derivation for certain user key lengths
Iuliana Prodan (9):
crypto: caam - check key length
crypto: caam - check authsize
crypto: caam - check assoclen
From: Horia Geantă
skcipher encryption might fail and in some cases, like (invalid) input
length smaller then block size, updating the IV would lead to a useless
IV copy in case hardware issued an error.
Signed-off-by: Horia Geantă
Signed-off-by: Iuliana Prodan
---
Changes since v3:
- update
Check key length to solve the extra tests that expect -EINVAL to be
returned when the key size is not valid.
Validated AES keylen for skcipher, ahash and aead.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/Kconfig | 2 +
drivers/crypto/caam/caamalg.c
rt top level drivers to libraries")
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caampkc.c | 11 +++
drivers/crypto/caam/caamrng.c | 14 +-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/caam/caampk
uld be restricted to 16 or 20
bytes, as for rfc4106.
Signed-off-by: Iuliana Prodan
---
Changes since v2:
- use, newly renamed, helper functions added in crypto API, in series:
https://patchwork.kernel.org/project/linux-crypto/list/?series=152649
crypto/gcm.c | 12
1 file changed,
crypto_ prefix;
- update aes after it was moved to lib/crypto.
Iuliana Prodan (2):
crypto: gcm - helper functions for assoclen/authsize check
crypto: aes - helper function to validate key length for AES
algorithms
crypto/gcm.c | 41 ++-
include
Add inline helper function to check key length for AES algorithms.
The key can be 128, 192 or 256 bits size.
This function is used in the generic aes implementation.
Signed-off-by: Iuliana Prodan
---
include/crypto/aes.h | 17 +
lib/crypto/aes.c | 8
2 files
Added inline helper functions to check authsize and assoclen for
gcm, rfc4106 and rfc4543.
These are used in the generic implementation of gcm, rfc4106 and
rfc4543.
Signed-off-by: Iuliana Prodan
---
crypto/gcm.c | 41 ++-
include/crypto/gcm.h | 55
, extended seq_no) and IV len. This can be 16 or 20
bytes.
Signed-off-by: Iuliana Prodan
---
drivers/crypto/caam/caamalg.c | 10 ++
drivers/crypto/caam/caamalg_qi.c | 10 ++
drivers/crypto/caam/caamalg_qi2.c | 10 ++
3 files changed, 6 insertions(+), 24 deletions(-)
diff
Check zero-length input, for skcipher algorithm, to solve the extra
tests. This is a valid operation, therefore the API will return no error.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caamalg.c | 6 ++
drivers/crypto/caam/caamalg_qi.c | 3
Note: in most error cases caam/qi and caam/qi2 returned -EIO; align all
caam drivers to return -EINVAL.
While here, ratelimit prints triggered by fuzz testing, such that
console is not flooded.
Signed-off-by: Horia Geantă
Signed-off-by: Iuliana Prodan
---
drivers/crypto/caam/caamalg.
- fix error handling in ERN handler
crypto: caam - fix return code in completion callbacks
crypto: caam - update IV only when crypto operation succeeds
crypto: caam - keep both virtual and dma key addresses
crypto: caam - fix MDHA key derivation for certain user key lengths
Iuliana Pro
Check authsize to solve the extra tests that expect -EINVAL to be
returned when the authentication tag size is not valid.
Validated authsize for GCM, RFC4106 and RFC4543.
Signed-off-by: Iuliana Prodan
---
drivers/crypto/caam/caamalg.c | 13 +
drivers/crypto/caam/caamalg_qi.c
From: Horia Geantă
Fuzz testing uncovered an issue when |user key| > |derived key|.
Derived key generation has to be fixed in two cases:
1. Era >= 6 (DKP is available)
DKP cannot be used with immediate input key if |user key| > |derived key|,
since the resulting descriptor (after DKP execution)
From: Horia Geantă
Update alginfo struct to keep both virtual and dma key addresses,
so that descriptors have them at hand.
One example where this is needed is in the xcbc(aes) shared descriptors,
which are updated in current patch.
Another example is the upcoming fix for DKP.
Signed-off-by: Hor
rt top level drivers to libraries")
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caampkc.c | 11 +++
drivers/crypto/caam/caamrng.c | 14 +-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/caam/caampk
Check key length to solve the extra tests that expect -EINVAL to be
returned when the key size is not valid.
Validated AES keylen for skcipher, ahash and aead.
Signed-off-by: Iuliana Prodan
---
Changes since v2:
- remove check for keylen < 4, since is included in check_aes_keylen;
- upd
Check the return value of the hardware registration for caam_rng and free
resources in case of failure.
Fixes: e24f7c9 ("crypto: caam - hwrng support")
Signed-off-by: Iuliana Prodan
---
Changes since v2:
- update Fixes tag.
---
drivers/crypto/caam/caamrng.c | 5 -
1 file
Update share descriptor for rfc4106 to skip instructions in case
cryptlen is zero. If no instructions are jumped the DECO hangs and a
timeout error is thrown.
Signed-off-by: Iuliana Prodan
---
Changes since v2:
- update shared descriptor with the erratum workaround.
---
drivers/crypto/caam
aries")
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caampkc.c | 49 ++-
1 file changed, 30 insertions(+), 19 deletions(-)
diff --git a/drivers/crypto/caam/caampkc.c b/drivers/crypto/caam/caampkc.c
index cfdf7a2..a669
From: Horia Geantă
skcipher encryption might fail and in some cases, like (invalid) input
length smaller then block size, updating the IV would lead to panic
due to copying from a negative offset (req->cryptlen - ivsize).
Signed-off-by: Horia Geantă
Signed-off-by: Iuliana Prodan
---
driv
d.
Signed-off-by: Iuliana Prodan
Reviewed-by: Horia Geanta
---
drivers/crypto/caam/caamhash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index 7147190..3a1dfd2 100644
--- a/drivers/crypto/caam/caamhash.c
+++
From: Horia Geantă
ERN handler calls the caam/qi frontend "done" callback with a status
of -EIO. This is incorrect, since the callback expects a status value
meaningful for the crypto engine - hence the cryptic messages
like the one below:
platform caam_qi: 15: unknown error source
Fix this by p
uld be restricted to 16 or 20
bytes, as for rfc4106.
Signed-off-by: Iuliana Prodan
---
Changes since v1:
- use helper functions added in crypto API, in series:
https://patchwork.kernel.org/project/linux-crypto/list/?series=150651
crypto/gcm.c | 12
1 file changed, 12 inserti
Added inline helper functions to check authsize and assoclen for
gcm and rfc4106.
These are used in the generic implementation of gcm and rfc4106.
Signed-off-by: Iuliana Prodan
---
crypto/gcm.c | 41 +++-
include/crypto/gcm.h | 53
1 - 100 of 164 matches
Mail list logo