summaryrefslogtreecommitdiffstats
path: root/arch/arm/crypto
Commit message (Collapse)AuthorAgeFilesLines
* ARM64: crypto: add Crypto Extensions accelerated SHA implementationAhmad Fatoum2023-05-265-0/+525
| | | | | | | | | | | | | | | | | | | | | | | | | | | This imports the Linux v6.3 state of the ARMv8 Crypto Extensions (CE) accelerated SHA1/SHA2 routines. This increases hashing rate a tenfold: sha1-generic: digest(7 bytes) = 11750ns digest(4097 bytes) = 59125ns sha224-generic: digest(7 bytes) = 12750ns digest(4097 bytes) = 95000ns sha256-generic: digest(7 bytes) = 2250ns digest(4097 bytes) = 94875ns sha1-ce: digest(7 bytes) = 2875ns digest(4097 bytes) = 8125ns sha224-ce: digest(7 bytes) = 3125ns digest(4097 bytes) = 7750ns sha256-ce: digest(7 bytes) = 750ns digest(4097 bytes) = 7625ns This shaves 400ms of a FIT image boot that uses sha256 as digest for the images referenced by the selected configuration: barebox@imx8mn-old:/ time bootm -d kernel-a Dryrun. Aborted. time: 998ms barebox@imx8mn-new:/ time bootm -d kernel-a Dryrun. Aborted. time: 601ms Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230526063746.1155297-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: add SPDX-License-Identifier for .gitignoreAhmad Fatoum2022-01-051-0/+2
| | | | | | | | | Makes the files not appear when searching for files that lack SPDX-License-Identifier. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: add SPDX-License-Identifier for Kbuild/KconfigAhmad Fatoum2022-01-051-0/+1
| | | | | | | | | | | | | | | To verify only Kconfig/Makefile is touched: git show --numstat --format=oneline HEAD | grep -v 'Kconfig\|Makefile' will print only arch/powerpc/Kbuild. To verify nothing unexpected is added: git show -U0 | grep '^-[^-]\|^+[^+]' | sort -u Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: sha256: Remove unused header fileSascha Hauer2019-03-181-23/+0
| | | | | | sha256_glue.h is not being unsed in the tree. Remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: sha256: Remove unused functionsSascha Hauer2019-03-181-18/+0
| | | | | | sha256_export and sha256_import are not used in the tree. remove them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Make locally used functions staticSascha Hauer2019-03-182-7/+5
| | | | | | | Many functions are only used locally but still are globally visible. Make these function static. Avoids warnings generated with -Wmissing-prototypes Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kbuild: add .SECONDARY special targetMasahiro Yamada2019-01-031-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on the following Linux commits: - 54a702f70589 ("kbuild: mark $(targets) as .SECONDARY and remove .PRECIOUS markers") - 8e9b61b293d9 ("kbuild: move .SECONDARY special target to Kbuild.include") This consolidates those two commits and adjusts commit log for barebox. GNU Make automatically deletes intermediate files that are updated in a chain of pattern rules. Example 1) %.dtb.o <- %.dtb.S <- %.dtb <- %.dts Example 2) %.o <- %.c <- %.c_shipped arch/arm/crypto/Makefile marks such targets as .PRECIOUS to prevent Make from deleting them, but the correct way is to use .SECONDARY. .SECONDARY Prerequisites of this special target are treated as intermediate files but are never automatically deleted. .PRECIOUS When make is interrupted during execution, it may delete the target file it is updating if the file was modified since make started. If you mark the file as precious, make will never delete the file if interrupted. Both can avoid deletion of intermediate files, but the difference is the behavior when Make is interrupted; .SECONDARY deletes the target, but .PRECIOUS does not. The use of .PRECIOUS is relatively rare since we do not want to keep partially constructed (possibly corrupted) targets. .SECONDARY with no prerequisites causes all targets to be treated as secondary. This agrees the policy of Kbuild. scripts/Kbuild.include seems a suitable place to add it because it is included from almost all sub-makes. I deleted 'SECONDARY' (no dot) from images/Makefile, which I guess a typo. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: crypto: fix SHA256 shipped assembler codeLucas Stach2018-10-081-1/+1
| | | | | | | | | | | | | | | | Binutils 2.29 changed behavior of the adr instruction to always add the thumb mode switch offset, which breaks usages where the user is interested in the address of an internal symbol, instead of a jump address. Binutils 3.31 fixed this by only adding the offset when interworking is required. As there are toolchains out there with broken binutils, it's better to fix the code to work around the issue by not using the named label. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Tested-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: crypto: initialize digests earlierSascha Hauer2018-03-012-3/+3
| | | | | | | | We moved the digest init functions to coredevice_initcall level. Do the same with the ARM specific digests aswell so that they are available at the same time. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* crypto: add digest_alloc_by_algo()Sascha Hauer2016-01-262-0/+3
| | | | | | | | | | | In barebox the function digest_alloc() allocates a digest based on a string. When a subsystem already uses an integer value to identify a digest it makes no sense to create a string and pass it to digest_alloc(), where it is parsed again. This patch adds the possibility to get a digest by an enum. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm/crypto: add generated sha256-core.S to gitignoreMarc Kleine-Budde2015-05-261-0/+1
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: crypto: add sha256 assembly supportJean-Christophe PLAGNIOL-VILLARD2015-03-275-0/+3742
| | | | | | | | | | | | | | | linux arm sha256 current $ ls -al build/versatilpb/arch/arm/pbl/zbarebox.bin -rw-r--r-- 1 root root 207786 Mar 24 13:23 build/versatilpb/arch/arm/pbl/zbarebox.bin linux arm v4 asm implementation for sha256 $ ls -al build/versatilpb/arch/arm/pbl/zbarebox.bin -rw-r--r-- 1 root root 205007 Mar 24 16:47 build/versatilpb/arch/arm/pbl/zbarebox.bin we win 2779 bytes and speed cf code Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: crypto: add sha1 assembly supportJean-Christophe PLAGNIOL-VILLARD2015-03-273-0/+641
from Linux 3.9 linux generic implementation $ ls -al build/versatilpb/arch/arm/pbl/zbarebox.bin -rw-r--r-- 1 root root 210829 Mar 24 13:21 build/versatilpb/arch/arm/pbl/zbarebox.bin linux arm v4 asm implementation $ ls -al build/versatilpb/arch/arm/pbl/zbarebox.bin -rw-r--r-- 1 root root 207786 Mar 24 13:23 build/versatilpb/arch/arm/pbl/zbarebox.bin we win 3043 bytes and speed cf code Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>