21 Mar, 2014
7 commits
-
Add test vectors for aead with null encryption and md5,
respectively sha1 authentication.
Input data is taken from test vectors listed in RFC2410.Signed-off-by: Horia Geanta
Signed-off-by: Herbert Xu -
These defines might be needed by crypto drivers.
Signed-off-by: Horia Geanta
Signed-off-by: Herbert Xu -
Commit 61bb86bba169507a5f223b94b9176c32c84b4721
("crypto: caam - set descriptor sharing type to SERIAL")
changed the descriptor sharing mode from SHARE_WAIT to SHARE_SERIAL.All descriptor commands that handle the "ok to share" and
"error propagation" settings should also go away, since they have no
meaning for SHARE_SERIAL.Signed-off-by: Horia Geanta
Signed-off-by: Herbert Xu -
The ahash_def_finup() can make use of the request save/restore functions,
thus make it so. This simplifies the code a little and unifies the code
paths.Note that the same remark about free()ing the req->priv applies here, the
req->priv can only be free()'d after the original request was restored.Finally, squash a bug in the invocation of completion in the ASYNC path.
In both ahash_def_finup_done{1,2}, the function areq->base.complete(X, err);
was called with X=areq->base.data . This is incorrect , as X=&areq->base
is the correct value. By analysis of the data structures, we see the areq is
of type 'struct ahash_request' , areq->base is of type 'struct crypto_async_request'
and areq->base.completion is of type crypto_completion_t, which is defined in
include/linux/crypto.h as:typedef void (*crypto_completion_t)(struct crypto_async_request *req, int err);
This is one lead that the X should be &areq->base . Next up, we can inspect
other code which calls the completion callback to give us kind-of statistical
idea of how this callback is used. We can try:$ git grep base\.complete\( drivers/crypto/
Finally, by inspecting ahash_request_set_callback() implementation defined
in include/crypto/hash.h , we observe that the .data entry of 'struct
crypto_async_request' is intended for arbitrary data, not for completion
argument.Signed-off-by: Marek Vasut
Cc: David S. Miller
Cc: Fabio Estevam
Cc: Herbert Xu
Cc: Shawn Guo
Cc: Tom Lendacky
Signed-off-by: Herbert Xu -
The functions to save original request within a newly adjusted request
and it's counterpart to restore the original request can be re-used by
more code in the crypto/ahash.c file. Pull these functions out from the
code so they're available.Signed-off-by: Marek Vasut
Cc: David S. Miller
Cc: Fabio Estevam
Cc: Herbert Xu
Cc: Shawn Guo
Cc: Tom Lendacky
Signed-off-by: Herbert Xu -
Add documentation for the pointer voodoo that is happening in crypto/ahash.c
in ahash_op_unaligned(). This code is quite confusing, so add a beefy chunk
of documentation.Moreover, make sure the mangled request is completely restored after finishing
this unaligned operation. This means restoring all of .result, .base.data
and .base.complete .Also, remove the crypto_completion_t complete = ... line present in the
ahash_op_unaligned_done() function. This type actually declares a function
pointer, which is very confusing.Finally, yet very important nonetheless, make sure the req->priv is free()'d
only after the original request is restored in ahash_op_unaligned_done().
The req->priv data must not be free()'d before that in ahash_op_unaligned_finish(),
since we would be accessing previously free()'d data in ahash_op_unaligned_done()
and cause corruption.Signed-off-by: Marek Vasut
Cc: David S. Miller
Cc: Fabio Estevam
Cc: Herbert Xu
Cc: Shawn Guo
Cc: Tom Lendacky
Signed-off-by: Herbert Xu -
Found by the kbuild test robot, the first argument to caam_init_rng
has a spurious ampersand.Reported-by: kbuild test robot
Signed-off-by: Herbert Xu
10 Mar, 2014
18 commits
-
HIGHMEM pages may not be mapped so we must kmap them before accessing.
This resolves a random OOPs error that was showing up during OpenSSL SHA tests.Signed-off-by: Joel Fernandes
Signed-off-by: Herbert Xu -
This patch allocates memory from DMAable region to the caam_rng_ctx object,
earlier it had been statically allocated which resulted in errorneous
behaviour on inserting the caamrng module at the runtime.Signed-off-by: Nitesh Lal
Acked-by: Ruchika Gupta
Signed-off-by: Herbert Xu -
This adds the function blkcipher_aead_walk_virt_block, which allows the caller
to use the blkcipher walk API to handle the input and output scatterlists.Signed-off-by: Ard Biesheuvel
Signed-off-by: Herbert Xu -
In order to allow other uses of the blkcipher walk API than the blkcipher
algos themselves, this patch copies some of the transform data members to the
walk struct so the transform is only accessed at walk init time.Signed-off-by: Ard Biesheuvel
Signed-off-by: Herbert Xu -
When bringing a new RNG source online, it seems like it would make sense
to use some of its bytes to make the system entropy pool more random,
as done with all sorts of other devices that contain per-device or
per-boot differences.Signed-off-by: Kees Cook
Reviewed-by: Jason Cooper
Signed-off-by: Herbert Xu -
Optimize the hashing operation in the MXS-DCP by doing two adjustments:
1) Given that the output buffer for the hash is now always correctly aligned,
we can just use the buffer for the DCP DMA to store the resulting hash.
We thus get rid of one copying of data. Moreover, we remove an entry from
dcp_coherent_block{} and thus lower the memory footprint of the driver.
2) We map the output buffer for the hash for DMA only in case we will output
the hash, not always, as it was now.Signed-off-by: Marek Vasut
Cc: David S. Miller
Cc: Fabio Estevam
Cc: Herbert Xu
Cc: Shawn Guo
Cc: Tom Lendacky
Signed-off-by: Herbert Xu -
The DCP needs the bounce buffers, DMA descriptors and result buffers aligned
to 64 bytes (yet another hardware limitation). Make sure they are aligned by
properly aligning the structure which contains them during allocation.Signed-off-by: Marek Vasut
Cc: David S. Miller
Cc: Fabio Estevam
Cc: Herbert Xu
Cc: Shawn Guo
Cc: Tom Lendacky
Signed-off-by: Herbert Xu -
Make omap_des_copy_needed(), omap_des_copy_sgs(), because these
functions are used only in this file.Signed-off-by: Jingoo Han
Acked-by: Joel Fernandes
Signed-off-by: Herbert Xu -
Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler.
Signed-off-by: Jingoo Han
Signed-off-by: Herbert Xu -
Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler.
Signed-off-by: Jingoo Han
Signed-off-by: Herbert Xu -
Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler.
Signed-off-by: Jingoo Han
Acked-by: Nishanth Menon
Signed-off-by: Herbert Xu -
Use devm_*() functions to make cleanup paths simpler.
Signed-off-by: Jingoo Han
Signed-off-by: Herbert Xu -
Use devm_*() functions to make cleanup paths simpler.
Signed-off-by: Jingoo Han
Reviewed-by: Linus Walleij
Signed-off-by: Herbert Xu -
Use devm_clk_get() to make cleanup paths simpler.
Signed-off-by: Jingoo Han
Signed-off-by: Herbert Xu -
Use devm_clk_get() to make cleanup paths simpler.
Signed-off-by: Jingoo Han
Signed-off-by: Herbert Xu -
Use devm_clk_get() to make cleanup paths simpler.
Signed-off-by: Jingoo Han
Acked-by: Peter Korsgaard
Acked-by: Nicolas Ferre
Signed-off-by: Herbert Xu -
1) SSYNC instruction is blackfin specific and takes no effect in this driver.
2) DMA descriptor and SG middle buffer are in DMA coherent memory. No need
to flush.
3) Turn kzalloc, ioremap and request_irq into managed device APIs respectively.Signed-off-by: Sonic Zhang
Signed-off-by: Herbert Xu -
Signed-off-by: Alexander Shiyan
Signed-off-by: Herbert Xu
27 Feb, 2014
14 commits
-
When the crypto layer is able to queue up a command for processing
by the CCP on the initial call to ccp_crypto_enqueue_request and
the CCP returns -EBUSY, then if the backlog flag is not set the
command needs to be freed and not added to the active command list.Signed-off-by: Tom Lendacky
Signed-off-by: Herbert Xu -
Invoke the callback routine associated with the crypto context
if an error is encountered sending the command to the CCP during
backlog processing. This is needed to free any resources used
by the command.Signed-off-by: Tom Lendacky
Signed-off-by: Herbert Xu -
If a CCP command has been queued for processing at the
crypto layer then, when dequeueing it for processing, the
"can backlog" flag must be set so that the request isn't
lost if the CCP backlog queue limit is reached.Signed-off-by: Tom Lendacky
Signed-off-by: Herbert Xu -
My guess is that this little endian configuration is never found in real
life, but if it were then the writel() arguments are in the wrong order
so the driver would crash immediately.Signed-off-by: Dan Carpenter
Acked-by: Kim Phillips
Signed-off-by: Herbert Xu -
This driver has never been hooked up in any board file, and cannot be
instantiated via device tree. I've been told that, at least on Tegra20,
the HW is slower at crypto than the main CPU. I have no test-case for
it. Hence, remove it.Cc: Varun Wadekar
Signed-off-by: Stephen Warren
Signed-off-by: Herbert Xu -
Add config and build options for the omap-des driver.
Signed-off-by: Joel Fernandes
Signed-off-by: Herbert Xu -
Add omap-des driver with platform data for OMAP4/AM43xx. Support added for DES
ECB and CBC modes. Also add support for 3DES operation where 3 64-bit keys are
used to perform a DES encrypt-decrypt-encrypt (des3_ede) operation on a buffer.Tests have been conducted with the CRYPTO test manager, and functionality is
verified at different page length alignments.Signed-off-by: Joel Fernandes
Signed-off-by: Herbert Xu -
We should test the error case for each platform_get_irq() assignment and
propagate the error accordingly.Signed-off-by: Fabio Estevam
Acked-by: Marek Vasut
Signed-off-by: Herbert Xu -
We checked "nbytes < bsize" before so it can't happen here.
Signed-off-by: Dan Carpenter
Acked-by: Jussi Kivilinna
Acked-by: Johannes Götzfried
Signed-off-by: Herbert Xu -
Use devm_ioremap_resource() in order to make the code simpler,
and remove redundant return value check of platform_get_resource()
because the value is checked by devm_ioremap_resource().Signed-off-by: Jingoo Han
Signed-off-by: Herbert Xu -
Use devm_ioremap_resource() in order to make the code simpler,
and remove redundant return value check of platform_get_resource()
because the value is checked by devm_ioremap_resource().Signed-off-by: Jingoo Han
Acked-by: Peter Korsgaard
Acked-by: Nicolas Ferre
Signed-off-by: Herbert Xu -
Use devm_ioremap_resource() in order to make the code simpler,
and remove redundant return value check of platform_get_resource()
because the value is checked by devm_ioremap_resource().Signed-off-by: Jingoo Han
Signed-off-by: Herbert Xu -
Use devm_ioremap_resource() in order to make the code simpler,
and remove redundant return value check of platform_get_resource()
because the value is checked by devm_ioremap_resource().Signed-off-by: Jingoo Han
Signed-off-by: Herbert Xu -
Use devm_ioremap_resource() in order to make the code simpler,
and remove redundant return value check of platform_get_resource()
because the value is checked by devm_ioremap_resource().Signed-off-by: Jingoo Han
Signed-off-by: Herbert Xu
25 Feb, 2014
1 commit
-
We added the soft module dependency of crc32c module alias
to generic crc32c module so other hardware accelerated crc32c
modules could get loaded and used before the generic version.
We also renamed the crypto/crc32c.c containing the generic
crc32c crypto computation to crypto/crc32c_generic.c according
to convention.Signed-off-by: Tim Chen
Signed-off-by: Herbert Xu