You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/01/07 03:13:51 UTC

[incubator-nuttx-apps] branch master updated: crypto/libtomcrypt: added CONFIG_LIBTOMCRYPT_HASHSUM option to build hashsum app

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 61fe9c4  crypto/libtomcrypt: added CONFIG_LIBTOMCRYPT_HASHSUM option to build hashsum app
61fe9c4 is described below

commit 61fe9c4fa29779588382cb1d514018b34dc5314a
Author: Alexander Lunev <al...@mail.ru>
AuthorDate: Fri Jan 7 00:44:26 2022 +0300

    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 b36b159..ca8fc3f 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 2e00068..c6b0211 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"