From 35d6a9fbd3313cccbd0de4bc122d6a6764adfa17 Mon Sep 17 00:00:00 2001 From: Jin Xu Date: Fri, 6 Nov 2026 09:04:31 +0800 Subject: [PATCH 1/2] Remove the LibTomCrypt PRNG lookups that nothing calls crypt_find_prng.c and crypt_prng_is_valid.c define find_prng and prng_is_valid. Nothing in the package calls either: SQLCipher registers Fortuna and calls the fortuna_* functions directly, and the LibTomCrypt functions that look PRNGs up by name or index are not included. cgo compiled and linked both files into every build all the same. --- crypt_find_prng.c | 39 --------------------------------------- crypt_prng_is_valid.c | 34 ---------------------------------- 2 files changed, 73 deletions(-) delete mode 100644 crypt_find_prng.c delete mode 100644 crypt_prng_is_valid.c diff --git a/crypt_find_prng.c b/crypt_find_prng.c deleted file mode 100644 index 832011e7..00000000 --- a/crypt_find_prng.c +++ /dev/null @@ -1,39 +0,0 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - */ -#include "tomcrypt.h" - -/** - @file crypt_find_prng.c - Find a PRNG, Tom St Denis -*/ - -/** - Find a registered PRNG by name - @param name The name of the PRNG to look for - @return >= 0 if found, -1 if not present -*/ -int find_prng(const char *name) -{ - int x; - LTC_ARGCHK(name != NULL); - LTC_MUTEX_LOCK(<c_prng_mutex); - for (x = 0; x < TAB_SIZE; x++) { - if ((prng_descriptor[x].name != NULL) && XSTRCMP(prng_descriptor[x].name, name) == 0) { - LTC_MUTEX_UNLOCK(<c_prng_mutex); - return x; - } - } - LTC_MUTEX_UNLOCK(<c_prng_mutex); - return -1; -} - - -/* ref: tag: v1.18.2, master */ -/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */ -/* commit time: 2018-07-01 22:49:01 +0200 */ diff --git a/crypt_prng_is_valid.c b/crypt_prng_is_valid.c deleted file mode 100644 index 865c9dc4..00000000 --- a/crypt_prng_is_valid.c +++ /dev/null @@ -1,34 +0,0 @@ -/* LibTomCrypt, modular cryptographic library -- Tom St Denis - * - * LibTomCrypt is a library that provides various cryptographic - * algorithms in a highly modular and flexible manner. - * - * The library is free for all purposes without any express - * guarantee it works. - */ -#include "tomcrypt.h" - -/** - @file crypt_prng_is_valid.c - Determine if PRNG is valid, Tom St Denis -*/ - -/* - Test if a PRNG index is valid - @param idx The index of the PRNG to search for - @return CRYPT_OK if valid -*/ -int prng_is_valid(int idx) -{ - LTC_MUTEX_LOCK(<c_prng_mutex); - if (idx < 0 || idx >= TAB_SIZE || prng_descriptor[idx].name == NULL) { - LTC_MUTEX_UNLOCK(<c_prng_mutex); - return CRYPT_INVALID_PRNG; - } - LTC_MUTEX_UNLOCK(<c_prng_mutex); - return CRYPT_OK; -} - -/* ref: tag: v1.18.2, master */ -/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */ -/* commit time: 2018-07-01 22:49:01 +0200 */ From 36eb1c57cf3056cae86413918c25ea1b5c85c84a Mon Sep 17 00:00:00 2001 From: Jin Xu Date: Fri, 6 Nov 2026 09:04:31 +0800 Subject: [PATCH 2/2] Remove the empty go.sum The module has no dependencies, so go.sum has been empty since go-sqlite3 dropped its last requirement, and go mod tidy does not recreate it. --- go.sum | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 go.sum diff --git a/go.sum b/go.sum deleted file mode 100644 index e69de29b..00000000