From 61fe9c4fa29779588382cb1d514018b34dc5314a Mon Sep 17 00:00:00 2001 From: Alexander Lunev Date: Fri, 7 Jan 2022 00:44:26 +0300 Subject: [PATCH] crypto/libtomcrypt: added CONFIG_LIBTOMCRYPT_HASHSUM option to build hashsum app --- crypto/libtomcrypt/Kconfig | 51 +++++++++++++++++++++++++++---------- crypto/libtomcrypt/Makefile | 8 ++++++ 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/crypto/libtomcrypt/Kconfig b/crypto/libtomcrypt/Kconfig index b36b159b4..ca8fc3f4e 100644 --- a/crypto/libtomcrypt/Kconfig +++ b/crypto/libtomcrypt/Kconfig @@ -12,7 +12,7 @@ menuconfig CRYPTO_LIBTOMCRYPT cryptographic toolkit that provides developers with a vast array of well known published block ciphers, one-way hash functions, chaining modes, pseudo-random number generators, public key - cryptography and a plethora of other routines. + cryptography and a plethora of other routines. if CRYPTO_LIBTOMCRYPT @@ -29,29 +29,54 @@ menuconfig LIBTOMCRYPT_DEMOS if LIBTOMCRYPT_DEMOS config LIBTOMCRYPT_LTCRYPT - tristate "LibTomCrypt ltcrypt" - default n - ---help--- - Demo encrypt/decrypt application + tristate "LibTomCrypt ltcrypt" + default n + ---help--- + Demo encrypt/decrypt application if LIBTOMCRYPT_LTCRYPT config LIBTOMCRYPT_LTCRYPT_PROGNAME - string "ltcrypt program name" - default "ltcrypt" - ---help--- - LibTomMath ltcrypt application name + string "ltcrypt program name" + default "ltcrypt" + ---help--- + LibTomMath ltcrypt application name config LIBTOMCRYPT_LTCRYPT_PRIORITY - int "ltcrypt application priority" - default 100 + int "ltcrypt application priority" + default 100 config LIBTOMCRYPT_LTCRYPT_STACKSIZE - int "ltcrypt application stack size" - default DEFAULT_TASK_STACKSIZE + int "ltcrypt application stack size" + default DEFAULT_TASK_STACKSIZE endif # LIBTOMCRYPT_LTCRYPT +config LIBTOMCRYPT_HASHSUM + tristate "LibTomCrypt hashsum" + depends on SCHED_ATEXIT + default n + ---help--- + Demo hashsum application + +if LIBTOMCRYPT_HASHSUM + +config LIBTOMCRYPT_HASHSUM_PROGNAME + string "hashsum program name" + default "hashsum" + ---help--- + LibTomMath hashsum application name + +config LIBTOMCRYPT_HASHSUM_PRIORITY + int "hashsum application priority" + default 100 + +config LIBTOMCRYPT_HASHSUM_STACKSIZE + int "hashsum application stack size" + default DEFAULT_TASK_STACKSIZE + +endif # LIBTOMCRYPT_HASHSUM + endif # LIBTOMCRYPT_DEMOS endif # CRYPTO_LIBTOMCRYPT diff --git a/crypto/libtomcrypt/Makefile b/crypto/libtomcrypt/Makefile index 2e00068de..c6b021105 100644 --- a/crypto/libtomcrypt/Makefile +++ b/crypto/libtomcrypt/Makefile @@ -192,6 +192,14 @@ PRIORITY += $(CONFIG_LIBTOMCRYPT_LTCRYPT_PRIORITY) STACKSIZE += $(CONFIG_LIBTOMCRYPT_LTCRYPT_STACKSIZE) endif +ifneq ($(CONFIG_LIBTOMCRYPT_HASHSUM),) +MAINSRC += libtomcrypt/demos/hashsum.c + +PROGNAME += $(CONFIG_LIBTOMCRYPT_HASHSUM_PROGNAME) +PRIORITY += $(CONFIG_LIBTOMCRYPT_HASHSUM_PRIORITY) +STACKSIZE += $(CONFIG_LIBTOMCRYPT_HASHSUM_STACKSIZE) +endif + endif CONFIG_LIBTOMCRYPT_URL ?= "https://github.com/libtom/libtomcrypt/archive"