aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c
Commit message (Collapse)AuthorAgeFilesLines
* ltq-deu: remove compiler warning and shorten locked sectionsDaniel Kestrel2022-01-061-3/+2
| | | | | | | | | | | | Removing hash pointer in _hmac_setkey since its not needed and causes a compiler warning. Make the spinlock control sections shorter and move initializations out of the control sections to free the spinlock faster for allowing other threads to use the hash engine. Minor improvements for indentation and removal of blanks and blank lines in some areas. Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
* ltq-deu: changes for hash multithread callers and md5 endianessDaniel Kestrel2022-01-061-42/+15
| | | | | | | | | | | | | | | | | | | | | | | | | The algorithms sha1, sha1_hmac and md5_hmac all use ENDI=1. The md5 algorithm uses ENDI=0 and the endian_swap methods to reverse the endianess switch by using user CPU time, which is unnecessary overhead. Danube and AR9 devices do not set endianess for SHA1, so is done for MD5. Furthermore the patch replaces endian_swap with le32_to_cpu for md5 and md5 hmac algorithms and removes endian_swap for them. The init functions initialize the algorithm in the hardware. The lock is not used to write to the control register. If another thread calls another hash algo before update or final, the result will be wrong. Therefore move the algorithm init to the lock protected sections in the transform or final methods. Setting the hw key for the hmac algorithms is now done from within the lock protected sections in their final methods. The lock protecting is removed from the _hmac_setkey_hw functions. In final for md5 and sha1 the lock section is removed, because all the work was already done in transform (which is called from final). As such only copying the hash to the output is required. MD5 and MD5_HMAC produce 16 byte hashes (4 DWORDS) only, therefor writing register D5R to the hash output is removed for MD5_HMAC. Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
* ltq-deu: make deu hash lock global and remove md5_hmac_ exportsDaniel Kestrel2022-01-061-11/+4
| | | | | | | | | | | All hash algorithms use the same base IFX_HASH_CON to access the hash unit. Parallel threads should not be able to call different hash algorithms and therefor a global lock is required. Fixed linker warning, that md5_hmac_init, md5_hmac_update and md5_hmac_final are static export symbols. The export symbols are not required, because the functions are exposed using shash_alg structure. Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
* ltq-deu: make cipher/digest usable by opensslMathias Kresin2022-01-051-1/+1
| | | | | | | | | | OpenSSL with cryptdev support uses the data encryption unit (DEU) driver for hard accelerated processing of ciphers/digests, if the flag CRYPTO_ALG_KERN_DRIVER_ONLY is set. Signed-off-by: Mathias Kresin <dev@kresin.me> [fix commit title prefix] Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
* lantiq: ltq-deu: fix compatibility with Linux 5.3+Martin Blumenstingl2020-03-161-1/+1
| | | | | | | | | | Upstream commit 84ede58dfcd1d ("crypto: hash - remove CRYPTO_ALG_TYPE_DIGEST") drops the CRYPTO_ALG_TYPE_DIGEST define because it has the same value as CRYPTO_ALG_TYPE_HASH. This was the case for earlier kernels as well. Switch to CRYPTO_ALG_TYPE_HASH to fix building against Linux 5.4. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
* ltq-deu: Fix section mismatchesHauke Mehrtens2018-03-181-4/+4
| | | | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* ltq-deu: fix cra_priorityMartin Schiller2016-08-201-0/+1
| | | | | | | | | | With the default priority of 0, the DEU algos would be overlapped by the generic algos (if available). To fix this, set the cra_priority of the hardware algos to the recommended value of 300/400. Signed-off-by: Martin Schiller <mschiller@tdt.de>
* packages: clean up the package folderJohn Crispin2013-06-211-0/+310
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 37007