aboutsummaryrefslogtreecommitdiff
path: root/libbb/Config.src
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2025-06-09 13:23:49 +0100
committerRon Yorston <rmy@pobox.com>2025-06-09 13:23:49 +0100
commit596c443112d09506c3bf13ac98046a84b912e56c (patch)
tree896fd4d7e43a71a8a15dbcec17f6cafcbe622635 /libbb/Config.src
parent854c647da7a84cf2aaa2c9a84ff1ca353bdaf9cf (diff)
downloadbusybox-w32-cng_backend.tar.gz
busybox-w32-cng_backend.tar.bz2
busybox-w32-cng_backend.zip
Use Windows library for cryptographic checksumscng_backend
Add a new feature to libbb, FEATURE_USE_CNG_API, which enables the use of the Cryptography API: Next Generation library to calculate checksums. It is disabled by default except in the mingw64u default config, as the API requires Windows 10+ to function. Usage of this API provides a size benefit and delegates hardware optimizations to the operating system cryptography library. Based on GitHub PR #498 by rfl890. Saves 4064 bytes in the mingw64u case.
Diffstat (limited to 'libbb/Config.src')
-rw-r--r--libbb/Config.src10
1 files changed, 10 insertions, 0 deletions
diff --git a/libbb/Config.src b/libbb/Config.src
index 61b4601d6..ed6521c33 100644
--- a/libbb/Config.src
+++ b/libbb/Config.src
@@ -37,6 +37,14 @@ config PASSWORD_MINLEN
37 help 37 help
38 Minimum allowable password length. 38 Minimum allowable password length.
39 39
40config FEATURE_USE_CNG_API
41 bool "Use the Windows CNG API for checksums (Windows 10+ only)"
42 default n
43 depends on PLATFORM_MINGW32
44 help
45 Use the in-built Windows CNG API for checksums.
46 This reduces code size, but is only supported on Windows 10+.
47
40config MD5_SMALL 48config MD5_SMALL
41 int "MD5: Trade bytes for speed (0:fast, 3:slow)" 49 int "MD5: Trade bytes for speed (0:fast, 3:slow)"
42 default 1 # all "fast or small" options default to small 50 default 1 # all "fast or small" options default to small
@@ -67,6 +75,7 @@ config SHA1_SMALL
67config SHA1_HWACCEL 75config SHA1_HWACCEL
68 bool "SHA1: Use hardware accelerated instructions if possible" 76 bool "SHA1: Use hardware accelerated instructions if possible"
69 default y 77 default y
78 depends on !FEATURE_USE_CNG_API
70 help 79 help
71 On x86, this adds ~590 bytes of code. Throughput 80 On x86, this adds ~590 bytes of code. Throughput
72 is about twice as fast as fully-unrolled generic code. 81 is about twice as fast as fully-unrolled generic code.
@@ -74,6 +83,7 @@ config SHA1_HWACCEL
74config SHA256_HWACCEL 83config SHA256_HWACCEL
75 bool "SHA256: Use hardware accelerated instructions if possible" 84 bool "SHA256: Use hardware accelerated instructions if possible"
76 default y 85 default y
86 depends on !FEATURE_USE_CNG_API
77 help 87 help
78 On x86, this adds ~1k bytes of code. 88 On x86, this adds ~1k bytes of code.
79 89